How do i do this? (hyper-v) (SOLVED)

so i have my Windows 10 Pro VM running in Hyper-V and i wanted to extend the disk so I did that but now the VM wont extend it as its greyed out is there a fix?

This is expected, as you probably know already, you can’t extend without the unallocated space being next to the partition you want to extend.

Using only Windows, you need to delete the recovery partition, then extend (but not fully) the main partition, then rebuild the recovery partition. All that can be problematic and even longer than this, so you can look that up yourself if interested.

Thankfully there is an easy alternative to moving the partitions using GParted. One way to use that is to download a Ubuntu ISO, shut the VM down, go to the Settings of the VM, go to Security and turn off “Enable Secure Boot” (you can turn it back on later), and then mount the ISO image to the DVD drive.

Boot the VM, Windows will probably boot up again, at the login screen, hold down shift while clicking the power icon in the corner, and then Restart. Alternatively, log in and run shutdown /r /o /t 0. Once WinRE loads, choose Use a device, and then EFI SCSI Device (or whatever the DVD is).

Ubuntu should then load up, choose “Try or Install Ubuntu”, then the “Try Ubuntu” button once that appears. Then when you’re at a desktop, either press the Windows key, press Activities at the top, or the Show Applications button at the bottom of the dock, then search for GParted, and run the GParted application.

If asked to fix the partitions, choose the Fix button. Then find the recovery partition (probably /dev/sda4), right-click it in the list, and choose ‘Resize/Move’. In the resize window that comes up, drag the partition from the left to the right.
So from here:

To here:

Choose the Resize/Move button, then choose OK to the warning that appears. You should see an operation pending similar to Move /dev/sda4 to the right and shrink it from 530.00 MiB to 529.00 MiB. Next, choose the green checkmark Apply button in the toolbar, when the warning comes up, confirm by choosing the Apply button in the dialog.

Assuming that was all successful, choose the Close button, then go to the power button at the top right corner, choose Power Off/Log Out, choose the Restart… option, and then the Restart button. Press the Enter key when prompted.

Once you’re back in Windows you should then be able to re-run diskmgmt.msc and extend the partition.

1 Like

it does look a little confulzzing but ill try thanks trekister!