Partager via


How to install Windows RE on the hard disk

I have been getting a lot of questions about installing Windows RE on the hard disk. This is good news for us as that means many of you are actually trying out Windows RE. So here's the simple four step process.

Step 1: Choosing a partition to install Windows RE

The hardest part about installing Windows RE seems to be deciding where to install it. The following considerations should go into deciding which partition to choose (listed in the priority order):

  1. The partition should not be the same as the Windows OS partition. This is so that you can boot into Windows RE even if your OS partition becomes corrupt or inaccessible for any reason. This helps maximize the chances that you would be able to boot into Windows RE when your main Windows installation is in trouble.
  2. The partition should be hidden so that users do not accidentally delete files or corrupt the Windows RE installation in anyway. Microsoft has defined a special partition type for this specific purpose. On MBR disks, the partition should be assigned partition type 0x27. And on GPT disks, the partition should have the partition type GUID: {DE94BBA4-06D1-4D40-A16A-BFD50179D6AC}.
  3. The partition should not interfere with any advanced volume management functionalities, such as dynamic volumes. Any hidden partitions after the Windows OS partition may interfere with dynamic volume creations. Therefore, the Windows RE partition should be created before the Windows OS partition.

In the Windows OPK and the Windows AIK, we have a couple of partition layout recommendations. These recommendations were made by following the above considerations. These recommendations are:

  1. If the machine is not BitLocker enabled, then the partition should be a hidden recovery partition allocated before the OS partition. It should be assigned type 0x27 on MBR disks and type {DE94BBA4-06D1-4D40-A16A-BFD50179D6AC} on GPT disks. The partition should be at least large enough to hold the Windows RE WIM, 1.5GB should be plenty for the base Windows RE.
  2. If the machine is BitLocker enabled, then the BitLocker partition (a.k.a. the system partition) can be used for Windows RE installation.  It should be noted that when using this configuration, the Windows RE on the BitLocker partition cannot be used to launch the Complete PC restore application.

 

Note:- If you just want to experiment with Windows RE without creating a separate partition for Windows RE, you can choose any visible drive in Vista.

 

Step 2: Copying Windows RE Files

For the purposes of this post, I am going to assume a WIM-based installation. If you want to install an expanded Windows RE, please look at the Windows OPK or the Windows AIK for appropriate documentation.

You need to copy the following two files to the root of the partition you chose in step 1 above.

  1. winre.wim (you can build a winre.wim using the installation media and the Windows AIK, as described here)
  2. boot.sdi (you can find it in the Windows AIK, under C:\Program Files\Windows AIK\Tools\PETools\x86\boot)

 

Step 3: Configuring Windows RE

To configure Windows RE, you can use the SetAutoFailover.cmd script provided in the Windows AIK (under: C:\Program Files\Windows AIK\Recovery). If you copied Windows RE files on the D: in step 2 above, and assuming that D: is the first partition on the disk, you would use it as:

SetAutoFailover.cmd /target D: /wim /nohide

Note:- You need to run SetAutoFailover.cmd from an elevated command prompt. To open an elevated command prompt, search for cmd.exe in the search box off Start button, then right click on the cmd icon in search results and choose Run as administrator.

 

Step 4: Testing Windows RE Installation

To test that Windows RE is installed correctly on the hard disk - Restart your computer and press F8 very early during boot. If you press it early enough, you should see an Advanced boot menu. The first item on this menu should be "Repair your computer." Choosing this option will take you to Windows RE.

