Booting Windows PE from a USB Drive Walkthrough
Άρθρο από Lefteris Karafilis Mon, 01/11/2010 - 13:15
Windows preinstallation environment (windows PE) is a bootable tool that provides a minimal set of operating system features for installation, troubleshooting, and recovery. In this post I am going to explain how you can setup a windows PE environment to boot from a USB drive in 5 simple steps:
- Download and install windows AIK from Microsoft
- Prepare WinPE image
- Add drivers to your WinPE image
- Setup USB drive to be able to boot
- Copy the files to USB drive
Download and install windows AIK from Microsoft
Windows AIK is a set of tools and documentation that support the configuration and deployment of Windows® operating systems. You can download WAIK from Microsoft download center http://www.microsoft.com/download (search term WAIK) and install it to your computer for free.
After WAIK installation a set of folders will be created by default under \program files\Windows AIK that contain the appropriate files and tools to create and manage WinPE images, unattended installation files, a volume activation management tool, SDKs and some sample files.
Prepare WinPE image
After installing WAIK you are ready to prepare your WinPE image. In order to do so you have to go to \program files\Windows AIK\Tools\PETools (default location) and copy your candidate WinPE image files to a temporary location. To do that you issue the command copype.cmd <x86|amd64|ia64> <temporary location> for example copype.cmd x86 c:\temp\WinPEx86 (x86 is the 32bit architecture).
As a final step you need to copy and rename the base image file c:\temp\WinPEx86\winpe.wim (based on the above example) to the ISO\Sources subdirectory of this temporary folder as boot.wim. To do this, issue the command copy c:\temp\WinPEx86\winpe.wim c:\temp\WinPEx86\ISO\sources\boot.wim.
Add drivers to your WinPE image (optional)
In case you need to preload any drivers to your WinPE image or add optional components you have to follow some additional steps outlined below. In case you don't you skip to the next section.
First step is to create a directory, for example c:\temp\WinPEx86\Drivers, and download your drivers in this location. Note that the drivers must be fully extracted with their .inf files exposed in order to be added to the WinPE image.
Second step is to mount the base WinPE image copied previously. To do that execute "c:\Program Files\Windows AIK\Tools\Servicing\Dism.exe" /mount-Wim /WimFile:c:\temp\WinPEx86\ISO\Sources\boot.wim /index:1 /MountDir:c:\temp\WinPEx86\Mount.
Third step is to add the downloaded drivers to the Image by executing "c:\Program Files\Windows AIK\Tools\Servicing\Dism.exe" /image:c:\temp\WinPEx86\Mount /Add-Driver /Driver:c:\temp\WinPEx86\drivers /recurse /ForceUnsigned. By including the /recurse switch you tell to the command to recurse the drivers' subfolders for valid .inf drivers and by including the /ForceUnsigned you tell the command to ignore driver signing requirements.
Fourth step is to unmount and commit the WinPE image by executing "c:\Program Files\Windows AIK\Tools\Servicing\Dism.exe" /unmount-wim /MountDir:c:\temp\WinPEx86\Mount /commit.
Note, that you can add additional files and folders to your custom WinPE image simply by copying your files to the c:\temp\WinPEx86\Mount. These files will be loaded to the RAM drive after WinPE boot (c:\). If you don't want these files to be loaded to the RAM Drive (consumes RAM) and be available to the USB drive instead, just copy them to a structure under c:\temp\WinPEx86\ISO folder.
Setup USB drive to be able to boot
In this step you need to use the diskpart utility (windows Vista and above O/S) to create a bootable partition to your usb drive as outlined below.
Use Diskpart to identify the disk ID of your usb drive:
diskpart
list disk
After you have identified your usb disk ID (based on size), you can wipe your partition information, create a new one and mark it as active.
select disk 1
clean
create partition primary
select partition 1
active
format quick fs=ntfs
assign
exit
Copy the files to USB drive
Final step is to copy the files included under your ISO subfolder to your USB drive: xcopy c:\temp\WinPEx86\ISO\*.* f:\ /E (where f:\ is your USB drive).
Note that you may need to alter your PC's BIOS settings in order to be able to boot from USB drives and of course it needs to be USB boot capable.
Final Thoughts
In case you want to load drivers after WinPE boot you can use the drvload.exe command (drvload.exe inf_path).
To manipulate winPE environment you need to use the wpeutil <command> <argument> command. Most usable commands of wpeutil: EnableFirewall, DisableFirewall, Reboot, ShutDown, Initializenetwork.
没有评论:
发表评论