Converting MBR to GPT

Converting a DOS (MBR) partition layout to GPT without losing data is remarkably straightforward with the gdisk utility. Why this is straightforward is explained by the gdisk author.

Before converting a production disk, converting can be tested with a virtual machine (VM).

Create a new VM. Create an empty but realistic virtual disk size of at least 20 GB.

Ensure the VM has sufficient RAM to run a Live ISO that contains gdisk. The Live ISO should also contain fdisk, cfdisk, and gparted.

Boot the VM with the Live ISO. Using fdisk, cfdisk, or gparted, format the virtual disk with the older DOS (MBR) partition layout. Create at least one Primary partition but also create a Extended partition with at least one Logical partition.

The partitions do not need to contain any data.

To convert:

  1. Open a terminal window.
  2. Run fdisk -l /dev/sda.
  3. Verify the DOS partition layout.
  4. Launch gdisk /dev/sda.
  5. Ensure there are no error messages.
  6. Select the w option (to write changes).
  7. Run fdisk -l /dev/sda.
  8. Confirm the layout shows GPT
  9. Verify there no longer is any Extended partition.

Notice the partition numbering skips because of removing the Extended partition.

  1. Launch gdisk /dev/sda.
  2. Select the s option (to sort partitions).
  3. Select the w option (to write changes).

The partitions will be renumbered sequentially.

Launch gparted. Notice there is unused space between the partitions. Move partitions as desired to recover the lost space.

With a production disk renumbering the partitions (sorting) might affect /etc/fstab when using block device nomenclature rather than UUIDs. Edit the table as necessary.

With a production disk be sure to update the boot loader.

Although I never had issues converting, as always backup any data before proceeding.

Posted: Category: Usability Tagged: General

Next: Recovering From GRUB Failures

Previous: Odd VirtualBox Audio Bug