2

I had to clone my hard drive from a bigger one to a smaller one and in the process I lost the recovery partition that was at the end of the hard drive. It was a 500MB partition. I'm running the latest version of Windows 10. Is it possible to restore that partition?

  • This is a 90% solution. The only difference is that you need to use the Windows 10 SDK instead of the Windows 8 Evaluation Kit. – Ramhound Aug 03 '21 at 19:10
  • You can live without the recovery partition. You can use the Windows 10 download to reinstall Windows and then update any drivers it did not update. – John Aug 03 '21 at 19:46
  • If you can still access the old drive, try to resize the big one smaller before the clone so it might fit. Thats what I would try .. :| What @John says is true but I too like having the recovery partition. – Señor CMasMas Aug 03 '21 at 20:50
  • Does this answer your question? Windows 10 lacks partitions and WinRe options. If the winre.wim doesn't exist within %WinDir%\System32\Recovery, use the Windows Media Creation Tool to download the Windows 10 install ISO, open sources\install.esd within 7zip, choose folder 1 for Home or 6 for Pro, navigate to Windows\System32\Recovery, and extract winre.wim. From there, proceed with the steps in the aforementioned answer. Note: there are different WinRE partition creation steps depending if you have BIOS or UEFI – JW0914 Jan 05 '24 at 11:54

2 Answers2

4

This is an example of the process of restoring recovery partition on Windows 10, if there is no recovery partition at all. In addition, I suggest, if there is one which is not functioning then delete the partition/volume and redo from scratch. Use with caution! Using only Microsoft tools, so one can be 100% sure there is no security issue.

  1. Download & Create Microsoft Windows ISO for your system https://www.microsoft.com/en-us/software-download/windows10 or ...windows11.

  2. Create C:\wim and C:\wim\install

     mkdir c:\wim
     mkdir c:\wim\install
    
  3. Mount the ISO image or use the DVD; locate \sources\install.esd file and copy to C:\wim

  4. List all the versions:

     Dism /Get-WimInfo /WimFile:c:\wim\install.esd
    

    ... ... Index : 4 Name : Windows 10 Education Description : Windows 10 Education Size : 15,613,170,917 bytes

    Index : 5 Name : Windows 10 Education N Description : Windows 10 Education N Size : 14,857,698,925 bytes

    Index : 6 Name : Windows 10 Pro Description : Windows 10 Pro Size : 15,625,575,440 bytes ... ...

  5. Extract install.wim for your system - have 15GB free space

     Dism /Export-Image /SourceImageFile:C:\wim\install.esd /SourceIndex:6 /DestinationImageFile:C:\WIM\install.wim /Compress:max /CheckIntegrity
    

    ... ... Deployment Image Servicing and Management tool Version: 10.0.19041.3636

    Exporting image [==========================100.0%==========================] The operation completed successfully. ... ...

  6. Get info from the extracted C:\wim\install.wim

     Dism /Get-WimInfo /WimFile:c:\wim\install.wim
    

    ... ... Deployment Image Servicing and Management tool Version: 10.0.19041.3636

    Details for image : c:\wim\install.wim

    Index : 1 Name : Windows 10 Home Description : Windows 10 Home Size : 15,276,446,585 bytes

    Index : 2 Name : Windows 10 Pro Description : Windows 10 Pro Size : 15,625,575,440 bytes

    The operation completed successfully. ... ...

  7. Decompress files

     Dism /apply-image /imagefile:c:\wim\install.wim /index:2 /ApplyDir:c:\wim\install
    
  8. Locate C:\wim\install\windows\system32\recovery\Winre.wim and copy (for clarity only) to C:\wim, the Winre.wim is the only file needed. You can delete all else created in the process from disk.

  9. Check the Winre.wim

     Dism /Get-WimInfo /WimFile:c:\wim\winre.wim
    

    ... ... Deployment Image Servicing and Management tool Version: 10.0.19041.3636

    Details for image : c:\wim\winre.wim

    Index : 1 Name : Microsoft Windows Recovery Environment (x64) Description : Microsoft Windows Recovery Environment (x64) Size : 2,244,440,228 bytes

    The operation completed successfully. ... ...

  10. Necessary disk operations (explaining each step is over the scope of this contribution, as it would become a book - research every step!) if you do not know what each command does do not continue!

    diskpart
    list disk
    

    ... ... Disk ### Status Size Free Dyn Gpt


    Disk 0 Online 931 GB 1024 KB * ... ...

    select disk 1

    ... ... Disk 1 is now the selected disk. ... ...

    list volume

    ... Volume ### Ltr Label Fs Type Size Status Info


    Volume 0 D DVD-ROM 0 B No Media ... ...

    select volume 2

    ... ... Volume 2 is the selected volume. ... ...

    shrink desired=1500 create partition primary format quick fs=ntfs assign letter=r

  11. Create directory R:\Recovery\WindowsRE\

    mkdir R:\Recovery\
    mkdir R:\Recovery\WindowsRE\ 
    
  12. Copy the image C:\wim\Winre.wim to R:\Recovery\WindowsRE\

  13. Set GUID for the partition to mark it as "Recovery" type.

    diskpart
    list disk
    select disk 1
    list partition
    select part 4
    set id=DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
    
  14. Set RE image

    reagentc /setreimage /path R:\Recovery\WindowsRE\
    

    ... ...
    Directory set to: \?\GLOBALROOT\device\harddisk1\partition4\Recovery\WindowsRE

    REAGENTC.EXE: Operation Successful. ... ...

  15. Remove the leter from volume

    diskpart
    list disk
    select disk 1
    list volume
    select volume 5
    remove letter=R
    
  16. Re-enable the "Recovery" system

    reagentc /enable
    

    ... ... REAGENTC.EXE: Operation Successful. ... ...

That concludes the process. The recovery partition is not necessary for the OS to function. The process is possible to repeat. I suggest to test the process for any version of Windows first in a virtual environment. It has been slightly different in past and one can assume it will be so in future.

ChanganAuto
  • 1,511
  • 3
  • 15
  • 19
Pepik
  • 41
  • I'd add that if you already are in a virtual environment, take a snapshot first (maybe even start with a clone). – mbmast Mar 24 '24 at 01:57
0
  1. Check the current state of your Windows recovery: reagentc /info

  2. Create an empty 1GB partition in the end of your system drive.

    • You might need to shrink your previous partition to free some space. If Windows Disk Manager would be unable to shrink it, use GParted live USB.
  3. Mark partition type as recovery 27 for BIOS/MBR (or DE94BBA4-06D1-4D40-A16A-BFD50179D6AC for UEFI/GPT). In cmd: diskpart, list disk select disk 0, list part, sel part 3, det part, set id=27, exit.

    • This just an example, make sure to select the correct partition!
  4. Disable and enable Recovery to move it to the new partition: reagentc /disable, reagentc /enable.

  5. Verify that Recovery is now on the new partition: reagentc /info

Here's a nice video guide.

i3v
  • 1,590
  • 1
  • 14
  • 27
  • 1
    There is never a need to use a Linux-based utility to configure WinRE (please see shrink in diskpart), and id=27 is for BIOS only, UEFI requires entirely different steps – JW0914 Jan 05 '24 at 11:56
  • I personally ran into the inability to shrink my OS partition from Windows itself yesterday. Not sure why, but this was not the unmovable files issue. Thanks for noting that GPT recovery partition ID is different, I fixed this – i3v Jan 06 '24 at 21:13