Resize system volume partition on Winows Server 2022
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:
1)To the right of the partition you want to expand is another partition;
2)The partition is formatted with a file system that does not support the extending (FAT32, exFAT). Only NTFS/ReFS volumes can be extended;
3)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.
It is strongly recommended to backup (or make a snapshot) of your drive before making changes to the partition table.
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:
1 |
diskpart |
List available local disks:
1 |
list disk |
Choose your disk:
1 |
select disk 0 |
Display a list of partitions.
1 |
list part |
Select the recovery partition (in your case it may be a different partition number):
1 |
select partition 4 |
Assign it a drive letter R:
1 2 |
assign letter r: exit |
Disable the Windows Recovery Environment (WinRE):
1 |
reagentc /disable |
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:
1 2 |
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).
1 2 3 4 5 6 7 8 9 |
DISKPART rescan list disk select disk 0 list part select part 4 delete partition override DiskPart successfully deleted the selected partition. |
The override parameter allows diskpart to delete any partition regardless of its type (whether it is an active, system, or boot partition).
1 2 3 4 5 6 7 |
DISKPART Rescan Please wait while DiskPart scans your configuration... DiskPart has finished scanning your configuration. exit |
Enable WinRE and update the ReAgent.xml configuration file with the command:
1 |
reagentc /enable |
Run the following command to verify that the recovery environment WIM file has been recreated on drive C:
1 2 3 |
bcdedit /enum all | find "osdevice" or if error bcdedit /enum all |
1 |
ramdisk=[C:]\Recovery\WindowsRE\Winre.wim,{e668f79e-60da-11ed-b27a-ea3359f08732} |
Check your current WinRE configuration:
1 |
reagentc.exe /info |
1 2 3 4 5 6 7 8 9 10 |
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. |
In this example, we are completely deleting a separate 540 MB partition for WinRE. The winre.wim recovery environment file is now located on the system partition where Windows is installed.
Now you can extend your system partition (drive C:):
1)Open the diskmgmt.msc console;
2)Right-click on the partition you want to increase and select Extend Volume;
3)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;
4)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 0x8000000000000001.