I wanted to put this somewhere if others needed it, they could get to it easier. I had a Windows VDI that I deleted the recovery partition to increase the hard drive space. With the update earlier this year failing, I was wanting to fix it, and not just skip it.
Recreate Recovery Partition in Windows 10/11
Overview
This guide details the steps to create a Recovery Partition in Microsoft Windows 10/11.
Sources
(https://www.youtube.com/watch?v=hlNtLcFqfOo&t=261s)
Steps to Recreate WinRE Files on a New Recovery Partition
1. Shrink Volume in Disk Management
- Press the Windows key and search for “Disk Management”.
- Right-click on C: (or the boot and primary partition).
- Select Shrink Volume…
- In “Enter the amount of space to shrink in MB”, input 1024.
- Click Shrink.
2. Create New Simple Volume
- Right-click on the new volume.
- Select New Simple Volume.
- Click Next.
- Click Next.
- Select Do not assign a drive letter or drive path.
- Click Next.
- Format this volume with the following settings:
- Volume label: System Reserved.
- Click Next.
- Click Finish.
3. Locate or Restore Winre.wim
- Open File Explorer and navigate to C:\Windows\System32\Recovery.
- If Winre.wim is not visible:
- Open Command Prompt in administrator mode.
- Run reagentc /info. If enabled, run reagentc /disable.
- If still not visible, go to the next step.
- In File Explorer, at the top, right-click on View, check Hidden items.
- Click on Options, then the View tab, and uncheck Hide protected operating system files (Recommended).
- If Winre.wim is still missing:
- Obtain a new copy of WinRE.wim.
- For a USB Windows image:
- Go to Sources and right-click on install.esd.
- Use 7-zip to Open Archive.
- Navigate to folder 1, then Windows\System32\Recovery.
- Copy the files to C:\Recovery\WindowsRE.
- For a Windows ISO:
- Extract the files and follow the same steps as for the USB.
4. Configure the New System Reserved Partition
- Determine the Partition Style:
- Go back to Disk Management.
- Right-click on disk 0 (or the disk with the OS).
- Select Properties, then Volumes.
- Note the Partition Style (GPT or MBR).
- Open Command Prompt in administrator mode and enter the following commands:
- diskpart
- list dis
- sel dis 0
- lis par
- sel par 3 (select the newly created partition)
- det par (verify the correct partition is selected)
- Set the Partition ID:
- If MBR: set id=27
- If GPT: set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
- Verify the Partition Type Change:
- det par
- exit
- Enable the Recovery Environment:
- reagentc /enable
- Verify with reagentc /info that the Windows RE location is on the correct partition.