Showing posts with label Windows Recovery Environment. Show all posts
Showing posts with label Windows Recovery Environment. Show all posts

Tuesday, May 19, 2015

Windows Recovery Technical Reference

Windows Recovery Environment (Windows RE) is an extensible recovery platform based on Windows Preinstallation Environment (Windows PE). When the computer fails to start, Windows automatically fails over into this environment, and the Startup Repair tool in Windows RE automates the diagnosis and repair of an unbootable Windows Vista installation. Furthermore, Windows RE is a starting point for various tools for manual system recovery. The primary audience of this technology includes original equipment manufacturers (OEMs), original device manufacturers (ODMs), and corporate IT professionals.

In this Section

Wednesday, January 28, 2015

Deploy a System Recovery Image

This walkthrough describes how to deploy a recovery solution to reinstall the factory image in the event of a system failure. Windows® Recovery Environment (Windows RE) supports several recovery scenarios. This topic describes two sample recovery solutions: using Windows RE with Windows Setup as the primary recovery tool, and using Windows RE with a custom recovery solution.
In Windows® 7, you can install a Windows RE image on any primary NTFS partition that is on the same disk as your Windows installation, provided the partitions is one of the following types:
  • MBR disks Type 0x7 or type 0x27. If type 0x27, it must be at the beginning of the disk.
  • GPT disks   Contains the PARTITION_MSFT_RECOVERY_GUID attribute.
For more information about partition requirements, see Understanding Disk Partitions.

In This Topic

Setup-based Recovery Solution

The setup-based solutions provide the end user an option to use Windows RE to reinstall the factory image in the event of a system failure.

Prerequisites

To complete this walkthrough, you need the following hardware and software:

Step 1: Configure the recovery partition

In this step, you configure a setup-based recovery solution by using the same Windows 7 image you deployed and the default Windows Recovery image that is contained in the Windows partition.
  1. Start the destination computer by using a Windows PE bootable media.
  2. Connect the computer to the device or network location containing the Windows 7 image:

    net use n: \\server\share\
    
  3. Move the default Windows Recovery image (Winre.wim) from the Operating System partition to the System partition (S:).

    mkdir S:\Recovery\WindowsRE
    move C:\Windows\System32\Recovery\winre.wim S:\Recovery\WindowsRE
    
    noteNote
    You can store the Winre.wim file on any drive, but you must place it in the following directory structure: \Recovery\WindowsRE.
  4. Configure Windows to recognize the default Windows Recovery image (Winre.wim):

    C:\Windows\System32\Reagentc.exe /setreimage /path S:\Recovery\WindowsRE /target C:\Windows
    
  5. Copy your Windows 7 image (.wim) file to the recovery partition (R:).

    copy N:\images\my-windows-partition.wim R:\
    
  6. Rename the image file to Install.wim.

    rename R:\my-windows-partition.wim R:\install.wim
    
    noteNote
    You can store the Windows recovery image in any folder, but the file must be named install.wim.
  7. Configure Windows RE to recognize your Windows 7 image (.wim) file.

    C:\Windows\System32\Reagentc.exe /setosimage /path R:\ /target C:\Windows
    

Step 2: Test your recovery solution

In this step, you start the destination computer to verify that the recovery tool can be started.
  1. Remove the CD-ROM and any USB drives.
  2. Start the destination computer and complete Windows Welcome.
  3. Click Start, click Control Panel, click System and Security, click Backup and Restore, and then click Recover system settings or your computer.
  4. Click Advanced recovery methods and then click Reinstall Windows
  5. Follow the on-screen instructions. The computer restarts.
  6. Verify that the computer starts in Windows RE. The system reinstalls Windows by using the image that you placed in the recovery partition. When the installation is complete, you have the option to restore other files you have backed up.

Custom Recovery Solution

By using a custom recovery solution, you can integrate a non-Microsoft recovery solution with Windows RE. In the event of a failure, an end user can restore their computer to a factory image by using a non-Microsoft solution.

Prerequisites

To complete this walkthrough, you need the following software and hardware:
  • Customized Windows RE image, as described in step 4 of Walkthrough: Create a Windows RE Image.
  • Technician computer. For more information, see Building a Technician Computer.
  • Bootable Windows PE media with the ImageX tool. This can be a CD-ROM, a USB flash drive, or another bootable media. For more information, see Windows PE Walkthroughs.
  • A reference Windows 7 image stored on an external location, such as a network share or an external USB hard drive.
  • A destination computer with the Windows and system partitions applied, and an empty recovery partition. For more information, see Apply Images by Using ImageX.

Step 1: Configure the Recovery Partition

