Add recovery partition to advance boot menu options

3

I want to add a WinPE automated recovery partition to a computer, can this boot option be added to "Advanced boot options"? (Like where Safe mode options are).

Claude Garlick

Posted 2014-10-26T12:39:47.137

Reputation: 53

Answers

4

Check the tool "ReAgentC.exe" for adding WinPE to Advanced boot options(ABO).


You can set any loader to be launched from "Repair Your Computer" in ABO.

Visual BCD Editor allows replacing/setting any loader as Recovery loader.


You need 2 entries(elements) in the main OS loader (Windows 7/8 loader)

1) "RecoverySequence" (GUID of loader to be launched for recovery)

2) "AutoRecoveryEnabled" (set to 1 or yes/true) Windows 7 loader


A recovery loader is a normal NT6 (Vista, Windows 7/8) loader +

"WinPEMode" (true) and "RecoveryOs" (true) elements. Windows 7 Recovery loader

snayob

Posted 2014-10-26T12:39:47.137

Reputation: 4 044

Where I can download Visual BCD Editor 0.9.4 or later version? I can't find them on your website, only older releases are available. Can you give a private temp link? Thanks for the very useful tool! – sambul35 – 2016-10-03T01:39:30.583

2You can't download 0.9.4 now as I am still developing and testing it, sorry. Older versions can fulfill the proposed solution. A recovery loader should be linked through RecoverySequence. The recovery loader itself should specify element "RecoveryOs". – snayob – 2016-10-03T07:23:03.223

1

Usually Advanced Recovery options are present in Win8 and newer OS Advanced Boot Options, accessible in Shutdown Options with Shift+Restart. However, if you restored a backup system drive to a new disk or similar, the Recovery options may be missing. If the hidden Recovery Partition is still visible in Disk Management Console, you can restore Recovery options in Admin Command Prompt:

