Convert a data disk from MBR to GPT (without losing data)
The reason for this is very simple. MBR partitions do not work above 2 TB. I had (long story…) a 2 TB NTFS partition on a 4 TB USB hard drive. Windows provides a command-line tool, MBR2GPT.EXE, but it works only on bootable disks with Windows installed. And a request for making it work with data disks has been dismissed from Microsoft.
The prevailing wisdom is “do a backup”. But even if I do – or already have – a backup, if I want to enlarge a 2 TB partition it will take a long time to rewrite all data to the disk. So it is much better to convert the disk in-place.
You can find procedures on the web, but they focus on system disks. Actually, the procedure is extremely simple if you have only a data disk, but you have to use non-Microsoft tools.
I used Ubuntu 22.04, as a VMWare virtual machine on a Windows 10 host. It has the ability to connect an USB device to the virtual machine, but I had to replace the line
usb.restrictions.defaultAllow = "TRUE"
with
usb.restrictions.defaultAllow = "TRUE"
in the .vmx file.
Afterwards, I connected the USB drive to the VM. It appeared as /dev/sdc. The procedure is then as simple as:
# umount /dev/sdc1 (to remove the mount for the existing partition) # gdisk /dev/sdc
This automatically converts the partition to GPT, you have only to write it to the disk with [w] and confirm.
Just to read again the disk in Linux, simply do the following:
# partprobe
In Ubuntu, this will also make the partition to mount again (and you can check everything is there).
That’s all! In my case, I then went back to windows and enlarged the 2 TB partition with the Disk Administration tool.