In this step, you configure your custom recovery solution and the default Windows recovery image that is contained in the Windows partition.
  1. Start the destination computer by using your Windows PE bootable media.
  2. Connect the computer to the device or network location containing the Windows 7 image:

    net use n: \\server\share\
    
  3. Move your custom Windows RE image (Winre.wim) to the recovery partition (R:).

    Mkdir R:\Recovery\WindowsRE
    Move N:\images\winre.wim R:\Recovery\WindowsRE\
    
    noteNote
    You can store the Winre.wim file on any drive, but you must place it in the following directory structure: \Recovery\WindowsRE.
  4. Configure your custom Windows RE image and specify that when the F1 key (scan code = 0x3b00) is pressed during startup, Windows RE and the custom recovery application launch:

    C:\Windows\System32\Reagentc.exe /setreimage /path R:\Recovery\WindowsRE /target C:\Windows /bootkey 3b00
    
    For other examples of keyboard scan codes, see REAgentC Command-Line Options. For more about customizing the bootstrapping process, see Custom Bootstrap Actions.
  5. Configure the operating system to recognize the custom recovery tool you included in your Windows RE image:

    C:\Windows\System32\Reagentc.exe /setosimage /customtool /target C:\Windows
    

Step 2: Test your recovery solution


In this step, you start the destination computer to verify that the recovery tool can be started. In addition, you verify that the custom factory recovery application can be launched from the Windows RE menu.
  1. Remove the CD-ROM and any USB drives.
  2. Restart the computer.
  3. Start the destination computer and complete Windows Welcome.
  4. Restart the computer. Immediately after POST, hold down the F8 key. The Advanced Boot Options menu appears.
  5. Select Repair your computer and then press Enter. Windows RE starts.
  6. Follow the on-screen instructions to select a keyboard layout and provide credentials.
  7. Verify that a link to your custom recovery application appears on the Windows RE menu.
  8. Restart the computer.
  9. Immediately after POST, hold down the F1 key. Windows RE starts.
  10. Verify that your custom recovery application launches automatically.

Monday, January 26, 2015

Creating Window RE Using Windows AIK

Create Windows RE using the Windows Automated Installation Kit (AIK).

These instructions are also included in the Windows AIK. Please note that the ReadMe file that accompanies the Windows AIK contains an important update to the instructions.

Note: If you install Windows RE using the Windows OPK, please continue to follow the instructions in the Windows OPK. Those instructions remain unchanged. Use these instructions only if you do not have access to the Windows OPK.

Step 1: Copy Windows PE from the Installation Media
The version of Windows PE that ships with the Windows AIK does not contain the components required to support Windows RE. However every Windows installation disk contains Windows RE that can be used for recovery of Windows Vista. Therefore, we will use the Windows RE from the Windows installation media.
  1. On your technician computer, click Start, point to All Programs, then Windows AIK, and then click Windows PE Tools Command Prompt.
    The menu shortcut opens a command prompt window and automatically sets environment variables to point to all the necessary tools.
  2. Create a directory for the Windows PE image and a mount point
            mkdir c:\winre_image
            mkdir c:\winre_mount
  1. Copy the Windows PE image from the installation media using ImageX
            imagex.exe /export /boot e:\sources\boot.wim 2 c:\winre_image\winre.wim “Windows Recovery Environment”
  1. Mount the image using ImageX
            imagex /mountrw c:\winre_image\winre.wim 1 c:\winre_mount
Step 2: Add Windows RE shell script
The Windows PE we copied in step 1, does not launch Windows RE automatically. In this step, we will create a script called winpeshl.ini that will launch the Windows RE shell at startup.
  1. By using a text editor, create a file called winpeshl.ini that contains the following text:
    [LaunchApp]
    AppPath=x:\sources\recovery\recenv.exe
  1. Copy this file to \Windows\System32 directory in your mounted Windows RE directory. For example,
              copy winpeshl.ini c:\winre_mount\Windows\System32
Step 3: Add mass-storage drivers (optional)
If necessary, you can include third-party drivers (.inf) in your Windows RE image by using the peimg.exe /inf command. For example,
    peimg.exe /inf= C:\winre_x86\mount\Windows
        Where  is the location of the. inf file.
Step 4: Add custom tools to Windows RE (optional)
You can customize Windows RE shell by creating an .xml file called WinREConfig.xml. WinREConfig.xml enables you to define custom support and diagnostic tools within Windows RE. This step is optional. For more information, refer to the Windows RE documentation in the Windows AIK.
Step 5: Save changes to the image
Unmount the image by using ImageX. For example,
    imagex.exe /unmount /commit c:\winre_mount


The WinRE.wim file is now ready to be deployed on the harddisk or a WDS server.