3 out of 6 rated this helpful - Rate this topic

Walkthrough: Flat-Boot Windows PE

Published: February 29, 2012

Updated: May 31, 2012

Applies To: Windows 8, Windows Server 2012

You can install Windows® Preinstallation Environment (Windows PE) to boot up faster by configuring it to run from the drive, rather than from memory. This procedure is also known as a non-RAMDISK boot, or a flat boot. This booting method can give you faster performance for the initial boot sequence, and can help you run Windows PE on PCs or virtual environments with low memory. You can also make system changes that persist across reboots.

noteNote
When Windows PE is running from the drive, you must shut down or turn off the PC before disconnecting the drive to avoid losing your work.

In virtual environments like Hyper-V, we've included instructions for creating a Windows PE virtual hard drive (VHD) that boots from the drive. However, you may consider using an ISO file instead, because you can connect and disconnect the media during the same session. For instructions, see the section on creating a Windows PE DVD in the topic: Walkthrough: Install Windows PE to CD, USB Flash Drive, or USB Hard Drive.

The default installation supports both UEFI-based and BIOS-based PCs. However, you can prevent Windows PE from booting into UEFI or BIOS modes by removing the appropriate boot files. You can detect which mode the PC is booted into by using scripts.

For more installation options, see Walkthrough: Install Windows PE to CD, USB Flash Drive, or USB Hard Drive or How to Switch from BIOS-Compatibility Mode to UEFI Mode.

  1. Click Start , and type deployment . Right-click Deployment and Imaging Tools Environment and then select Run as administrator .

  2. In the Deployment Tools and Imaging Environment , copy the Windows PE files for the PCs you want to boot.

    The 64-bit version of Windows PE can boot 64-bit UEFI and 64-bit BIOS PCs:

    copype amd64 C:\WinPE_amd64
    

    The 32-bit version of Windows PE can boot 32-bit BIOS and 64-bit BIOS PCs:

    copype x86 C:\WinPE_x86
    
  1. Click Start , and type deployment . Right-click Deployment and Imaging Tools Environment and then select Run as administrator .

  2. From the Deployment and Imaging Tools Environment, create a working directory for the Windows PE files.

    copype amd64 C:\WinPE_amd64
    
  1. Use DiskPart to prepare the partitions.

    noteNote
    The following commands prepare a USB hard drive that can boot on either a BIOS-based or UEFI-based PC.

    On UEFI-based PCs, Windows PE requires a boot partition formatted using the FAT32 file format, which only supports file sizes up to 4GB. We recommend creating a separate partition on the drive formatted using NTFS so that you can store Windows images and other large files.

    diskpart
    list disk
    select 
        <disk number>
      
    clean
    rem === Create the Windows PE partition. ===
    create partition primary size=2000
    format quick fs=fat32 label="Windows PE"
    assign letter=P
    active
    rem === Create a data partition. ===
    create partition primary
    format fs=ntfs quick label="Other files"
    assign letter=O
    list vol
    exit
    

    where <disk number> is the listed number of the external USB hard drive.

  2. Apply the Windows PE image to the hard drive.

    dism /Apply-Image /ImageFile:"C:\WinPE_amd64\media\sources\boot.wim" /Index:1 /ApplyDir:P:\
    
  3. Set up the boot files.

    BCDboot P:\Windows /s P: /f ALL
    
    noteNote
    Ignore any warning messages that say "Warning: Resume application not found."

  1. Create a virtual hard drive file (.vhd or .vhdx), attach it to your list of drives, and set it up to be an active partition, by using the Diskpart tool.

    diskpart
    create vdisk file="C:\WinPE.vhdx" maximum=1000
    select vdisk file="C:\WinPE.vhdx"
    attach vdisk
    create partition primary
    assign letter=V
    format fs=ntfs quick label="Windows PE"
    active
    exit
    
  2. Apply the Windows PE image to the virtual hard drive.

    dism /Apply-Image /ImageFile:"C:\WinPE_amd64\media\sources\boot.wim" /Index:1 /ApplyDir:V:\
    
  3. Set up the boot files.

    BCDboot V:\Windows /s V: /f ALL
    
    noteNote
    Ignore any warning messages that say "Warning: Resume application not found."

  4. Detach the drive from your list of drives.

    diskpart
    select vdisk file="C:\WinPE.vhdx"
    detach vdisk
    exit
    
    
  5. Attach the virtual hard drive to a Hyper-V session and boot it.

  1. Plug the device (USB flash drive, DVD, CD, or external USB hard drive) into a new PC.

  2. Turn on the computer and open the boot-device selection menu for the PC. Typically this requires pressing a hardware button or a key, such as the Esc key.

  3. Select the option that boots the USB flash drive.

    noteNote
    For UEFI-based PCs, you may need to find an option to manually select the UEFI boot files, for example, USBDrive01\EFI\BOOT\BOOTX64.EFI.

    Windows PE starts automatically. After the command window appears, the wpeinit command runs automatically. This may take a few minutes.

  • Boot in UEFI mode : To prevent Windows Setup or Windows PE from booting in BIOS mode, remove the bootmgr file on the root of the media.

  • Boot in BIOS mode : To prevent Windows Setup or Windows PE from booting in UEFI mode, remove the efi folder on the root of the media.

  • If the PC does not boot, try the following steps in sequence, and try to boot the PC after each step:

    1. For USB drives, try inserting the USB flash drive into a different USB port. Avoid using USB hubs or cables, because they may not be detected during the boot sequence. Avoid USB 3.0 ports if the firmware does not contain native support for USB 3.0.

    2. For USB flash drives, use Diskpart to clean the USB flash drive, and then reinstall Windows PE. This can help remove extra boot partitions or other boot software.

      diskpart 
      list disk 
      select disk 2 
          (where 2 is the USB flash drive)
        
      clean
      create partition primary
      format quick fs=fat32 label="Windows PE"
      assign letter="F"
      exit
      
      MakeWinPEMedia /UFD C:\winpe_amd64 F:
      
    3. If your PC requires drivers to boot, such as storage drivers or video drivers, add them to the Windows PE image. For more information, see Walkthrough: Create a Custom Windows PE Image.

    4. Update the firmware of the PC to the latest version.

See Also

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.