Hardware

Illustrated walk-through: Creating a bootable USB flash drive for Windows XP

A bootable flash drive can come in handy--but trying to create one might have you pulling out your hair. Windows expert Greg Shultz shares the method he followed, from configuring the BIOS to allow the USB port to act as a bootable device to creating a bootable image of Windows XP using the free PE Builder software (and a pair of Windows Server 2003 SP1 files) to formatting and copying the image onto a UFD.

This article is also available as a PDF download and a gallery.

The ability to boot Windows XP from a USB Flash Drive (UFD) offers endless possibilities. For example, you might make an easy-to-use troubleshooting tool for booting and analyzing seemingly dead PCs. Or you could transport your favorite applications back and forth from home to work without having to install them on both PCs.

However, before you can create a bootable UFD, you must clear a few hurdles. You saw that one coming didn't you?

The first hurdle is having a PC in which the BIOS will allow you to configure the USB port to act as a bootable device. The second hurdle is having a UFD that that will work as a bootable device and that's large enough and fast enough to boot an operating system such as Windows XP. The third hurdle is finding a way to condense and install Windows XP on a UFD.

If you have a PC that was manufactured in the last several years, chances are that its BIOS will allow you to configure the USB port to act as a bootable device. If you have a good quality UFD that's at least 512 KB and that was manufactured in the last couple of years, you've probably cleared the second hurdle. And once you've cleared those first two hurdles, the third one is a piece of cake. All you have to do is download and run some free software to create the bootable UFD.

I'll start by showing you how to determine whether your PC's BIOS will support booting from USB and explain how to configure it to do so. Then, I'll show you how to download and use the free software to create a bootable UFD running Windows XP Professional.

The UFD hurdle

You probably noticed that I didn't mention how to determine if your UFD would support being configured as a bootable device, except that it must be a good quality unit of recent manufacture. Well, I've discovered that when it comes to the actual UFD, you'll just have to try it and see what happens. As long as you have a PC with a BIOS that will allow you to configure the USB port to act as a bootable device and you have configured the installation correctly, it should work. If it doesn't, you probably have a UFD that can't boot.

I tested three UFDs on two new computers and had mixed success. First, I attempted to use a 128 MB PNY Attache but received an error message that said "Invalid or damaged Bootable partition" on both PCs. Next, I tried a 1GB Gateway UFD and it worked on both PCs. Then, I tried a 256 MB Lexar JumpDrive Pro and it worked on only one of the PCs. You can find lists of UFD brands that others have had success with on the Internet.

Checking the BIOS

Not every new BIOS will allow you to configure the USB port to act as a bootable device. And some that do allow it don't make it easy. On one of my example systems, it was a no-brainer. On the other, the UFD had to be connected to the USB port before it was apparent that I could configure it as a bootable device. Let's take a closer look.

