How to migrate a Debian DOS partitioned VM to GUID for partitions > 2 TB

we have a outdated Debian 10 VM with DOS partition and 2 * 2 TB Partitions.

How is the elegantest way to migrate to Partition schema GUID so that we have one 4 TB Partition and optionally make it bigger

Booting live distro and backup? This would need to include a Synology we have in fstab. Reinstall and restore? or Create a new drive/container, mount it, boot gparted and copy file-systems?

Exanding a partition with VMWare is a well known process for us -> gparted


GPT on the system disk typically goes with UEFI, but I don't know anything about VMware's UEFI capabilities, so I will assume for now that the VM will remain set to the BIOS/legacy boot method. (Windows wouldn't like it, but Linux can boot in this configuration without problems).

  1. Use gdisk to transform the current partition table to GPT.

  2. Shrink a partition to make some free space (just 2 MB) for a new "BIOS Boot Partition" that is used by GRUB. As this will be accessed via BIOS calls, it should ideally be near the beginning of the disk.

  3. Create that new "BIOS Boot Partition".

    • If using GParted, do not select any filesystem (just an empty partition), but set the bios_grub flag on the partition.
    • If using gdisk, select ef02 as the partition type.
  4. Re-run grub-install and update-grub.

If however you decide to convert the VM to UEFI at the same time, the process is slightly different:

  • In steps 2 and 3, you will need a much larger "EFI System Partition" (at least 100 MB), which has the GParted flag esp or the gdisk type ef00. It must be formatted using FAT32 and mounted at /boot/efi (Debian prefers it there).

  • Before doing step 4 you will need to install the "grub-efi-amd64" package, and perhaps clean out the old BIOS-specific "i386-pc" files from /boot/grub.