Comments

  • Anonymous
    January 14, 2007
    This worked great for me the first time, and I think we should make this part of our image for recovery purposes.  

  • Anonymous
    January 24, 2007
    Hi, this is a fantastic concept - I've been seriously looking into how to install WinRE on the hard disk for all the Vista PC's we build, as we're planning on shipping a recovery solution on the hard disk, rather than ship external media. However, I've found that the autofailover breaks after running Sysprep /generalized and the PC no longer boots into WinRE after 'first' boot. We need to use the generalize command, because we mass duplicate the hard drives when an image is sealed. Any ideas on how to maintain the boot configuration data after generalizing? I've looked EVERYWHERE for any other referenece to this issue. Thanks James

  • Anonymous
    January 24, 2007
    Yes, generalizing a Windows image causes auto failover to break. This is known issue and there is a work around for it. You should run SetAutoFailover.cmd (or equivalent) during the OOBESystem phase of setup by setting this in your FirstLogonCommands.

  • Anonymous
    January 31, 2007
    Hi. My computer had Windows XP on Partition 1 and Windows Vista on Partition 2. I also had the recovery console installed on XP. I used Partition Magic to move the XP partition up and created a new small partition at the start of the disk for WinRE. After I rebooted, I couldn't access XP (which was now on Partition 2). I used the WinRE notepad to edit boot.ini and now everything works. What's confusing is that many drive letters have changed. I have 2 320 GB hard drives and 4 USB drives with 12 partitions (there's a reason)! So my question is: "Is there a way to preconfigure the volume to drive letter mapping when building the WIM?" Thanks.

  • Anonymous
    January 31, 2007
    The comment has been removed

  • Anonymous
    February 08, 2007
    Regarding running the SetAutoFailover.cmd (I have this script) during the OOBESystem phase of setup - is there any supporting documentation for doing this? Also, as I'm looking to install WinRE on the hard drive, won't the autofailover just break again, if the end user restores the factory image? Final question, there are numerous references to OEM's being able to store this factory image into the WinRE partition, but again, very little information as to how to set this up, to allow the end user to easily restore the image from WinRE (I'll be using a *.WIM Image). Do you know of any supporting documents? We don't have any software developers here, so it would most likely have to be a 'no frills' script that is run from a command prompt that utilises Imagex.exe - has anyone managed to create a restore solution using this method yet?

  • Anonymous
    April 12, 2007
    I read about some sort of "Self-healing" functionality in Vista and Longhorn Server's NTFS. Would you elaborate in detail on this?

  • Anonymous
    April 13, 2007
    Regarding NTFS self-healing, you can find some information from the following WinHEC 2006 presentation: http://download.microsoft.com/download/5/b/9/5b97017b-e28a-4bae-ba48-174cf47d23cd/STO123_WH06.ppt

  • Anonymous
    June 16, 2007
    Why your blog updated very slowly?

  • Anonymous
    June 26, 2007
    How does one go about creating the magic hidden partitions on Longhorn Server?  I have created the WIM file and I'm ready to plop-n-drop, but I can't figure out how to create the recovery partition before the Windows OS partition.   Any help is appreciated! Hilde

  • Anonymous
    December 16, 2007
    I like these articles, by reading over the less than recent posts I can see that I am a little late in posting (sorry). Anyway, I think it might also be a given that a user may want to have a backup Windows RE on CD. This is sort of a given, but for the record (helpful for running cloning utilities): #1 login to Windows PE build directory: copype.cmd x86 c:winpe2_x86 #2 as stated in your blog post: mkdir c:winre_image mkdir c:winre_mount #3 as stated in your blog post: imagex.exe /export /boot e:sourcesboot.wim 2 c:winre_imagewinre.wim “WinRE” #4 as stated in your blog post: imagex /mountrw c:winre_imagewinre.wim 1 c:winre_mount #5 as stated in your blog post:   1. By using a text editor, create a file called winpeshl.ini that contains the following text:     [LaunchApp]     AppPath=x:sourcesrecoveryrecenv.exe   2. Copy this file to WindowsSystem32 directory in your mounted Windows RE directory. For example, copy winpeshl.ini C:winre_mountWindowsSystem32 #6 as stated in your blog: Unmount the image by using ImageX. For example, imagex.exe /unmount /commit c:winre_mount #7 now move winre.wim to folder c:winpe2_x86ISOsources and delete old boot.wim and rename winre.wim to boot.wim #8 finally, CD back to c:program filesWindows AIKToolsPETools and issue the following command: oscdimg -n -bc:winpe_x86etfsboot.com c:winpe_x86ISO c:winpe_x86winpe_x86.iso Now burn winpe_x86.iso to a CD, this gives you a secondary Windows RE with your favorite utilities that can be accessed through a root command prompt.

  • Anonymous
    February 05, 2008
    HI, Great Blog and thanks for posting all your great advice, But......and it's a big one..Ive been bashing my prune trying to get the setautofailover.cmd to apply the nescessary changes in the recovery partition in the OOBE system pass and it will not apply! it works fine if im in end user maode or audit mode but as far as im aware it needs to trigger the command during the OOBE as the generalize option will break it, i have done this and i can see it in pantherunattend.xml but if i OOBE /generalize nothing happens, the partition is still visable and F8 has just the regular options! am i the only one with this issue? Please any advice would be greatly appreciated!

  • Anonymous
    February 06, 2008
    What would need to be changed for a 64bit system? Would the winpeshl.ini still go in the system32 directory? Would i use the boot.sdi file from the amd64 directory or still use the x86 version? And if i want to add inf driver files would i have to be running inside a 64bit OS?

  • Anonymous
    June 02, 2008
    Hi! I have followed steps to install it on HD, but there are errors ... I manage to see the option "Repair your computer" in advanced menu with F8, but after i click on it i get the following error: ... boot selection failed because required device is inaccessible ... Is someone having a similar problem(s)? Any help would be appreciated ... Brgds, Sergej

  • Anonymous
    January 22, 2010
    The comment has been removed

  • Anonymous
    January 22, 2010
    The comment has been removed

  • Anonymous
    March 31, 2010
    Nice post! But would you tell us how to do it for a Windows 7 RE? There is no setautofailover.cmd in AIK for Windows 7.

  • Anonymous
    March 31, 2010
    Is it the setautofailover.cmd which makes Windows detect the Win RE is present? Because I have a second partition which holds my Boot Manager and I want to put Win RE there. So, I have to make Windows (which is in another partition) detect Win RE and make it accessible through F8 Advanced Boot.

  • Anonymous
    June 10, 2010
    The comment has been removed

  • Anonymous
    September 27, 2011
    Hi Thanks for the contents above.  The <a href="www.unistal.com/convert-ost-pst.html">ost pst conversion </a>, is a software which is used to convert an ost file to pst format. Thanks... <a href="www.unistal.com/convert-ost-pst.html">ost to pst conversion</a>

  • Anonymous
    January 06, 2015
    I have actually written a project that does this automatically from a Task Sequence and provided my WIM as well as scripts, the information can be found at the following link blassdeploymentsolutions.blogspot.co.il

  • Anonymous
    June 09, 2015
    Why not simplify the task as setup recovery console in XP, which only requires insert the product CD and type x:i386winnt32.exe /cmdcons to install the WinRE?