Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / Fix: Can’t Extend Volume in Windows

August 10, 2023 Windows 10Windows 11Windows Server 2019

Fix: Can’t Extend Volume in Windows

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

Contents:
  • Extend Volume Option is Grayed Out in Windows Disk Management Console
  • Cannot Extend Volume Due to Windows Recovery Partition
  • Move Windows Recovery Partition to the End of Disk with GParted LiveCD

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

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.

Here you can find a detailed guide about the WinRE environment in Windows.

First, assign a drive letter to the recovery partition. Open a command prompt as an administrator and run:

diskpart

List available local disks:

list disk

Choose your disk:

select disk 0

Display a list of partitions.

list part

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:
exit

diskpart assign drive letter recovery partition

Disable the Windows Recovery Environment (WinRE):

reagentc /disable

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

Virtual Disk Manager
Cannot delete a protected partition without the force protected parameter set.

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> rescan
DISKPART> list disk
DISKPART> select disk 0
DISKPART> list part
DISKPART> select part 4
DISKPART> 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).

DISKPART> Rescan

Please wait while DiskPart scans your configuration...
DiskPart has finished scanning your configuration.

DISKPART> exit

diskpart delete recovery partition override

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

reagentc /enable

reagentc /enable

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

bcdedit /enum all | find "osdevice"

ramdisk=[C:]\Recovery\WindowsRE\Winre.wim,{e668f79e-60da-11ed-b27a-ea3359f08732}

bcdedit check recovery wim image

Check your current WinRE configuration:

reagentc.exe /info

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.

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
If there are any other vendor recovery partitions on the disk that prevent you from extending the volume, check the article “How to Remove an OEM Partition in Windows?”.

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

If are having issues with the EFI bootloader or the EFI partition, follow the links to read the related articles.

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

Gparted LiveCD

Select consecutively:

  1. Don’t touch keymap
  2. Default English language (33)
  3. Mode 0 – Continue to start X to use GParted automatically

Start GParted GUI

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.

move recovery partition in windows

Specify a value of 0 in the Free space following (MiB) field to move the partition to the end of the disk.

Move Partition to End of Disk on Windows

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.

move partitions in windows

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:\.

extend system volume using disk management console

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.

10 comments
11
Facebook Twitter Google + Pinterest
previous post
Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11
next post
Allow or Prevent Non-Admin Users from Reboot/Shutdown Windows

Related Reading

How to Connect VPN Before Windows Logon

November 14, 2023

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

10 comments

murrayzz1 January 22, 2021 - 12:54 pm

Thanks! Just what I was looking for, worked perfectly first time.

Reply
Apostolos55 March 6, 2021 - 10:29 am

Thanks! it worked Great!
I just needed to recreate my .wim file, so had some help from “https://community.spiceworks.com/how_to/163540-convert-esd-to-wim”.
But really big big thanks!!!

Reply
Ender June 15, 2021 - 12:42 pm

This line gives error on my computer:
robocopy e:\boot c:\boot /s
since the system could not find the \boot\ file in the recovery partition
The Partition style is not GPT in my computer, so I followed instructions in part “How to Delete the Recovery Partition and Move the BCD on BIOS-based PC”
When I made the RE partition unhidden and assigned it a name, I could see directories and files as follows:
F:
– Recovery
– WindowsRE
boot.sdi
ReAgent.xml
Winre.wim
Could you please advise how to move BCD and relevant files to C: drive properly.

Reply
Unable to expand disk due to Windows Recovery partition October 5, 2021 - 8:03 am

[…] If it was an 'original' drive it may well have the original image in the recovery partition with specific drivers and software provided by the manufacturer, or it could just be the Win RE partition. It horses for courses I'm afraid, it seems a little less common these days, but sometimes it can do more harm than good – especially when an elderly relative or less IT literate family member chooses 'restore my computer' or something from a troubleshooting menu and wipes all their data and photos… If he has the original drive and has mastered the cloning process (depending on the software he used), he may be able to do the clone again and choose which partitions to clone on to the new drive? This has some good info: Extend Volume Blocked by a Recovery Partition on Windows 10 | Windows OS Hub […]

Reply
Razor November 3, 2022 - 11:38 am

Thanks this CLI commands helped to remove the recovery partition.

Reply
HU January 13, 2023 - 9:17 pm

Hello, this worked for my w2022 server.
Thanks

Reply
Adrian January 14, 2023 - 11:17 pm

What should be the assignment of the drive letter R: be good for? It is used nowhere and the partition assigned to that drive letter is deleted anyway.

Reply
Dani January 27, 2023 - 5:04 pm

Thank you so much!

Reply
Manually create Windows recovery partition before OS partition – IT Blog – Philip Loftin April 1, 2023 - 7:33 pm

[…] Fix: Can’t Extend Volume in Windows | Windows OS Hub (woshub.com) […]

Reply
HU November 8, 2023 - 1:07 am

The gparted section worked for me.
Thanks.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Allow Multiple RDP Sessions on Windows 10 and 11
  • How to Repair EFI/GPT Bootloader on Windows 10 or 11
  • How to Restore Deleted EFI System Partition in Windows
  • Network Computers are not Showing Up in Windows 10/11
  • How to Run Program without Admin Privileges and Bypass UAC Prompt
  • Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top