I recently had need to create a bootable Windows XP system on a 1 GB USB flash drive. Seemed like it would be pretty simple to me...turns out it isn't. Microsoft likes to mess with the USB driver on boot up which isn't a good thing when you are booting from a USB device.
After looking on the Internet for quite a while, I found a tutorial that helped me accomplish what I needed. The original tutorial I followed is at (http://www.tech-archive.net/Archive/WinXP/microsoft.public.windowsxp.embedded/2005-10/msg00332.html). While I am very thankful to have found this, I thought I could possibly write a more succinct tutorial, and that's what follows here.
Final note - this most likely isn't the best way to do this, or the simplest. It worked for me and might be useful for others, so I think it is worth posting here. I did find another tutorial that might be a more correct way to do this at (http://www.ngine.de/article/id/8). I haven't tried it though, so YMMV.
Initial preparation
- Make the intended target USB flash drive installable. See the following section for help with this.
- Boot the newly installed XP install from the hard drive.
- Disable the pagefile. This is done by opening the system control panel, choosing the advanced tab, clicking the top “settings” button, changing to the advanced tab, clicking the “change” button, and then choosing the “No paging file” option and clicking “Set”.
- Insert the intended target USB flash drive, and allow it to be fully detected by XP.
Registry modifications
- Backup the HKLM\System registry key before starting (just to be safe).
- Import or make the following modifications to 6 registry keys:
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\usbehci]
"Start"=dword:00000000
"Group"="Boot Bus Extender"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\usbhub]
"Start"=dword:00000000
"Group"="Boot Bus Extender"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\USBSTOR]
"Start"=dword:00000000
"Group"="Boot Bus Extender"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\usbuhci]
"Start"=dword:00000000
"Group"="Boot Bus Extender"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba
se\usb#root_hub]
"Service"="usbhub"
"ClassGUID"="{36FC9E60-C465-11CF-8056-444553540000}"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba
se\usb#root_hub20]
"ClassGUID"="{36FC9E60-C465-11CF-8056-444553540000}"
"Service"="usbhub"
- Create 2 registry keys based on the specific USB flash drive that will be used. Following are 2 examples – the key names will have to be customized for the Pid/Vid and hardware ID of the specific target flash device. The ClassGUID and Service keys should be entered verbatim.
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba
se\USB#Vid_1058&Pid_0300]
"ClassGUID"="{36FC9E60-C465-11CF-8056-444553540000}"
"Service"="usbstor"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba
se\USBSTOR#DiskWDC_____WD1600BB-00FTA0_15.0]
"ClassGUID"="{4D36E967-E325-11CE-BFC1-08002BE10318}"
"Service"="disk"
The Pid/Vid for the target USB flash device can be found in HKLM\System\ControlSet001\Enum\USB. Open the subkey for each item until you find the DriverDesc of USB Mass Storage Device, a Service of USBSTOR, and a LocationInformation that matches your specific flash drive.
The hardware ID can be found in HKLM\System\ControlSet001\Enum\USBSTOR. In this example the chosen key would look like:
Disk&Ven_WDC&Produ_WD1600BB-00FTA0&Rev_15.0
Again, find the device that matches your specific flash drive.
The Hardware ID is created as Disk(8)(16)(4) where the values are:
8 digits (in this example WDC_____ ) as the vendor of device
16 digits (in this example WD1600BB-00FTA0_ ) for the device type and
4 digits (in this example 15.0 ) for a version number.
- Delete key HKLM\System\MountedDevices.
- Delete string value HKLM\System\Setup\SystemPartition
- Change HKLM\System\ControlSet001\Services\USBSTOR\Start from 3 to 0.
(THIS STEP IS IMPORTANT – YOU WILL GET A BLUE SCREEN IF THIS ISN’T CHANGED) - Right-click on the HKLM\System\ControlSet001\Services\USBSTOR key and change the permissions to deny full control to the “System” group.
Preparing the target flash device
This step likely has to be done from another PC, or while booted to a different drive. Otherwise, some files end up being in use.
- Copy all files and folders from the completed hard drive to the USB target flash drive. Do not copy the recycled or system volume information folders.
- Delete \windows\system32\config\*.sav, *.log, and *.evt.
Adding support for additional USB flash devices
To add additional USB flash drive support to the original hard drive image, follow these steps:
- Right-click on the HKLM\System\ControlSet001\Services\USBSTOR key and remove the deny full control to the “System” group attributes that were set in step #7 in the registry section above.
- Insert the additional targeted USB flash drive, and allow it to be fully detected by XP as in step #4 of the initial preparation section above.
- Follow steps 3-7 of the registry modification section above.
EDIT: It turns out there is more to this than what I have posted. This will be limited to a specific flash drive, not just a certain PID_VID. The image will need to be recreated with each additional flash part that will be used added to the registry for this to not blue screen when moved to a different flash drive. Suck.