Home > Uncategorized > Deploy Windows Recovery Partition Manually

Deploy Windows Recovery Partition Manually

Check Windows RE status

    reagentc /info

    Disable current Windows RE

    reagentc /disable

    Check or create a recovery partition by diskpart

    # X/y is the target disk/partition
    DISKPART> select disk x
    DISKPART> list partition
    DISKPART> select partition y
    
    #The recovery partition looks like:
    DISKPART> detail partition
    
    Type    : de94bba4-06d1-4d40-a16a-bfd50179d6ac
    Hidden  : Yes
    Required: Yes
    Attrib  : 0X8000000000000001
    
    # If no recovery partition, create one and set below properties. Only "set id=27" is needed for BIOS
    DISKPART> set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
    DISKPART> gpt attributes=0x8000000000000001
    
    # Keep the recovery partition/volume active from above steps.
    DISKPART> format quick fs=ntfs label=”Windows RE”
    DISKPART> assign letter=R

    Prepare the Windows RE image “Winre.wim” from below location

    "C:\Windows\System32\Recovery\Winre.wim"
    #If the file doesn't exist, usually because WinRE has been moved to the RE tools partition prior to capturing the image. Get it from the mounted windows installation install.wim
    
    > dism /mount-image /ImageFile:"D:\sources\install.wim" /index:4 /mountdir:"C:\WinInstall_mount" /ReadOnly
    "C:\WinInstall_mount\Windows\System32\Recovery\Winre.wim"
    
    # Now copy winre.wim to the recovery partition:
    mkdir R:\Recovery\WindowsRE
    xcopy /h C:\Windows\System32\Recovery\Winre.wim R:\Recovery\WindowsRE
    
    # Unmount install.wim after done copying
    dism /unmount-Image /MountDir:"C:\WinInstall_mount" /discard

    Register the winre.wim image

    reagentc /setreimage /path R:\Recovery\WindowsRE /target C:\Windows
    reagentc /enable
    reagentc /info

    Remove the volume letter

    DISKPART> select disk x
    DISKPART> select partition y
    DISKPART> remove letter=R
    Categories: Uncategorized
    1. No comments yet.
    1. No trackbacks yet.

    Leave a comment

    This site uses Akismet to reduce spam. Learn how your comment data is processed.