[Solved] Separate partition for WinRE.wim on Windows 10 LTSB 1607.

Discussion in 'Windows 10' started by Supern00b, Apr 6, 2017.

  1. Supern00b

    Supern00b MDL Addicted

    Dec 30, 2010
    #1 Supern00b, Apr 6, 2017
    Last edited by a moderator: Apr 20, 2017
    For some days I have been trying to put the Windows Recovery Environment wim file on a separate partition.
    Without much success, sadly.
    This is what I've done, it's MBR partitioned (old system):

    Created three partitions: system fat32, windows ntfs and the last one recovery 600MB ntfs type 27.
    Deployed the install.wim from Win PE, as a last step copied over the WinRE.wim to the last partition.
    After rebooting and installing apps and stuff, opened command prompt as admin and assigned a letter to the hidden recovery partition.
    Then I issued these commands:

    Reagentc /disable
    xcopy /H C:\Windows\System32\Recovery\ReAgent.xml R:\Recovery\WindowsRE
    reagentc /setreimage /path R:\Recovery\WindowsRE
    reagentc /enable
    After the "setreimage" command it looked like the path was correctly set.
    But when doing "reagentc /info" the path had not changed at all, it was still using the C:\Recovery folder.
    Also, when doing "bcdedit /enum all" it effectively showed that the recovery was enabled but still using the Windows partition.

    Long story short, I can't relocate the WinRE.wim to a separate partition. Looks like Windows 10 does not allow a partition other than the Windows partition for the WinRE.wim.
    I know it works, because when installing from DVD and using the normal Windows setup, WinRE gets the separate partition.

    Goal is to make some sort of repair environment available in case the Windows partition gets corrupted.
    Any pointers on this would be most welcome.

  2. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    From WinPE, create partitions, deploy install.wim, make bootable with bcdboot, then setup winre.wim with reagentc, reboot.
  3. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Supern00b

    Supern00b MDL Addicted

    Dec 30, 2010
    #4 Supern00b, Apr 7, 2017
    Last edited: Apr 7, 2017
    Thanks for the replies.
    I had some doubts about running reagentc.
    My PE is x86 and the image is x64, it obviously wouldn't run from the system32 folder.
    I tried to make a portable x86, but that also didn't run.

    So I figured it had to be done from an online image, it worked wonders but as said - The path wasn't updated, WinRe.wim remained on the windows drive.
    The tool from murphy78 looks like it has the correct option (WinRE Movement option)
    So I had a look and murphy does not use reagentc, instead he uses winrecfg, probably from W10 ADK.
    I'll test it to see if this works better than reagentc, but I fear that the bootstore isn't updated correctly.


    Tried with murphys modified boot.wim, but it said "Recovery is already enabled".
    It didn't allow me to disable, that is not a valid option.
    No idea what to do next...

    Got reagentc running from my WinPE, it asked for a osloader GUI that was found in the bootstore.
    bcdedit /enum all -v showed the GUI, but when trying to enable with reagent the message came back:
    You have to run bcdboot first.
    Bcdboot was already run and the bootstore was setup correctly, so I couldn't go around that message.

    Back in windows, the same problem. As much as I set the location to R:, it keeps using the windows partition for WinRE.
    I'm out of options, anyone ever succeeded doing this?

    Sooooooolveeed alhamdullilah!

    The issue was the size. We think Windows creates 450MB, so 600MB should be more than sufficient. Wrong!

    For my installs, I want on the same recovery partition include the os image, so people can reinstall their pc from there.
    So I made it 5GB, and online with reagentc it was less than a minute work.
  5. shinjiman

    shinjiman MDL Novice

    Aug 29, 2012
    Where do you run the reagentc command?
    If this one was run in the WinPE mode, you need to add the "/target " parameter to the offline image of the Windows installation directory.
  6. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    #6 Flipp3r, Apr 7, 2017
    Last edited by a moderator: Apr 20, 2017
    Here's a quick rundown of key commands to use. My unattend.xml boots the OS into Audit mode.
    You could stick the Locale stuff in the unattend as well.
    Diskpart /s %Layout%
    dism /Apply-Image /ImageFile:%WimFile% /Index:%Index% /ApplyDir:W:\ /verify /checkintegrity
    copy %Unattend% W:\Windows\Panther\Unattend.xml /y
    BCDBoot W:\Windows /l en-US /s S:
    dism /Image:W:\ /set-syslocale:en-AU
    dism /Image:W:\ /set-userlocale:en-AU
    dism /Image:W:\ /set-inputlocale:en-AU
    dism /Image:W:\ /set-timezone:"AUS Eastern Standard Time"
    Dism /Image:W:\ /Add-Driver /Driver:%Drv% /Recurse
    xcopy W:\Windows\System32\Recovery\*.* R:\Recovery\WindowsRE\
    W:\Windows\System32\reagentc /setreimage /path R:\Recovery\WindowsRE /target W:\Windows
  7. Supern00b

    Supern00b MDL Addicted

    Dec 30, 2010
    Thanks Flipp3r, I knew it was possible to do it all from PE. That quick rundown of commands confirms that my initial order was correct, the problem was the WinRE partition being an incorrect size.
    Indeed, all my locale stuff is in unattend.xml at the moment.
    I'm happy that you guys post your ideas, it really helps me to make deployments more professional.
    I took a quick look at the project from AnarethoS and it seems this is just what I need.

    Again thanks for the input.

  8. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    If you need any help with my tools, I'm here to help on the thread for my tools or via PM.