Tuesday, 24 March 2009

Win PE 2 boot from USB Key

Windows PE is a great tool for any IT Administrator.
Not only can it give you access to Windows Deployment or SCCM servers but it can boot up a computer that has crashed and allow for troubleshooting and file recovery and thats just the begining.

Win PE is usually executed and loaded over the network with the help of PXE ("Pixie") Boot but what if you for some reason can't get a PXE connection to your server?
Well in these cases you have two options, either use a DVD or USB Key to boot the machine and get the same level (if so desired) of access that you would if you were using PXE.

Since a USB is faster and better in every way, let's stick with that for now and please bear in mind that to complete these steps you will at the very least need to have a Windows Vista source (CD\DVD) on hand and WAIK installed.

Any Text like this:
"Type this command"
is meant to be typed.

Part 1:
Preparing USB Key for use

Start the Command Line, in Vista this needs to be done as an administrator.

  • Press Windows button + R
  • "cmd"
  • Press Windows button
  • "cmd"
  • Locate CMD icon at the top of the list and right click.
  • Chosse "Run as Administrator"
  • Confirm ACL (if any)
You now have the Command line (black and white console) open and you are ready to start Diskpart.
  • "diskpart"
  • "List Disk" 
  • Locate the number assosciated with your USB (for ex: 1)
  • "Sel disk 1" (Replace with your number) 

    (Make sure you do not select the wrong number or the next step might clean your hard drive and not the USB Key)

    WARNING: The next step destroys anything stored on the USB Key!

  • "Clean" 
  • "create par primary" 
  • "sel par 1" 
  • "act" 
  • "format fs=fat32" 
  • "Assign" 
  • "Exit" 
You can close the command line if you wish at this point.

Part 2:
Getting Win PE 2 on the key.

Okay! We've done the scary part, Easy huh? ;)
Unless you selected your computers HDD in the step above and cleaned it instead of your USB key, you should be ready for the next part.

So let's fire up the WinPE Console by going to 

Start->All Prog->Microsoft Windows AIK (WAIK) -> Windows PE Tools Command Prompt

What we are going to do now is to copy the files Win PE needs, this is a fairly automated thing but you need to tell it what kind of Architecture to use (X86 or 64) as well as where to place the files. (A folder that is not created is best)

So in the PE Tools console window type in the following but alter as needed:

  • "copycmd.cmd x86 c:\WinPEx86" 
  • "copycmd.cmd amd64 c:\WinPEamd64" 
  • "copycmd.cmd ia64 c:\WinPEia64" 
This will create the directory and copy the files as needed, you can add files to the C:\WinpeXX system when it is finished.

For example if you wish to add more tools (like imagex) then copy them into the \iso subdirectory
If you wish to tweak Win PE further then you can do this now before you copy the files over the USB key you prepared earlier.

Final Part:
Copy Windows PE 2 to USB Key.

The final command to issue now in the WinPE Console (command prompt) is the xcopy command that copies everything onto the USB Key that has the bootable partition on it.

This example presumes that:
  1. You copied into the c:\winpex86 folder
  2. That your USB is assigned the letter q:
  • "xcopy c:\winPEx86\iso\*.* /s /e /f q:\"
Now all you need to do is remove the USB and try it! 
By the way, you might need to change the BIOS settings so that your USB is placed above the hard drive in the boot order.

1 comment:

  1. Thanks Alex,

    I Gone used and try in my next project on System Center Configuration Manager 2012