This walkthrough describes how to boot Windows® PE directly from a hard disk instead of into a RAM disk. This enables you to start a computer for the purposes of performing deployment and recovery.

These instructions are for a UEFI-based computer with an AMD64 architecture. For instructions for a BIOS-based computer, see Walkthrough: Boot Windows PE from a BIOS-based Hard Disk.

Prerequisites

To complete this walkthrough, you need the following:

Step 1: Create bootable Windows PE RAM media

Select one of topics listed below and follow the instructions for building bootable Windows PE RAM media. Ensure that you include the ImageX tool with your image. After you create your bootable media, continue to the next step.

Step 2: Prepare the hard drive

In this step, you boot the new computer with your Windows PE media and format the hard drive.

  1. On the new computer, insert your Windows PE media and restart the computer.

    Windows PE starts and launches a Command Prompt window.

    Note:

    If the hard drive contains an EFI system partition (ESP), you must override the boot order to boot from the CD/DVD drive. During initial boot, select the appropriate function key to override the boot order. If this is a new computer, the hard drive will be unformatted, so you can skip this step.

  2. At a command prompt, format the hard drive by using the DiskPart tool. Windows PE requires an active partition with a size equal to or greater than the size of your Windows PE image. The following example shows these commands:

    select disk 0
    clean
    convert GPT
    rem Create the EFI system partition
    create partition EFI size=200
    format quick fs=fat32 label=EFI
    assign letter=s
    rem Create the Microsoft reserved partition
    create partition MSR size=128
    rem Create the Windows PE partition
    rem (The partition size is set to 400 MB, though a smaller partition size may be used.)
    create partition primary size=400
    format quick fs=ntfs label=WinPE
    assign letter=c
    rem Create a Windows or data partition
    rem (This partition fills the rest of the disk.)
    create partition primary
    format quick fs=ntfs label=Windows
    assign letter=w
    list vol 
    exit
    

Step 3: Copy Windows PE files to the hard disk

In this step, you copy Windows PE resource files to the hard drive from your bootable media. This example assumes the hard drive is blank.

  1. At a command prompt, copy the \EFI folder from your bootable media to the EFI folder of the EFI system partition on your hard drive, as in the following example:

    xcopy d:\EFI\* s:\EFI\* /cherkyfs
    
    where d is the letter of your bootable Windows PE media that contains a Windows PE image.

  2. Copy the \Sources folder from your bootable media to the sources folder of the Windows PE partition on your hard drive, as in the following example:

    xcopy d:\sources\* c:\sources\* /cherkyfs
    
  3. Copy the \Boot\boot.sdi file from your bootable media to the \Sources folder of the Windows PE partition on your hard drive, as in the following example:

    copy d:\boot\boot.sdi c:\sources\
    
  4. Copy all of the files with an .efi extension from the \windows\boot\EFI folder of the Windows PE RAM disk to the \EFI\Microsoft\Boot folder of the EFI system partition on your hard drive, as in the folllowing example:

    copy x:\windows\boot\EFI\*.efi s:\EFI\Microsoft\Boot\*
    
  5. Delete the boot configuration data (BCD) file that you copied from your bootable media. Note that you will create a new one in the next step, as in the following example,

    del s:\EFI\Microsoft\Boot\BCD /f
    

Step 4: Configure the System Store

In this step, you will create and configure a new system store by using the BCDEdit tool. The system store is a file named BCD that holds information required to load Windows or other boot applications. BCD replaces Boot.ini.

BCDEdit is a command-line tool that is designed to manage system stores. BCDEdit is available in Windows PE and Windows® 7.

  1. Create a new system store, as in the following example:

    bcdedit -createstore S:\EFI\Microsoft\Boot\BCD
    
  2. Create new entries in the system store for bootmgr, globalsettings, dbgsettings, ramdiskoptions, and Windows PE.

    bcdedit -store S:\EFI\Microsoft\Boot\BCD -create {bootmgr} /d "Boot Manager"
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -create {globalsettings} /d "globalsettings"
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -create {dbgsettings} /d "debugsettings"
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -create {ramdiskoptions} /d "ramdiskoptions"
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -create /d "Windows PE" -application osloader
    
    Note:

    The last command returns a GUID value for Windows PE store.

  3. Set the default entry that the boot manager selects when the timeout expires. Substitute <GUID> with the GUID value for the Windows PE store in the following example:

    bcdedit -store S:\EFI\Microsoft\Boot\BCD /default <GUID from Windows PE store>
    
  4. Run the following commands to configure bootmgr:

    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {bootmgr} device partition=s:
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {bootmgr} locale en-us
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {bootmgr} timeout 10
    
  5. Run the following commands to configure the boot loader:

    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} device ramdisk=[C:]\sources\boot.wim,{ramdiskoptions}
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} path \windows\system32\winload.efi
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} osdevice ramdisk=[C:]\sources\boot.wim,{ramdiskoptions} 
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} systemroot \windows
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} winpe yes
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} nx optin
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {Default} detecthal yes
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -displayorder {Default} -addfirst
    
  6. Run the following commands to configure dbgsettings:

    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {dbgsettings} debugtype Serial
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {dbgsettings} debugport 1
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {dbgsettings} baudrate 115200
    
  7. Run the following commands to configure ramdiskoptions:

    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {ramdiskoptions} ramdisksdidevice partition=C: 
    bcdedit -store S:\EFI\Microsoft\Boot\BCD -set {ramdiskoptions} ramdisksdipath \sources\boot.sdi
    

Your computer is now ready to boot Windows PE directly from the hard disk.

See Also