1

I need to expand the / partition on a Linux CentOS 7.3 Hyper-V Gen 2 virtual machine. (secure boot is disabled)

From what I've read, the procedure is: 1) expand the vhdx using Hyper-V Manager, and 2) boot into GParted and extend the partition to use the free space.

The problem is I can't boot from the GParted ISO. I've moved the DVD drive to the top of the list in the Hyper-V Firmware Boot order, and the boot process starts... I select "Boot to RAM" from the GParted menu, then it hangs. The last message received in the console is:

   * copying /live/medium/live/filesystem.squashfs to RAM
   sending incremental file list
   filesystem.squashfs

Also tried 'Default' and 'Failsafe' modes from the GParted menu - stil hangs.

Can I edit the shim.efi file appearing in the Hyper-V Firmware Boot order?

Should I create a UEFI-bootable image of GParted on a USB Drive as described here?

  • did you successfully extend the vhdx? – Joe Platano Dec 18 '16 at 6:55
  • Yes, I've expanded the vhdx by 20GB. Of course CentOS can't see it. I might try another partition tool. But I think my own ignorance of Hyper-V's implementation of UEFI is the problem. – jott19 Dec 18 '16 at 7:39
  • check in the CentOS Terminal, if the size of your partition. Should be fdisk -l /dev/sda. Does this return the new (+20GB) or the old storage size? – Joe Platano Dec 18 '16 at 7:45
  • PS H:\VirtualMachines\CentOS> ls .\CentOS.vhdx | select @{Name='Size GB';Expression={$_.Length/1GB}} Size GB ------- 50.00390625 # df -h /dev/sda2 Filesystem Size Used Avail Use% Mounted on /dev/sda2 31G 26G 3.8G 88% / – jott19 Dec 18 '16 at 8:27
  • short answer: no, the OS can't see the space. it's an ext4 file system. I cant umount / so I don't know of any way to extend the partition without a partion tool like GParted. – jott19 Dec 18 '16 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.