How to create or rebuild the recovery partition in Windows 11 and 10

Quick answer: The recovery partition holds the Windows Recovery Environment (WinRE). To create or rebuild it, run reagentc /disable, use diskpart to shrink the Windows partition and create a new partition right after it with the recovery type ID, format it with the label Windows RE tools, then run reagentc /enable. Microsoft’s KB5028997 gives the exact commands for growing it by 250 MB. Back up first: one wrong partition number can wipe data.

What the recovery partition is for

On a normal Windows 11 or 10 install, the recovery partition is a small hidden partition that stores Winre.wim, the image behind WinRE: Startup Repair, System Restore, Reset this PC and the recovery Command Prompt. It isn’t a factory image of your PC, and it isn’t the same as a USB recovery drive, which Microsoft’s Recovery Drive tool creates on a separate stick.

You’d rebuild it when it’s missing, when it’s too small for a WinRE update (Microsoft’s KB5028997 links that to System event 4502, “Windows Recovery Environment servicing failed”), or when reagentc /enable isn’t working because the partition is damaged. Microsoft’s partition guidance sizes it as the size of Winre.wim plus at least 250 MB of free space, recommends 990 MB minimum when you script the layout yourself, and says it must sit immediately after the Windows partition so Windows can resize or recreate it later.

Before you start

  • Back up your files. These steps delete and create partitions.
  • If BitLocker or device encryption is on, have your recovery key to hand. Suspending protection before changing partitions is a sensible precaution.
  • Open Command Prompt as administrator for every command below.
  • Read each diskpart line twice before pressing Enter. The numbers in our examples are only examples.

Step 1: Check WinRE and your disk layout

reagentc /info

Note the Windows RE location line. It looks like \\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE: here WinRE is on disk 0, partition 4. If the status is Disabled and the location is blank, WinRE isn’t currently on a partition. Now open diskpart and look at the layout:

diskpart
list disk
sel disk 0
list part

In list disk, an asterisk in the Gpt column means the disk uses GPT; no asterisk means MBR. In list part, find your Windows partition (the large Primary one) and the recovery partition, usually a few hundred MB with the type Recovery. Check that the recovery partition comes right after Windows. Type exit to leave diskpart for now.

Step 2: Rebuild the partition (too small or damaged)

This follows Microsoft’s KB5028997 sequence, which takes 250 MB from the Windows partition and recreates the recovery partition with that extra room. It only works when the recovery partition is directly after the Windows partition. First turn WinRE off:

reagentc /disable

Then, in diskpart, replace the disk and partition numbers with the ones you noted:

diskpart
sel disk 0
list part
sel part 3
shrink desired=250 minimum=250
sel part 4
delete partition override

Here partition 3 is Windows and partition 4 is the old recovery partition. Next, create the new one. On a GPT disk:

create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
gpt attributes=0x8000000000000001
format quick fs=ntfs label="Windows RE tools"

On an MBR disk:

create partition primary id=27
format quick fs=ntfs label="Windows RE tools"
set id=27

The GPT ID is the recovery partition type Microsoft documents, and the attribute value hides the partition from File Explorer and marks it as required by the platform. Run list vol to confirm the new volume, then exit, and turn WinRE back on:

reagentc /enable
reagentc /info

Microsoft notes that if creating the partition fails, or you change your mind, running reagentc /enable re-enables WinRE where it was.

If there’s no recovery partition at all

KB5028997 doesn’t cover this case, but the same building blocks apply. Run reagentc /disable, select the Windows partition in diskpart, shrink it by about 1 GB (shrink desired=1024 minimum=1024) so there’s free space directly after it, then run the GPT or MBR create, format and ID commands from Step 2 and reagentc /enable. If an old recovery partition sits before the Windows partition, this method can’t grow it; leave it in place and create the new one after Windows. Check with reagentc /info afterwards that WinRE now points at the new partition before you consider removing the old one. If a separate System Reserved partition is the problem instead, see we couldn’t update the system reserved partition.

If Winre.wim is missing

If reagentc /enable says the Windows RE image wasn’t found, the file needs to be put back first. When WinRE is disabled it usually sits, hidden, at C:\Windows\System32\Recovery\Winre.wim. Microsoft explains that Winre.wim is included inside the Windows image, so you can take it from Windows installation media that matches your version and language:

md C:\mount\windows
Dism /Mount-Image /ImageFile:D:\sources\install.wim /Index:1 /MountDir:C:\mount\windows /ReadOnly
copy C:\mount\windows\Windows\System32\Recovery\Winre.wim C:\Windows\System32\Recovery\
Dism /Unmount-Image /MountDir:C:\mount\windows /Discard

Replace D: with the mounted ISO’s drive letter, and use Dism /Get-WimInfo /WimFile:D:\sources\install.wim to find the index of your edition. If your media has install.esd instead, our guide to install.esd explains how to work with it. Then point WinRE at the folder (not the file) and enable it:

reagentc /setreimage /path C:\Windows\System32\Recovery
reagentc /enable

Step 3: Check that it works

Run reagentc /info again. The status should read Enabled and the location should point at your new partition. To test it, go to Settings > System > Recovery and select Restart now next to Advanced startup (on Windows 10, Settings > Update & Security > Recovery). The PC should restart into the blue Choose an option screen; select Continue to return to Windows. The new partition shouldn’t appear in File Explorer.

It’s still worth making a USB recovery drive too. Search for Recovery Drive in Start; Microsoft warns that it erases the USB stick and suggests recreating it every year.

Official sources

How we write our guides: read our editorial policy.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *