- Install subsystem for Linux 2 (WSL2) on Windows Server - Wed, Jun 22 2022
- Next version of Exchange to arrive in 2025; meanwhile, new features for Exchange 2019 - Fri, Jun 10 2022
- Activate Remote Desktop in Windows 11 and Windows Server 2022 (GUI, WAC, WMI, and GPO) - Wed, Jun 8 2022
In Hyper-V Manager, you can enlarge a VHD(X) with the Virtual Hard Disk Wizard. In VMware Workstation, the corresponding option can be found in the settings of a VM by selecting the respective drive. The disk utilities then appear in the right section, including the one labeled Expand.
Disk layout prevents expansion of OS partition ^
If you restart the guest OS after successfully expanding the drive and open Disk Management inside the guest to expand the Windows partition to the new space, you will see that the recovery partition blocks this attempt.
In the standard disk layout, it is to the right of the OS partition, and the unallocated space comes after it at the end of the drive. So, you have to move the recovery partition all the way to the right before you can enlarge C:.
Limited functionality of onboard tools ^
Disk management can enlarge and shrink partitions but not move them. Therefore, you need a separate tool for this.
The procedure suggested by Microsoft for this purpose uses DISM. First, you capture the recovery environment using this tool, then the partition is deleted with diskpart.exe, and finally, you recreate the partition and restore its contents with DISM. This procedure is cumbersome, time-consuming, and error prone.
Deploy GPartedG ^
It is much easier to use the GNOME Partition Editor (GParted). You do not need any of the major Linux distributions for it; rather, you can just download a slim live CD.
You attach the ISO to the virtual machine and boot it from the virtual DVD drive. If you want to move the partition on a physical machine, you first have to write the ISO to a USB stick with Rufus and boot the PC from it.
On the startup screen, confirm the preselected (and barely readable) GParted Live (Default settings).
In the next step, confirm the already marked entry ("Don't touch keymap"), and, if necessary, select a language other than the default English.
For the mode option, leave it at (0), so that the graphical interface is started and GParted appears automatically. The tool then automatically loads the partition table.
Now, it is a matter of identifying the recovery partition in the list since GParted uses different names than Windows. The easiest way to find the partition is to note the size of the partition in disk management. It is usually about 500 MB.
Then open the context menu of the respective partition and execute the command Resize/Move. In the dialog that appears, enter the value 0 in the Connecting free space field. The tool then automatically allocates the available space to the area in front of the partition.
After confirming the dialog with the Resize/Move button, nothing will happen. Instead, you first have to apply the changes using the Edit menu. Since the partition is quite small, moving it should happen quite quickly.
Finally, reboot the VM, and start Windows. In disk management, you can see that the recovery partition has moved to the far right.
Subscribe to 4sysops newsletter!
Therefore, you can now expand the system volume so that it also gets the previously unallocated space.