On the test system with a PhoenixBIOS version 62.04, I accessed the BIOS, went to the boot screen, and found that USB Storage Stick was one of the options. I then moved it to the top of the list, as shown in Figure A, thus making it the first device to check during the boot sequence. (This particular BIOS also allowed me to press the [F10] key during the boot sequence and select any one of the available bootable devices, so it really wasn't necessary to move it to the top.)

Figure A

The settings on the Boot Screen of the PhoenixBIOS made it a no-brainer to select the device.

On the test system with an AMI BIOS version 2.59, I accessed the BIOS, went to the Boot Sequence screen, and didn't find a USB boot option, as shown in Figure B. I then went one step further and checked the Hard Disk Drives screen and still didn't find a USB boot option, as shown in Figure C.

Figure B

A USB boot option didn't appear on the Boot Sequence screen.

Figure C

The Hard Disk Drives screen only showed the SATA hard disk.

I then plugged a UFD into the USB port, booted up the system, and accessed the BIOS. When I checked the Hard Disk Drives screen, the UFD appeared in the list and I could select it as the first drive (Figure D).

Figure D

With the UFD plugged into the USB port, I could configure the UFD as a bootable device.

When I returned to the Boot Sequence screen, the UFD was indeed set as the first bootable device (Figure E).

Figure E

As the Boot Sequence screen indicates, the UFD was set to be the first bootable device.

Rounding up the software

To condense and install Windows XP on a UFD, you'll need a program called PE Builder by Bart Lagerweij. You'll also need two files from the Windows Server 2003 Service Pack 1. And of course, you need to have a Windows XP Professional CD.

You can download PE Builder from Bart's Web site. At the time of this writing, the most current version of PE Builder was 3.1.10a.

You can download Windows Server 2003 SP1 by following the link in the Knowledge Base article "How to obtain the latest service pack for Windows Server 2003." Be sure to get the 32-bit version!

Keep in mind that at 329 MB, Windows Server 2003 SP1 will take some time to download. And although you need just two small files, the only way to get them is to download the entire package.


Warning

Do not run the Windows Server 2003 SP1 executable file! Doing so will completely corrupt Windows XP. We will use a set of special commands to extract the two files and then delete the rest of the package.


Preparing the software

Installing PE Builder is quick and easy. Just run the installation program and follow the onscreen instructions. To make things simpler, I installed the program in the root directory in a folder called PEBUILDER3110a.

Once PE Builder is installed, you'll need to create a folder in C:\PEBUILDER3110a called SRSP1, as shown in Figure F. This is the folder in which PE Builder will look for the extracted Windows Server 2003 SP1 files.

Figure F

Once PE Builder is installed, you'll need to create folder called SRSP1 in C:\PEBUILDER3110a.

Now, you can begin extracting the two needed files from Windows Server 2003 SP1. When you download the Windows Server 2003 SP1, the executable file will have a long name: WindowsServer2003-KB889101-SP1-ENU.exe. To save on typing, you can rename the file to something shorter, such as WS-SP1.exe.

To begin, open a Command Prompt window and use the CD command to change to the folder in which you downloaded the Windows Server 2003 SP1 executable file. I downloaded the file to a folder called Downloads. Now, to extract the files contained in SP1, type the command

WS-SP1.exe -x

You'll immediately see a dialog box that prompts you to select a folder in which to extract the files and can type the name of the same folder, as shown in Figure G. Click OK to proceed with the extraction procedure. When the procedure is complete, just leave the Command Prompt window open.

Figure G

You can extract the files into the same folder containing the Windows Server 2003 SP1 executable file

The extraction procedure will create a subdirectory called i386 and extract all the Windows Server 2003 SP1 files there. Use the CD command to change to the i386 folder and then copy the setupldr.bin file to the SRSP1 folder with the command:

copy setupldr.bin c:\pebuilder3110a\srsp1

Expand the ramdisk.sy_ file to the SRSP1 folder with the command:

expand -r ramdisk.sy_ c:\pebuilder3110a\srsp1

These three steps are illustrated in Figure H.

Figure H

You'll copy and expand the two necessary files to the SRSP1 folder.

Now, using Windows Explorer, verify that the two necessary files are in the SRSP1 folder, as shown in Figure I. Once you do so, you can delete all the Windows Server 2003 SP1 files.

Figure I

You'll want to verify that the setupldr.bin and ramdisk.sys files are in the SRSP1 folder.

Running PE Builder

Now that you've extracted the necessary files from the Windows Server 2003 SP1 package, you're ready to use PE Builder to create a compressed version of Windows XP. To begin, place your Windows XP Professional CD into the drive and hold down the [Shift] key to prevent Autostart from launching the CD. Then, launch PE Builder.

In the Source field on the main PE Builder screen, simply type the letter of drive in which you put the Windows XP Professional CD, as shown in Figure J. Make sure that the Output box contains BartPE and that the None option is selected in the Media Output panel. Then, click the Build button.

Figure J

Fill in the Source field on the main PE Builder screen.

As PE Builder compresses Windows XP Professional into a bootable image, you'll see a detailed progress dialog box. When the operation is complete, as shown in Figure K, click the Close button.

Figure K

PE Builder displays a detailed progress report.

Preparing the UFD to boot Windows XP

At this point, you're ready to format and copy the Windows XP Professional bootable image to the UFD with the BartPE USB Installer. To do so, open a Command Prompt window and use the CD command to change to the pebuilder3110a folder. Then, insert your UFD into a USB port and take note of the drive letter that it is assigned. On my example system, the UFD was assigned drive E.

Now, type the command

pe2usb -f e:

You'll then be prompted to confirm this part of the operation, as shown in Figure L. While the operation is underway, you'll see progress indicators.

Figure L

You'll be prompted to confirm that you want to format your UFD.

Once the BartPE USB Installer finishes its job, you'll be prompted press any key to exit the program. Now you can use your UFD to boot your computer into the BartPE interface for Windows XP, as shown in Figure M.

Figure M

The BartPE interface provides you with a pared down version of Windows XP.

You can find a list of specialized applications on Bart's Web site, which you can install on your UFD as Plugins. For example, you can find such things as Firefox or McAfee command-line virus scanner.

Conclusion

Booting Windows XP from a UFD requires that your PC's BIOS support booting from USB and that you have a UFD that can be formatted as a bootable device. If you can meet these two requirements, all you need is PE Builder, a couple of files from the Windows Server 2003 Service Pack 1, and a little effort to configure a UFD to boot the BartPE interface to Windows XP.

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

137 comments
vivame
vivame

I have followed the instructions to the letter. I installed this on a Flash drive (5 different drives) and 4 different hard drives. It says "Loading system please wait...." for over 30 minutes then the computer turns off. Waste of time. Do not bother.

de.doughboy
de.doughboy

I've been reading a few articles about using different formats for the flash drive. it doesn't say how bart-pe2usb formats the drive (NTFS/DOS?) I've found that by using NTFS i get faster boot off the flash drive, but some virtual-HDs won't boot over USB unless they are formated in DOS-FAT32. You can try using DISKPART to set the FS=NTFS. "FORMAT FS=NTFS QUICK" Then you will have to also copy the windows sector boot.ini and boot.ldr to the flash drive using XP tool "Bootsect f:\windows /s F:" where F:\ is the flash drive. For detailed instructions on how to do this with win7/win8 see September issue of CHIP-Magazine Malaysia, or download their article "Windows8 On a USB Flash Drive." To see the complete CHIP article click here...http://goo.gl/CwmA1

colin_99
colin_99

Great instructions - very clear. Problem: When I boot the USB stick, it took over 45 minutes for the Flash Disk to initialize -- and eventually all I saw was a PLEASE Wait on the bottom of the screen - 1/2 hour after that, I gave up. Same on a different system. I will try a different, slightly more modern USB stick. Thanks!

saurabhp007
saurabhp007

hi i followed all the steps as they are mentioned in the above procedure. all worked well . i didnt have any error messages or warnings in the pebuilder process was completed without any problems. but when i try to boot from my pd i get the following message : ntldr is corrupt. the system cannot boot

saurabhp007
saurabhp007

hi i would like to know the use of the srsp1 folder that we created.

Mzaknight
Mzaknight

I followed the mentioned steps successfully, and when i started the setup process, the first message appeared at initializing (file amdbusdr.sys is missing file not found), kindly note that there was 2 errors found by PE builder and 128 warnings!!! please advice Thanks for your precious help.

Bob Miller
Bob Miller

OK, for all the folks interested....it takes about 24 hours to format a Seagate GoFlex Desk 2TB external HDD. If you're doing it from a Win7 portable you should change your power settings to allow it complete the formatting without supervison by not allowing your PC to go to sleep while it's unattended. Now I get to see if Recuva works. BTW, the reason I used such a large external HDD is that I wanted to recover as much data and settings as I could from my damaged 500GB internal HDD and a flash stick wasn't gonna handle all that much data. Another thing to mention is that now when you're confronted with a DOS command line is that you have to learn how to use quotation marks around paths specified. All in all it's been a wild ride and I ain't done yet.

Bob Miller
Bob Miller

I had already formatted my Seagate GoFlex 2TB external HDD before using the command line to enter pe2usb -f e:....after about 30 minutes I'm seeing a 1% progress. Am I in for a long night to install a FAT format instead of the NTFS that was probably there?

Fernando149
Fernando149

Done the steps on three pcs last one on xp pro, stuck when formating the UFD ( there was a error script aborted) I using 32 gb flash card. what am I doing wrong? help!

FeCross
FeCross

followed all the directions when i got to the pebuild I recieved errors and warnings forcing my bootable flash drive creation to be aborted what the heck is going on??

netadmin
netadmin

So why did I extract those files again??

roydiain
roydiain

This whole precess is not 100% workable, as I used a lots of old flash drive (HP, scandisk), and successfully installed BARTPE on these UFD. But recently I used latest UFD (KINGSTON) but I am not able to install Bootable bartpe on this UFD. I dont know whats the difference between these UFD's but it depends upon the type of UFD you are using.

terryjohnson
terryjohnson

How about Windows 7, A bootable Flash Drive. terryjohnson@pacbell.net

sweetcheers1234
sweetcheers1234

Just download a freeware WinToFlash and the program will do the trick for you for free for any system and any drive flash, CD, floppy. And the system doesn't even have to be legal :) All you need is just CD with windows and it doesn't even have to be bootable CD. just windows system

ergrg
ergrg

its vgoooooooooooooooooooooooooooood

n_montazer135
n_montazer135

it was very useful but i got this message during making bootable UFD: mkisofs: Permission denied. cannot open 'C:\pebuilder3110a\bartpe/i386/system32/ setuphiv' Error: mkisofs failed! and the process aborted

obeymlambo
obeymlambo

hello your tutoral is just superb. being a rookie that i am icoud'nt finish expanding the ram disk as you instructed,instead the following massage appears-can't open input file :c pebuider3110a\srsp1- how do irectify this? please help my email is obeymlambo@yahoo.com regards obey

goldeninvestor
goldeninvestor

Hey guys I need help I'm trying to abstract the file from windows server 2003 sp1 and when I type the command WS-SP1.exe -x I get an error that says C:\Documents and Settings\Administrator\WS-SP1.exe is not a valid Win32 application. Any help on extracting the file and what to do?

ProfQuatermass
ProfQuatermass

The problem with UFDs is that if you format them on a Windows machine the OS doesn't put down a boot partition. This was done to save a few Kilobytes. So format the stick using a Linux machine to FAT32 and you're laughing.

Petris1
Petris1

command prompt? windows or is there one in pebuilders3110a?

rbngan
rbngan

During my project to create a bootable USB VMWare ESXi server stick I ran into an issue with the computer I was using. The bios did not have the option to boot to USB. I found a program on a site that allows you to create a floppy disk that boots the computer to a boot menu that includes the USB option. I was even able to create the disk to auto boot to the USB stick. Work Great.

jediagent
jediagent

Hey guys, I have the Windows XP Pro CD but when trying to create the Build using PE Builder, I get the error: "Source files wrong version. File version "D:\i386\ntdll.dll is 5.1.2600.0 should be 5.1.2600.1045 or higher. You must use Windows XP Service Pack 1 or Server 2003 version of windows!" I've done everything as stated up to this point. Any idea how to get around this problem?

Padremark
Padremark

I get an error, Invalid Source path (cannot find file: d:\i386\setupldr.bin) D: is where I loaded my windows cd. Not sure what I did wrong?

gsinkinson@att.net
gsinkinson@att.net

When I put my Win XP Pro install CD in the drive and tried to run PE Builder, I got a message that my version was 5.1.2600.0 and that I needed 5.1.2600.1045 or later. Can I use the XP sp3 cd as a valid source?

jonlee87
jonlee87

I am trying to reinstall Windows XP on a netbook that recently had Ubuntu installed on it. However, I do not have a bootable CD-Rom drive and therefore I needed a bootable USB in order to install Windows XP. I have tried this method over a hundred times already. This method is close to the working one. If using Windows XP SP2, in PE Builder, you need to enable a plugin "RpcSS needs to launch DComLaunch Service First ? SP2 only." Only then will the USB be bootable. Then you must also copy the i386 folder from the Windows CD to your flash drive to install it. For full instructions, view: http://www.vandomburg.net/installing-windows-xp-from-usb/

garysnewjob
garysnewjob

While Bart PE is good The Ultimate Boot CD is better. http://www.ubcd4win.com/ It's a fully configured version of Bart PE also downloadable for free. You get a huge assortment of Bart PE Addins ready to use. You just select the ones you want and Build your Image. There are more Addins available, but these are more than most folks will ever use.

bigWillie
bigWillie

what files should be on the USB drive when completed? I went through all the steps without any problems, but when I tried to boot from the USB stick I get 'Missing Operating System'.

piyush.ml20
piyush.ml20

it doesn't worked 4 me. i have an iball 2 gb pen drive n using amd athlon x2 dual core processor 5200+ with asus m2npv-vm mobo.it supports usb booting.i m gettn err "remove disks or other media".

abdulrahmanonine
abdulrahmanonine

ok this is little out of topic. i tried this for putting xp recovery disk to usb & make it bootable but its FAILED. My Netbook NOT notebook/laptop, Toshiba NB100 12M can boot via usb, and i have 2 file from wserver2003, and also pebuilder3110a, kingston 2GB. while start building it is asking "cannot find file layout.inf" thanks a million

happydaysgirlie
happydaysgirlie

Great Stuff thank you!!!!! I am a Newbie (a verrryyy slow to learn newbie) and even I understood this. Thanks heaps

scaphalia
scaphalia

I wand to Make a Flash Drive Bootable. but boot with dos mode. please help me

cuatromarcas
cuatromarcas

Excellent and precise information. Was poss to build a 4Gb FSU bootable and then install Acronis Home 2009 autostart

mage_night
mage_night

the command prompt confused me, possibly because i'm on vista. is their any chance you could link me to/make a guide for how to do this while on vista? i wanna get rid of vista soo bad.

elmer011988
elmer011988

Expand the ramdisk.sy_ file to the SRSP1 folder with the command: expand -r ramdisk.sy_ c:\pebuilder3110a\srsp1 iT GIVES ME THIS ERROR WHY??? Can`t open input file: ramdisk.sy_

crappymail
crappymail

INF-file txtsetup.sif is incorrect or missing. status: 18 help me

g.langley1
g.langley1

Have a prebuilder 313 on a CD. Can I create the PE2USB folder from 313? I need it to make the USB drive.

glwhite
glwhite

I keep getting these errors when trying to re-install XP: Missing lass.exe, stop:0X00000007, FS_rec.sys-address, F978451 DAT 3b7d8361 dates stamp Any suggestions? funtym2008@yahoo.com

albert-dfw
albert-dfw

BillD, This article is all about creating an XP bootable. Would you explain why you are referencing files on Windows Server 2003? Also, is this XP bootable good for only Professional, or will other versions work as well, given the caveats you've already mentioned.

elmidwill
elmidwill

I just cannot get this thing to work. I've tried 3 or so UFD two system which both support UFD booting. The only thing is I am running windows Vista, but I don't think that should make a difference, or should it? I have 4 files on the UFD: bartpe.iso, ntdetect.com, nldr and winnt.sif. Any suggestions?

dixit_sanjeev
dixit_sanjeev

After creating a boot image on UFD and trying to boot the laptop using the UFD; system tries to create a ramdrive. After creating a virtual drive, when attempting to load BartPE I am getting error; File \I386\system32\ntoskrnl.exe could not be loaded. Error code 14, setup cannot continue? Any guesses what could be wrong?

fuller.artful
fuller.artful

In my case, I want a bootable Windows Server 2003 flash drive. I'm going to follow your steps and see if I can make it work. Has anyone tried this? Thanks

de.doughboy
de.doughboy

I've been building custom XP boot platforms for sometime now. I read a similar article to this back in 2006 that says some USB latency times can be as much as 30-sec this will cause the CPU to lower the priority on the device causing it to appear to be hung. Other Issues you might want to look into are too many services trying to startup during the boot process. The CHIP magazine (June-2006) edition says to first turn off services that you won't need on your bo0table USB recovery disk. This includes IIS services in XP-pro. If there are apps and drivers your systems need during boot up such as special device drivers (F6) then you can preload the image with them automaticly using Nlite (http://www.nliteos.com) you will have to have frameworks2 working first before you install it. So If your trying to save a dying system I'd advise another work around. MS also offer an XP imaging recovery tool (API-V2) that also includes your original USB driver in the build. I've not tried the tool yet because I don't have a paid MSDN account, but you can get kb-932716 here http://goo.gl/zgAcQ

RMossberg
RMossberg

I had the same problem and also got this message at 50.06% complete: "mkisofs: Permission denied. cannot open 'C:\pebuilder3110a\bartpe/i386/system32/setuphiv' Error: mkisofs failed." At which point, the program aborts and fails to complete.

Bob Miller
Bob Miller

Exact same problem for me when I use a 16GB flash stick. Tried to manually copy setuphiv from the correct path and I was denied permission because the error message said that setuphiv was in use by System. I'm to the point where I'm ready to follow another tack by pulling the internal HDD from this Win7 portable and loading XP Pro SP3 onto my external GoFlex 2TB. Desperate measures for desperate times, but I'm wondering if I can run Recuva even if it works.

evdennison
evdennison

Elmidwill, When I tried to boot from my Kingston 1GB DataTraveler, I would get the following error: "No Bootable Partition in Table". I had seen a reference to making your memstick bootable by using a utility at HP but that's no longer available. I found another thread that mentioned using a Dell utility. This is the way I got the problem fixed. 1 --- Google CW1310A0.EXE site:dell.com (Current URL is ftp://ftp.dell.com://diags/CW1310A0.EXE ) 2 --- Expand and run DDDP.EXE. Click on "Install to USB Flash Drive" button. 3 --- Remove flash drive and reboot. 4 --- Plug in flash drive. Run pe2usb -f {drive letter for flash drive} Here's the URL that led me to the solution: http://blogs.oreilly.com/digitalmedia/2004/10/utility-to-make-usb-flash-driv.html Since the Jack said that the Dell utility doesn't work for everything. He also states that it works for Vista. Cheers, ED

dixit_sanjeev
dixit_sanjeev

When I tried to create an image using preinstalled XP the error stated above was fixed. I was able to boot using UFD and was getting the "mini version" of win XP. Thanks, S

tbullen
tbullen

The program reformated my 8gig USB to 2gig It said that this could be undone by a utility but when I went back and looked it did not have the utility to undo the reformating. Can any one point me to a utility that will do this. Thanks Tim