3

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?

2 Answers2

8

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
  • 4
  • 18
  • 19
Pepik
  • 189
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,665