Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • 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 2012
    • 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 / Extend Volume Blocked by a Recovery Partition on Windows 10

February 14, 2020 Windows 10Windows Server 2016

Extend Volume Blocked by a Recovery Partition on Windows 10

Once I saw that one of the test virtual machines was running out of free space on system drive C:. I increased the disk size in the virtual machine settings and switched to the guest OS (Windows 10) to extend the size of the system partition using the unallocated space. When I opened the Disk Management console (diskmgmt.msc), I noticed that there were two recovery partitions on the drive. And the unallocated space was appeared after the second recovery partition (labeled as Windows RE). On some reason the recovery partition is located after the main partition (C:) and does not allow to expand the primary volume by using the unallocated space.

In this article we will consider two different ways to delete and recreate the recovery partition for EFI and BIOS computers. So, prior to proceeding the steps described below, find out what architecture is used on your computer. Also it is strongly recommended to backup (or make a snapshot ) your critical data before trying to make changes to the partition table.

Contents:
  • How to Move Recovery and Extend System Partition on UEFI-based Computer?
  • How to Delete the Recovery Partition and Move the BCD on BIOS-based PC?

How to Move Recovery and Extend System Partition on UEFI-based Computer?

On my virtual machine, Windows 10 is installed in UEFI mode (Partition style: GPT).

check the partition table (GPT or MBR)

As you can see on the screenshot below, the “Extend Volume” button is inactive (gray). You can extend the partition using the Windows built-in tools if it has an unallocated space to the right of it (Windows 10 cannot extend primary partition to the right into unallocated space). In my case, I cannot extend the C: drive because it is blocked by the recovery partition (Windows RE). So, prior to extending the size of the system partition, I will have to delete the recovery partition.

Extend Volume option is grayed out on WIndows 10

On the screenshot, you can see that there are two recovery partitions (Recovery and Windows RE). To understand, which of them is used by Windows as an active recovery partition, you must assign the drive letters to your partitions. For example, you can assign a drive letters E: and R: using the the Disk Management or Diskpart.exe: select disk 0 -> select part 1 -> assign letter r: . To check the active recovery partition, run the command:

bcdedit /enum all

Please pay attention to the following sections:

  1. Windows Boot Manager (it indicates the partition where the BCD bootloader is located). In my case, the bootloader is on the EFI partition:
    Windows Boot Manager
    --------------------
    identifier {bootmgr}
    device partition=\Device\HarddiskVolume2
    path \EFI\Microsoft\Boot\bootmgfw.efi
    description Windows Boot Manager
    locale en-US
    inherit {globalsettings}
    default {current}
    resumeobject {dbaf5561-4424-11e9-b766-b7001b047795}
    displayorder {current}
    toolsdisplayorder {memdiag}
    timeout 30

    check Windows Boot Manager configuration

  2. Now look at the values in the Windows Boot Loader section. The Winre.wim image file (recovery environment) is located on the second partition with the Windows RE volume label.
    Windows Boot Loader
    -------------------
    identifier {dbaf5563-4424-11e9-b766-b7001b047795}
    device ramdisk=[E:]\Recovery\WindowsRE\Winre.wim,{dbaf5564-4424-11e9-b766-b7001b047795}
    path \windows\system32\winload.efi
    description Windows RE
    locale en-us
    inherit {bootloadersettings}
    displaymessage Windows RE
    osdevice ramdisk=[E:]\Recovery\WindowsRE\Winre.wim,{dbaf5564-4424-11e9-b766-b7001b047795}
    systemroot \windows
    nx OptIn
    bootmenupolicy Standard
    winpe Yes

To expand the size of the main Windows volume, we will have to delete the recovery partition to the right of it, extend the volume and recreate the recovery partition.

Instead of re-creating the recovery partition, in most cases it will be enough to move the recovery environment files to the drive C:. Then you will be able to completely refuse from using a separate 500MB WinRE partition. The recovery environment file will then be stored on the partition where Windows is installed.

To copy the Winre.wim file to the system volume and set new the WinRE.wim file location, run these commands:

reagentc /disable
md c:\Recovery\WinRE
xcopy e:\Recovery\WindowsRE\Winre.wim c:\Recovery\WinRE /h
reagentc /setreimage /path c:\Recovery\WinRE /target C:\Windows
reagentc /enable

If you try to delete the 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 vary).

DISKPART> rescan
DISKPART> list disk
DISKPART> select disk 0
DISKPART> list part
DISKPART> select part 5
DISKPART> delete partition override

DiskPart successfully deleted the selected partition.

DISKPART> Rescan

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

DISKPART> delete partition override

Now you can open the Disk Management and extend the system partition (the Extend Volume option is now available). If you want to recreate the recovery partition (it is recommended to save it or move it to the system partition as described above), leave 500MB of unallocated space on your drive. In the screenshot below, I am extending my Windows partition by 1.5GB and leaving 500MB at the end of the drive.

If there are any other vendor recovery partitions on the disk that prevent you from extending the main volume, check the article “How to Delete an OEM Partition?”.

