[SOLVED] Convert VM disk from MBR to GPT (to expand it beyond 2 TB)

lucaferr

Renowned Member
Jun 21, 2011
71
9
73
Hi, I have a growing Linux Debian 9 VM that I need to expand to 3 TB. I've expanded it from Proxmox interface and it correctly reports 3 TB size. But I'm unable to grow the partition over 2 TB because the virtual disk has a MBR. The VM is mission critical so I must carefully plan the operation: I guess that the steps are
  1. Make a backup to Proxmox Backup Server (of course)
  2. Log into the VM and convert MBR to GPT: gdisk /dev/sda adding a 1 MB partition (n) with type "BIOS boot" (EF02) from sectors 34-2047 (current /dev/sda1 begins at 2048) and finally writing the new partition table to disk (w)
  3. Reload the partition table: partprobe /dev/sda
  4. Rewrite the boot loader: grub-install /dev/sda
  5. Reboot the VM and pray
Can you please confirm that the steps are correct and I'm not missing anything? I've decided not to switch to EFI (which would require a change in the "BIOS" option configured from Proxmox and an additional partition) to avoid making too many changes all at once and as I don't think it would have any advantage.
Thank you so much!
 
I answer myself: the procedure worked perfectly. However, you must take into account that, once the disk of the VM is GTP, you can no longer expand it with growpart: you have to do it like this