Reagentc /info     (output: "Recovery partition is Disabled")
Reagentc /enable   (if still don't see Recovery Options in Advanced Boot Menu, continue)   
diskpart
list volume
select volume 2    (it's often marked 450-512MB Hidden)
set id=07          (mark it as regular NTFS data volume on MBR disk)
OR: set id=07 override
OR: set id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7   (mark it as NTFS data volume on GPT disk)
assign letter=E    (OR: first run *list volume* and *select volume* again to see if its changed)
exit               (exit Diskpart, or reboot and re-open Admin CMD)
Reagentc /info
Reagentc /enable   (if no success in Boot Menu, run: *Reagentc /setreimage /path E:\Recovery\WindowsRE* )
diskpart
list volume
select volume 2
remove letter=E
set id=27          (mark the volume back as Hidden Recovery Partition on MBR disk)
OR: set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac   (mark it back as Hidden Recovery Partition on GPT disk)
exit

Close Cmd Prompt and open Disk Management Console to see, the Recovery partition is still present and marked Hidden. Now right mouse click on Windows icon in Taskbar -> Shut Down or Sign Out -> Shift + Restart. It will open Windows Boot Menu, and you can verify that a range of Recovery Options is now restored and available from the Menu. Select Boot to Command Prompt and reboot to test, if they work.

If your Recovery Partition is missing altogether in Disk Management Console, boot to Windows 10 Installation disk or use other methods to Restore Windows Recovery Environment.

sambul35

Posted 2014-10-26T12:39:47.137

Reputation: 121

1

You can add your own BCD menu option using Easy BCD (2.2 MB download, free for personal use, registration optional), that provides a convenient GUI, saving you from unnecessary technical details.

First, you'll need to locate your WinRE.wim (or download one from the net). In my Windows 7, which has everything (boot and system) in the same partition, it's inside the hidden, only-admins folder, %SystemDrive%\Recovery\<GUID>\.

If your system has a reserved partition, it's trickier to get it out of there. Run diskpart:

list partition

The partition you need is marked as "Recovery". Get the number (let's say is 2).

select partition 2
assign letter=r

Now, open an admin command line without closing diskpart:

xcopy /h R:\Recovery\WindowsRE\Winre.wim c:\
exit

Again from diskpart:

remove letter=r
exit

Once installed, run Easy BCD and follow the sequence (ignore the upper part titled Operating Systems).

Easy BCD menu sequence

Of course, you can put any descriptive text that suits you in step 4. In step 5, go to the folder you put Winre.wim in. In my case, I just went to the original location.

After that, you'll have a new entry in your boot menu named Windows 7 RE (or whatever you wrote).

cdlvcdlv

Posted 2014-10-26T12:39:47.137

Reputation: 703

I thought of removing it, but actually there was nothing incorrect in the paragraph. I think to downvote an answer just for that is exaggerated and coercive. – cdlvcdlv – 2019-08-10T21:25:24.770

I'm not being coercive, as I believe if you're going to downvote someone's answer, you should not only provide them with the reason for the downvote but also provide them the opportunity to correct what's wrong in the answer, and if corrected, make known the downvote will be removed. Specific to your answer: From a practicality and efficiency standpoint, if Windows natively provides (i.e. includes it by default) the tools to solve a Windows-specific problem, booting to a Linux LiveCD should not be the answer. It's the equivalent of booting to FreeBSD to solve an Ubuntu-specific issue. – JW0914 – 2019-08-10T22:03:39.987

Please provide a link to the rules of SU that supports your assertion that, not being a requirement of the question, it's forbidden to use Linux in Windows questions. Otherwise, my answer was better before (since gave more ways to do the task). And, yes, your comment meant "do what I like or I'll keep my downvote". What you like, because it's not in the rules unless you prove it. – cdlvcdlv – 2019-08-11T11:06:50.637

Please re-read what I wrote. There's a plethora of ways to solve any one issue, w/ a few being vastly more relevant & efficient than most. Advising a user to utilize a Linux LiveCD/USB to accomplish what's possible via diskpart is inefficient and contextually-lacking advise. Efficiency matters and it takes all of 30s to perform the required changes via diskpart, versus 5m+ for a Linux LiveCD/USB, making it an inconvenience. While GParted will solve what's trying to be accomplished, It's an unnecessary & inefficient step that over-complicates a simple procedure Windows natively supports. – JW0914 – 2019-08-11T16:09:07.163

Hey, I hear you, but you shouldn't impose your rules by force. If you think your own believes about "practicality and efficiency" should be for everybody, open a suggestion in meta in order to include that to the rules. You cannot impose rules in SE at your wish and shouldn't downvote to remove anything useful according to your own preferences. Linux wasn't excluded by the OP and that paragraph was legit and informative (not for you, I take that). Well, you should be happy of your censorship. (I just saw you changed your comment while writing this. Sigh... I quit.) – cdlvcdlv – 2019-08-11T16:15:30.183

I'm baffled as tho how you're perceiving I'm "implementing my own rules"... I provided you with my rationale on what I do whenever I down-vote any user's answer (a respectful & thoughtful way to do so). The choice as to edit or not is always yours ("imposing my own rules by force" would be editing your post, which I did not). Please take a deep breath & re-read my post from yesterday explaining this. It's your answer & you are more than welcome to phrase it in the way you believe it should be phrased - others will either up or down vote it & many won't leave a comment when down-voting. – JW0914 – 2019-08-11T16:25:55.803

Let us continue this discussion in chat.

– JW0914 – 2019-08-11T16:38:19.417

0

Adding a boot option to the WinRE Boot Options Menu can be accomplished in multiple ways:

  • Use the existing WinRE.wim, copying and customizing it
  • Create your own WinRE.wim, customizing it

The resultant WIM would then be added as an additional boot option


  1. Customize WinRE
  2. Add a Custom Tool to the Windows RE Boot Options Menu

    1. Extract and mount a Windows image (install.wim) and its WinRE image (winre.wim)

      :: Create Required Directories:
      md C:\mount\windows C:\mount\winre
      
        :: Copy Install.wim: 
        xcopy Z:\sources\install.wim C:\mount 
      
        :: Mount Install.wim:
        Dism /mount-image /imagefile:C:\mount\install.wim /index:1 /mountdir:C:\mount\windows
      
        :: Mount WinRE.wim:
        Dism /mount-image /imagefile:c:\mount\windows\windows\system32\recovery\winre.wim /index:1 /mountdir:C:\mount\winre
      
    2. In a text editor, create the config C:\mount\WinREConfig.xml, specifying the custom tool’s filename and any parameters:

      • You can only add one custom tool to the WinRE Boot Options Menu

        <?xml version="1.0" encoding="utf-8"?>
        
        <!-- !!! This config MUST be encoded as UTF-8, not ANSI !!! -->
        
        <!-- WinREConfig.xml -->
        <Recovery>
          <RecoveryTools>
            <RelativeFilePath>OEMDiagnostics.exe</RelativeFilePath>
            <CommandLineParam>/param1 /param2</CommandLineParam>
          </RecoveryTools>
        </Recovery>
        
        • C:\Tools\OEMDiagnostics.exe: Custom troubleshooting or diagnostics tool
        • /param1 | /param2: Optional parameters used when running the custom tool
    3. Create directory \Sources\Recovery\Tools within the WinRE mount folder, copying the custom tool, and its config file, into the new directory:

      :: Create Required Directory:
      md C:\mount\winre\sources\recovery\tools
      
      :: Copy Required Files and Directories
      copy C:\Tools\OEMDiagnostics.exe C:\mount\winre\sources\recovery\tools
      copy C:\mount\WinREConfig.xml C:\mount\winre\sources\recovery\tools
      
      • The custom tool and any associated folders must be in this folder so that it can continue to work after future WinRE upgrades/updates.
    4. Commit your customizations and unmount the WinRE image:

      :: Unmount WinRE.wim:
      Dism /unmount-image /mountdir:C:\mount\winre /commit
      
      :: Create a Backup:
      copy C:\mount\windows\windows\system32\recovery\winre.wim C:\mount\winre_custom.bak.wim
      
      • The same customized WinRE.wim can often be utilized on multiple images
    5. Unmount and save the changes to the base Windows image:

      :: Unmount Install.wim
      Dism /unmount-image /mountdir:C:\mount\windows /commit
      


  3. Deploy the image

    1. Create a config file describing the custom tool in the Boot Options Menu

      • Add descriptions for each language you support.

        <?xml version="1.0" encoding="utf-8"?>
        
        <!-- !!! This config MUST be encoded as UTF-8, not ANSI !!! -->
        
        <!-- AddDiagnosticsToolToBootMenu.xml -->
        <BootShell>
          <WinRETool locale="en-us">
            <Name>Fabrikam Utility</Name>
            <Description>Troubleshoot your Fabrikam PC</Description>
          </WinRETool>
        </BootShell>
        
        • Warning: Limit the <Name> and <Description> values to 30 characters or less, ensuring they appear correctly in the Boot Options Menu.
    2. On the destination computer, during image deployment, but after you register the custom WinRE boot image and the Windows operating system, you must register the description of the custom tool:

      :: Set Boot Shell Link
      Reagentc /setbootshelllink /configfile E:\Recovery\BootMenu\AddDiagnosticsToolToBootMenu.xml
      


  4. Verify Custom Tool Appears in Boot Options Menu
    1. Restart destination computer and complete OOBE as your user
    2. Choose Advanced Startup
      • Win8: Start > PC settings > General - Advanced Startup - Restart Now
      • Win10: Start > Settings > Update & Security > Recovery - Advanced Startup - Restart Now
    3. Windows Boot Options Menu appears
      1. Troubleshoot > [Custom Tool Name] (i.e. Fabrikam Utility)
      2. Computer restarts in WinRE and the tool specified in the <RecoveryTools> section of the WinREConfig.xml appears
      3. Confirm custom tool works properly, then close tool
      4. Click Continue and the PC reboots to Windows

JW0914

Posted 2014-10-26T12:39:47.137

Reputation: 2 135