Extend Windows 10 system partition with Disk Management

After extending the main partition, I have 500MB free space left for WinRE recovery partition.

unallocated space is to the right of primary windows 10 partition

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

Let’s create a new partition and assign these attributes to it:

DISKPART> create part primary
DISKPART> format quick fs=ntfs label="WinRE"
DISKPART> assign letter="R"
DISKPART> set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"

DiskPart successfully set the partition ID

DISKPART> gpt attributes=0x8000000000000001

DiskPart successfully assigned the attributes to the selected GPT partition.

Exit

diskpart assigning recovery partition attributes

Then copy WinRE files from the Windows 10 installation disk (image) to your new recovery partition.

Mount the install.wim file from your Windows 10 install ISO image and extract the WinRE file (Winre.wim) from it:

md C:\WinISO
md C:\WinISO\mount
dism /mount-wim /wimfile:F:\sources\install.wim /index:1 /mountdir:C:\WinISO\mount /readonly
md R:\Recovery\WinRE
copy C:\WinISO\mount\Windows\System32\Recovery\Winre.wim R:\Recovery\WinRE\
dism /unmount-wim /mountdir:C:\WinISO\mount /discard

Then just move the WinRE file to the recovery partition and update the bootloader configuration:

reagentc /disable
reagentc /setreimage /path R:\Recovery\WinRE /target C:\Windows
reagentc /enable

Here you can find the full article about WinRE environment in Windows.

copy Winre.wim file and enable WInRE

So, we have recreated the recovery partition and registered a new path to the WinRE image. If you have any Windows boot problems, your recovery environment will boot automatically.

If you have any issues with your EFI bootloader or the EFI partition, follow the links to read the related articles.

How to Delete the Recovery Partition and Move the BCD on BIOS-based PC?

If your computer is based on BIOS (not UEFI), you can move the Windows boot manager (BCD) and the recovery environment files to the C: volume prior to deleting the recovery partition as follows.

First of all, you have to move BCD files from drive E: to drive C: (I have assigned this drive letter to my recovery partition):

Reg unload HKLM\BCD00000000
robocopy e:\ c:\ bootmgr
robocopy e:\boot c:\boot /s
bcdedit /store c:\boot\bcd /set {bootmgr} device partition=C:
bcdedit /store c:\boot\bcd /set {memdiag} device partition=C:

In case of any BCD problems, you can rebuild the BCD file and Master Boot Record (MBR) as described in this instruction.

Then move the recovery wim image:

reagentc /disable
md c:\Recovery\WinRE
xcopy e:\Recovery\WindowsRE\Winre.wim c:\Recovery\WinRE /h
reagentc /setreimage /path c:\Recovery\WinRE /target C:\Windows
reagentc /enable

Now you can remove the recovery partition using diskpart (as shown above) and extend your system partition successfully.

4 comments
7
Facebook Twitter Google + Pinterest
previous post
How to Install and Use the PowerShell Active Directory Module?
next post
How to Block a Domain or Website on Windows Defender Firewall with PowerShell?

Related Reading

How to Deploy Windows 10 (11) with PXE...

June 27, 2022

Checking Windows Activation Status on Active Directory Computers

June 27, 2022

Configuring Multiple VLAN Interfaces on Windows

June 24, 2022

How to Disable or Enable USB Drives in...

June 24, 2022

Adding Domain Users to the Local Administrators Group...

June 23, 2022

4 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

Leave a Comment Cancel Reply

Categories

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

Recent Posts

  • How to Deploy Windows 10 (11) with PXE Network Boot?

    June 27, 2022
  • Checking Windows Activation Status on Active Directory Computers

    June 27, 2022
  • Configuring Multiple VLAN Interfaces on Windows

    June 24, 2022
  • How to Disable or Enable USB Drives in Windows using Group Policy?

    June 24, 2022
  • Adding Domain Users to the Local Administrators Group in Windows

    June 23, 2022
  • Viewing a Remote User’s Desktop Session with Shadow Mode in Windows

    June 23, 2022
  • How to Create a Wi-Fi Hotspot on your Windows PC?

    June 23, 2022
  • Configuring SSH Public Key Authentication on Windows

    June 15, 2022
  • How to Run a Program as a Different User (RunAs) in Windows?

    June 15, 2022
  • FAQ: Licensing Microsoft Exchange Server 2019/2016

    June 14, 2022

Follow us

woshub.com

ad

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Allow Multiple RDP Sessions in Windows 10 and 11?
  • How to Restore Deleted EFI System Partition in Windows 10?
  • How to Run Program without Admin Privileges and to Bypass UAC Prompt?
  • Error Code: 0x80070035 “The Network Path was not found” after Windows 10 Update
  • How to Disable UAC Prompt for Specific Applications in Windows 10?
  • How to Download APPX File from Microsoft Store for Offline Installation?
  • Fix: Windows Cannot Connect to the Shared Printer
Footer Logo

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


Back To Top