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.
Note |
|---|
| 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.
-
Get the Windows® Assessment and Deployment Kit (Windows ADK) Technical Reference, including the Windows PE feature.
-
Click Start , and type deployment . Right-click Deployment and Imaging Tools Environment and then select Run as administrator .
-
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
-
Click Start , and type deployment . Right-click Deployment and Imaging Tools Environment and then select Run as administrator .
-
From the Deployment and Imaging Tools Environment, create a working directory for the Windows PE files.
copype amd64 C:\WinPE_amd64
-
At this point, you can customize Windows PE. Typically this is not required, as Windows PE includes many generic devices drivers, features, and applications, and includes language files for the language you selected when installing the Windows® Assessment and Deployment Kit (Windows ADK) Technical Reference. For more information, see Walkthrough: Create a Custom Windows PE Image.
-
Use DiskPart to prepare the partitions.
Note 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 exitwhere <disk number> is the listed number of the external USB hard drive.
-
Apply the Windows PE image to the hard drive.
dism /Apply-Image /ImageFile:"C:\WinPE_amd64\media\sources\boot.wim" /Index:1 /ApplyDir:P:\
-
Set up the boot files.
BCDboot P:\Windows /s P: /f ALL
Note Ignore any warning messages that say "Warning: Resume application not found."
-
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
-
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:\
-
Set up the boot files.
BCDboot V:\Windows /s V: /f ALL
Note Ignore any warning messages that say "Warning: Resume application not found." -
Detach the drive from your list of drives.
diskpart select vdisk file="C:\WinPE.vhdx" detach vdisk exit
-
Attach the virtual hard drive to a Hyper-V session and boot it.
-
Plug the device (USB flash drive, DVD, CD, or external USB hard drive) into a new PC.
-
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.
-
Select the option that boots the USB flash drive.
Note 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:
-
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.
-
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: -
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.
-
Update the firmware of the PC to the latest version.
-
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.
See Also
