Quite often, you have to expand virtual machine disks when the system drive runs out of free space. For example, you increased the disk size in the VMware or Hyper-V virtual machine settings, and now you need to extend the volume inside the guest operating system (Windows).
Extend Volume Option is Grayed Out in Windows Disk Management Console
Open Disk Management console (
diskmgmt.msc) and right-click on the partition you want to expand (in my example, it’s a logical volume assigned the drive letter C:\). As you can see, the Extend Volume option is grayed out. The fact is that you can extend a volume in Windows only if there is an Unallocated space to the right of it.
In my case, the recovery partition is between volume C: and unallocated space. You cannot expand the C: partition because it has a recovery (Windows RE) partition to its right. That’s why the “
Extend Volume” option is inactive (grayed out).
You won’t be able to extend a disk volume in Windows (Windows Server) if:
- To the right of the partition you want to expand is another partition;
- The partition is formatted with a file system that does not support the extending (FAT32, exFAT). Only NTFS/ReFS volumes can be extended;
- You cannot create partitions larger than 2 TB on disks with an MBR partition table. Use the GPT partition table for large drives (greater than 2 TB). You can convert MBR to GPT without data loss using the built-in Mbr2gpt.exe tool. You can check the current partition table type on the Volumes tab of the disk in Device Manager. In this example, my Windows 10 VM is installed in EFI mode with GPT partitions on a disk.
In this article, we will look at how to properly increase a partition (system drive C:) in Windows if the Extend Volume option is not available (greyed out) in the Disk Management console. You need to move or delete the recovery partition if it prevents (blocks) your volume from extending.
Cannot Extend Volume Due to Windows Recovery Partition
In the simplest case, you can just move the recovery environment files from the WinRE partition to the system drive C: and completely delete the 541MB recovery partition.
First, assign a drive letter to the recovery partition. Open a command prompt as an administrator and run:
List available local disks:
Choose your disk:
select disk 0
Display a list of partitions.
Select the recovery partition (in your case it may be a different partition number):
select partition 4
Assign it a drive letter R:
assign letter r:
Disable the Windows Recovery Environment (WinRE):
Now you have to remove the recovery partition with a size of 541 (in our example, this is Partition 4).
If you try to delete the Windows recovery partition from the Disk Management GUI by clicking Delete Volume (sometimes the disk properties are not available at all), the following error will appear:
Virtual Disk Manager Cannot delete a protected partition without the force protected parameter set.
You can delete such a protected partition only using the diskpart tool. Open the elevated command prompt and run the diskpart command. Select the partition you want to delete (note the results of your commands, since the numbers of disks and partitions may differ).
DISKPART> list disk
DISKPART> select disk 0
DISKPART> list part
DISKPART> select part 4
DISKPART> delete partition override
DiskPart successfully deleted the selected partition.
Please wait while DiskPart scans your configuration... DiskPart has finished scanning your configuration.
Enable WinRE and update the ReAgent.xml configuration file with the command:
Run the following command to verify that the recovery environment WIM file has been recreated on drive C:
bcdedit /enum all | find "osdevice"
Check your current WinRE configuration:
Windows Recovery Environment (Windows RE) and system reset configuration Information: Windows RE status: Enabled Windows RE location: \\?\GLOBALROOT\device\harddisk0\partition3\Recovery\WindowsRE Boot Configuration Data (BCD) identifier: e668f79d-60da-11ed-b27a-ea3359f08732 Recovery image location: Recovery image index: 0 Custom image location: Custom image index: 0 REAGENTC.EXE: Operation Successful.
winre.wimrecovery environment file is now located on the system partition where Windows is installed.
Now you can extend your system partition (drive C:):
- Open the
- Right-click on the partition you want to increase and select Extend Volume;
- Specify the amount of space in MB you want to increase your partition. In my case, I will extend the C: drive by 5 GB. Click Next -> Finish;
- The system partition has been extended successfully.
Windows detects the recovery partition by the special labels: GUID —
de94bba4-06d1-4d40-a16a-bfd50179d6ac and the GPT attribute
Move Windows Recovery Partition to the End of Disk with GParted LiveCD
If you are afraid of removing existing partitions on disks, you can move the partition that prevents it from expanding to the end of the disk using a third-party tool. You can use the free GParted (GNOME Partition Editor) boot image to manage partitions offline. This is a Live CD based on Linux Debian with a graphical frontend for the parted tool (a console-based utility for managing disk partitions in Linux). Download the ISO image gparted-live-1.4.0-6-amd64.iso here https://gparted.org/download.php (about 490 MB).
Boot your virtual machine from the gparted-live ISO image (if you want to expand the partition on a physical computer, you can burn the ISO image to a USB flash drive using the Rufus utility).
- Don’t touch keymap
- Default English language (33)
- Mode 0 – Continue to start X to use GParted automatically
The graphical partition editor GParted will start automatically.
Find the partition you want to move to the right. Note that GParted uses the Linux partition naming. The easiest way to find your Windows recovery partition is by its size. In our case, this is the /dev/vvme0n1p4 partition with a size of 541 MB. Right-click on a partition and select Resize/Move.
Specify a value of 0 in the Free space following (MiB) field to move the partition to the end of the disk.
Click the Resize/Move button. In order to start moving partitions, click Edit -> Apply all operations in the top menu. In my case, a small 500 MB partition was moved in a few seconds.
Reboot the VM and start Windows. Open the Disk Management console. As you can see, the recovery partition has been moved to the end of the disk. The unallocated area is now to the right of the volume with the drive letter C:\.
The Extend Volume option is now available and you can extend the system partition on your drive. The Windows recovery environment will not be affected.