Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

 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.

1 comment
6
Facebook Twitter Google + Pinterest
previous post
Network Computers are not Showing Up in Windows 10
next post
How to Block a Domain or Website on Windows Defender Firewall with PowerShell?

Related Reading

Preparing Windows for Adobe Flash End of Life...

January 22, 2021

How to Disable/Remove Thumbs.db File on Network Folders...

January 21, 2021

USB Device Passthrough (Redirect) to Hyper-V Virtual Machine

January 15, 2021

Windows 10: No Internet Connection After Connecting to...

January 13, 2021

Updating the PowerShell Version on Windows

December 24, 2020

1 comment

murrayzz1 January 22, 2021 - 12:54 pm

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

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • Preparing Windows for Adobe Flash End of Life on December 31, 2020

    January 22, 2021
  • Checking User Logon History in Active Directory Domain with PowerShell

    January 22, 2021
  • How to Disable/Remove Thumbs.db File on Network Folders in Windows?

    January 21, 2021
  • MS SQL Server 2019 Installation Guide: Basic Settings and Recommendations

    January 19, 2021
  • USB Device Passthrough (Redirect) to Hyper-V Virtual Machine

    January 15, 2021
  • Windows 10: No Internet Connection After Connecting to VPN Server

    January 13, 2021
  • Updating the PowerShell Version on Windows

    December 24, 2020
  • How to Enable and Configure User Disk Quotas in Windows?

    December 23, 2020
  • Restoring Deleted Active Directory Objects/Users

    December 21, 2020
  • Fix: Search Feature in Outlook is Not Working

    December 18, 2020

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Allow Multiple RDP Sessions in Windows 10?
  • How to Repair EFI/GPT Bootloader on Windows 10?
  • How to Restore Deleted EFI System Partition in Windows 10?
  • Network Computers are not Showing Up in Windows 10
  • How to Run Program without Admin Privileges and to Bypass UAC Prompt?
  • How to Configure Google Chrome Using Group Policy ADMX Templates?
  • Error Code: 0x80070035 “The Network Path was not found” after Windows 10 Update
Footer Logo

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


Back To Top