Заметки сисадмина » Resize system volume partition on Winows Server 2022

Заметки сисадмина о интересных вещах из мира IT, инструкции и рецензии. Настраиваем Компьютеры/Сервера/1С/SIP-телефонию в Москве

Resize system volume partition on Winows Server 2022

2023-01-25 · Posted in Windows 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).

Extend Volume Greyed Out How to increase C drive space

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.

check the partition table (GPT or MBR)

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:

List available local disks:

Choose your disk:

Display a list of partitions.

Select the recovery partition (in your case it may be a different partition number):

Assign it a drive letter R:

diskpart assign drive letter recovery partition

Disable the Windows Recovery Environment (WinRE):

reagentc /disable 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:

Delete recovery partition on windows 10

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).

The override parameter allows diskpart to delete any partition regardless of its type (whether it is an active, system, or boot partition).

diskpart delete recovery partition override

Enable WinRE and update the ReAgent.xml configuration file with the command:

reagentc /enable

Run the following command to verify that the recovery environment WIM file has been recreated on drive C:

bcdedit check recovery wim image

Check your current WinRE configuration:

reagentc.exe /info - check Windows Recovery Environment health

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;

extend drive C in windows

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;

Extend Volume to Unallocated Space in Windows

4)The system partition has been extended successfully.

 Increase C Drive Space in Windows

Windows detects the recovery partition by the special labels: GUID — de94bba4-06d1-4d40-a16a-bfd50179d6ac and the GPT attribute 0x8000000000000001.

Leave a Reply