Windows XP on a USB stick

Windows XP installation from USB

I wrote this piece back in March 2006 before transferring it to my new blog. It’s quite possible that bits and pieces of this HOWTO are outdated. If any are and you find a solution, then please leave a comment for the rest of us.

— Roderick

What follows is a recipe on how to install Windows XP from USB. You can cut right to the chase or read about how it happened to me first. Sit tight, you’re in for a ride!

Case In Point

You’ve got this Acer laptop with a malfunctioning DVD drive. Specifically, you removed it from its bay and now Windows XP crashes when you plug it back in. Knowledge Base article 310664 matches it to a tee.

Provided solution: update to Service Pack 1, or disable DMA in the BIOS. Current situation: running SP2 and blessed with a “user-friendly” BIOS that doesn’t allow you to disable DMA.

Your luck just ran out, but – being the geek that you are – you don’t whine about it. Instead, you come up with this bright idea: let’s install Linux, that’ll work some magic! And so you get Gentoo Linux installed using a home-bred LiveUSB distribution. And much to your dismay, no proper hot-plugging implementation is provided for your laptop. Curses.

So finally, you call the support line to have them collect your laptop for repair. One problem here: you’re betting they won’t like seeing Linux boot up and, hoping to forego service costs, it’s up to you to reinstall Windows XP.

One problem here: you don’t have a working CD-ROM drive to install Windows XP off, and from experience you know that Windows XP won’t install from an external drive. Blasted!

Enter the cavalry.

Disclaimer

The procedure here is provided without any warranty or support whatsoever. It worked for me and so it might for you. It also might blast you and your laptop to pieces. Some of the procedures described here can wipe all of your data. Thought I’d warn you.

I don’t mean to be inventive here, either. In fact, all the technology has been laid out for us and is readily available. All I’m doing is wrapping it all up in writing. Shouts out to everyone who provided the technology!

That being said, let’s get down to business.

Ground Zero: Ingredients

You’ll be needing ample space on a USB storage device like a thumb drive or external disk drive. 1 GB of storage will suffice. Possibly, you could access the setup files from a network share in which case you’ll only need a 256 MB thumb drive, but I haven’t tried that.

Personally, I booted off a 512 MB thumb drive and put the Windows XP setup files on an external disk drive. So a combination will do just fine, but just make sure that you’ve got enough USB ports: all USB devices will need to be plugged in and stay plugged in while we’re booted into BartPE later on!

You’ll also need a bunch of software, including a valid copy of Windows XP. The other software components can be downloaded freely:

Q: Why Windows 2003 Server Service Pack 1? I want to install XP!

A: Well that’s exactly the trick, though it’s a bit technical. During booting, Windows resets the USB port and loses your boot device. That’s why installing from USB normally fails. But by using Windows 2003 Server’s ramdisk feature in the early phases of booting, we avoid that problem.

Don’t be mislead though: you’ll be installing Windows XP all the same. It’s just that we’ll be using two Windows 2003 Server files from the Service Pack to do it.

You can also do a Windows 2003 Server installation using this same procedure, save that you’ll be needing to update to Windows 2003 Server Service Pack 1 instead of Windows XP SP2, below. That’s assuming, of course, that you’ve got a valid copy of Windows 2003 Server.

You will also need an already functional Windows system to prep the USB disk from. In addition, your target system (the one that needs reinstalling) should support booting from USB. Virtually all modern ones do though.

Finally, not all cheaper USB devices properly support being booted from. The BartPE forums have a partial list of ones that don’t.

Step One: Preparing the Windows XP Setup Files

For this procedure to work correctly, you’ll need Windows XP to be at Service Pack 1 or Service Pack 2. Many newer Windows XP CDs already have either one included.

You can check by inserting the CD-ROM and looking at the files in the top folder. There should be a file named WIN51P.SP1 or WIN51P.SP2. If you see either one, fast forward to step two.If there is no such file, or you’ve got a SP1 CD that you would like to update to SP2, proceed as follows:

  1. Copy the Windows XP CD-ROM to a location on your hard drive. We’ll be assuming C:\winxpcd. I strongly recommend you to use such a vanilla CD. Users have reported strange happenings with custom XP distributions.
  2. Download the Windows XP Service Pack 2 Network Installation Package.
  3. Unpack Windows XP SP2 by running WindowsXP-KB835935-SP2-ENU.exe -x. Note the -x parameter that will allow you to specify a location to unpack to. We’ll be assuming C:\winxpsp2.
  4. Integrate SP2 into the setup files by running C:\winxpsp2\i386\update\update.exe /integrate:c:\winxpcd.

If your system needs special drivers to run, this would be the time to include them (called “slip-streaming”). Doing so isn’t exactly trivial and should only be necessary if you, say, need non-standard SATA support. The process is beyond the scope of this article, but fortunately Google is your friend.

Step Two: Prepping BartPE

First we’ll prep the USB drive we’ll be using for booting. This is by far the largest step in the process, though it shouldn’t be difficult for anyone to follow. It requires a functional Windows system.

  1. Install BartPE. We’ll be assuming that you install to C:\pebuilder.
  2. Unpack PE2USB to C:\pebuilder.
  3. Unpack Windows 2003 SP1 by running WindowsServer2003-KB889101-SP1-x86-ENU.exe -x (that’s assuming that you downloaded the English version). Note the -x parameter that will allow you to specify a location to unpack to. We’ll be assuming C:\server2003sp1.
  4. Create a folder named C:\pebuilder\srsp1.
  5. Copy C:\server2003sp1\i386\setupldr.bin to C:\pebuilder\srsp1.
  6. Expand and copy ramdisk.sys by running expand -r C:\server2003sp1\i386\ramdisk.sy_ C:\pebuilder\srsp1.
  7. Start PE Builder from the Start Menu. Point “Source:” to the location of your Windows XP setup files containing SP1 or SP2.
  8. Make sure the “Output:” is set to “BartPE”. If using SP2: go into the Plugins configuration dialog and enable “RpcSS needs to launch DComLaunch Service First – SP2 only”.
  9. Hit “Build”.
  10. When it’s done building, insert the USB drive you intend to boot from and run C:\pebuilder\pe2usb -f [drive:], replacing [drive:] with the location of your USB drive. This will destroy any data on your USB drive! The drive shouldn’t be partitioned any larger than 1 GB. If it is, then repartition it using Computer Management in the Control Panel.
  11. Copy the Windows XP setup files to the USB drive (or another USB device if you have insufficient space left). You’ll only need the i386 folder.

If no errors occurred in the process, you should now be all set to boot from USB!

Note: it’s possible to use Windows 2003 Server as the operating system to boot from, but I don’t recommend it. Many of BartPE’s included utilities won’t work properly.

Step Three: Configuring the BIOS

You should now reboot and go into the BIOS configuration to boot from USB. Instructions for doing so wildly from system to system, but generally entail the following:

  1. Reboot the system.
  2. While booting (before Windows starts loading), get into the BIOS configuration screen by hitting something like F1, F2, Delete or Escape. Hotkey instructions are generally provided on the screen.
  3. Go to the section that has your boot devices.
  4. With your USB drive plugged in, the USB drive should be listed. If it isn’t, your system might not support booting from USB. Assuming that it is supported (as happens with almost all modern hardware), promote your USB drive to the primary boot device.
  5. Exit from the BIOS configuration, saving all changes.

If you’re completely new to BIOS configuration, BIOS for Beginners over at Tom’s Hardware might be a good primer. Be aware though, that you can seriously screw up your system by providing incorrect settings!

Step Four: Booting into BartPE

Assuming that you properly configured your BIOS and your USB device supports booting, BartPE should now load. Depending on the speed of your USB device, this may take a while.

If it isn’t working, then double-check the following before making a scene:

  • Is your BIOS properly configured for booting from the USB disk? (Is the USB device listed and does it have top priority?)
  • Have you correctly prepared the USB disk in step two? (Restart the procedure.)
  • Does your USB stick properly support being booted from? (Try another one!)

Step Five: Prepping the Hard Disk

You need to make sure that your hard drive is partitioned and formatted properly. Especially if you’ve had Linux or some other operating system on it, you’ll need to repartition and format it. BartPE has DiskPart for disk partitioning and A43 File Manager to format your drive.

If you are sure that your hard drive is set up properly (i.e. it has only run Windows, it has a valid FAT or NTFS partition) then you can safe yourself the hassle and skip this step.

This procedure will destroy any data on the hard drive.

To repartition:

  1. From the Go menu, navigate to DiskPart.
  2. Enter the commands needed to repartition your drive. For example, try the following: select disk 0 (select the first disk), clean (purges the entire drive, essentially resetting it), create partition primary (creates a single partition from the entire disk), assign (assign the partition a drive letter), exit (quits DiskPart).

This procedure will destroy any data on the hard drive.

To format:

  1. From the Go menu, navigate to the A43 File Manager.
  2. Right-click on the target drive (e.g. C:) and click Format. Should be self-explanatory.

Step Six: Launching Windows XP Setup

With your drive all ready, you can now launch the Windows XP setup with a few custom parameters. Let’s assume that the files are available at D:\i386.

Plugging in a device now won’t work. Remember that all USB devices will need to be plugged in right from the start while using BartPE.

  1. Run D:\i386\winnt32.exe /syspart:C: /tempdrive:C: /makelocalsource. Replace C: with the drive you want to install Windows to.
  2. Proceed with the installation. When asked to convert the installation volume to NTFS, answer No. The setup program incorrectly believes that your USB drive (which is formatted as FAT) needs conversion.

The setup program will then silently close, which might make you think that something went wrong. Don’t worry though. Reboot your system, remove the USB drive(s) and – if all went well – you can now finish setting up Windows XP. Congratulations!

513 thoughts on “Windows XP installation from USB”

  1. Nice guide, showed me the right way to approach installation (was having issues with HP 2730p and USB CD/DVD-drive).

    So, the case was to install Windows XP Tablet Edition 2005 from USB-stick. Went allmost the same as the guide says, but few mods was needed:

    – If you are installing Tablet Edition, you need the i386 -folder (as said in the guide), but you allso need the CMPNENTS -folder copied to your usb-stick.

    – When you are starting to copy the installation files in BartPE, add “all” -parameter to /makelocalsource. Like this: D:\i386\winnt32.exe /syspart:C: /tempdrive:C: /makelocalsource:all . This will copy the Tablet Edition needed installation files also.

    So only few mod’s needed and all went just fine 🙂

  2. Thanks a lot nick. After a day of banging my head to make it work..your post was the biggest help..

    Thanks a ton..

  3. Thanks Roderick, you saved my day. After hours of mind-breaking actions, finally found your website and working solution for my problem.

    Keep up the good work!

  4. Excellent guide, if you follow it EXACTLY as it says, works PERFECTLY. Thanks for it!.

    Regards.

  5. All I get at this point is the BART PE splash screen. It will ask me if i want network support and then no matter what I say it eventually just sits at the splash sc reen. There is a “go” at the bottom of the screen That could be a button but I do not have mouse movement. alt f or enter do nothing. any help would be great.

  6. I find this guide a bit challenging since i usually keep my Windows folder on C:\, Program Files on D:\ and User Accounts on E:\, but i’ll give it a go.

  7. I give up, I’ve done all the steps and when compiling BartPE I’m getting this error:
    Error: file ‘iaStor.sys’ not found! …and the file is well and fine there!
    So, if I cannot use the modified Win XP SP3 (made with nLite) with Intel drivers included (chipset and SATA) I’ll not be able to install the system!
    I don’t expect you could help me, but I’ll really appreciate it.

  8. I just wanted to thank you for this wonderful information! Your method is the only one that has worked. I was fixing a small Dell laptop with no cd drive in it and needed to put windows on it. This worked better than any other how-to!

    Now time to put Linux on another partition…

  9. THANKS Roderick THIS REALLY WORKED BUT ONLT PROBLEM I FACED WHEN I TRIED DISK PART IT DIN’T WORK AND ALSO WHILE FORMATING IN THE APPLICATION A43 FILE MANAGER IT DINT WORK, LASTY USING COMMAND PROMPT IT COULD FORMAT IT.

    IF POSSIBLE PLEASE LET ME KNOW HOW TO INSTALL WIN 2K THROUGH PEN DRIVE.

    VIVEK SHETH, INDORE – INDIA

  10. Thank you dude, really good stuff here. I was just looking for a good tutorial for installing XP from USB and this a good one 😉

  11. Thank you! Just got two laptops w/o CD drives to work on, and this tutorial made it so much easier getting them running again. This can be useful for a plethora of things for PC repair situations.

  12. i have a problem to install windows xp in compaq presairo cq40-410tu.every time i want to install.the blue screen is appear .and do you know what is the sata raid for this model.and the manufacture is intel.

  13. Hi guys!

    To make it much more easier just use pebuilder.exe to create a BartPE and then use petousb to install BartPE (if u don’t know what is BartPE that is the result of using pebuilder.exe ) in your USB. The rest is just like the way Roderick said.

    If u don’t know where u can download PeToUSB just type it in google.com. Just select ur usb and click “enable format” and then click “enable LBA (FAT 16X)” and click the button that have three dots. There will be another window that will open. Navigate to where you ur create BartPE (the one u first make by using pebuilder.exe) and then select it and click “OK” the window will close. Click “enable file copy” and then click “start” and that’s it u can know copy ur I386 folder to ur USB to install Windows XP.

    Just make sure your BIOS is properly configured.

    For the summary this is what u need.

    1. Windows XP CD with SP2 OR SP3
    2. pebuilder
    3 PeToUSB

    U don’t need Windows Server Service Pack 1.

  14. after spending hours failing at doing this, I found this page and got the job done. thanks for the clear and well-written instructions!

  15. Thanks, Henri Aalto, on April 1st, 2009 at 4:34 pm wrote: – If you are installing Tablet Edition, you need the i386 -folder (as said in the guide), but you allso need the CMPNENTS -folder copied to your usb-stick.

    – When you are starting to copy the installation files in BartPE, add “all” -parameter to /makelocalsource. Like this: D:\i386\winnt32.exe /syspart:C: /tempdrive:C: /makelocalsource:all . This will copy the Tablet Edition needed installation files also.

    You need to also do this when installing Media Center Edition. If not, then you will end up with Xp Pro, lol.

    Also, if you do not want to use the “all” switch, then you can just manually copy the CMPNENTS folder to the i386 folder after running command and before rebooting. Thanks. For those that are having problems formatting from Bartpe, you may need to do a diskcheck first and reboot or you can do as I did and download “gparted” live cd or “Ubcd” and use the free Home Edition of Easus Partition Manager. Great guide.

  16. Oh yea, I forgot to say that you can also use this method on a laptop or desktop that can not boot from usb and has no cd rom either. You simply unplug the hard drive and stick in another machine that can boot from usb and you do these steps. After you run the “D:\i386\winnt32.exe /syspart:C: /tempdrive:C: /makelocalsource” command, all you need to do is shutdown computer and unplug drive and connect back to original computer and then start up that computer and the install will work PERFECTLY. This is much much better than installing xp from dos 7.1, because there is no dos conversion that needs to take place. I successfully did this method on a computer that did not boot from cd or usb stick. all you need is a laptop to ide hard drive adapter to plug up hard drive into a desktop computer. Great guide. Where is the “Donate link”? You deserve it.

  17. Hi im trying to install xp pro sp3 on my Dell Inspiron 700m laptop. Of course, my cd drive is broken and of course my recovery partition is damaged. So I thought I was out of luck until I found this guide. But i have a problem, I keep getting the error “MegaSR.sys not found” when I try to boot, I noticed that when I was building the image with BartPE, I would get two warnings at the end, one of which says that MegaSR.sys was not found, but the build was successful. Can anyone help me with this issue?

  18. Well it took me some time, but now XP is finally installing on my laptop with broken cd-rom. I tried a million other ways, but this one worked (after some trial and error) flawless.

    Thanks Roderick! Grtz Rob

  19. Hello, everybody!

    First of all, I’d like to thank Roderick for this great guide.

    Secondly, I followed it step by step and it didn’t work for me.

    Scope: ACER ASPIRE ONE D150

    I had the same problem that Dietrich had, I mean, my laptop’s hard disk was not recognized by BartPE.

    Googleing thru the network I found this:

    http://www.911cd.net/forums//index.php?showtopic=21918

    So the reason of BartPE not recognizing my hard drive is just that it doesn’t have the propper drivers.

    I followed this guide:

    http://www.911cd.net/forums//index.php?showtopic=21918

    step by step to install Mass Storage DriverPacks inside BartPE and it works nice. It should also work in many other scopes/laptops, because Mass Storage DriverPacks contains lots of drivers for many SCSI adaptors.

    Just one addition to the 911cd.net guide that will help you all:

    -In order to achieve the figure 2 with the “DriverPack MassStorage text mode” checkbox checked you must copy

    DP_MassStorage_wnt5_x86-32_901.7z

    into your C:\DPsBase\DriverPacks directory, DON’T UNCOMPRESS IT.

    Both guides together worked perfectly for me.

    Best regards, people!!

  20. tried this but now getting a messages saying
    .sif file used by setup is corupted or missing
    value 0 on the line in section [source disks files]
    with key “binifix4.cmd”
    setup cant continue
    help please

  21. Hello,
    I have following issue: my bartpe bootdisk doesn’t find my local C: drive, it only has following drives:
    RAMDisk B:
    BartPe X:

    that’s it.
    Anybody any ideas on how to make BartPe recognize my C: partition? I can’t install windows now, I get the message that there is no system partition…

    Thanx in advance,
    C

  22. hi
    how do i make my transcend pendrive bootable in vista…. ?? actually i hav 2 laptops n i want to install xp in my 2nd laptop thru a bootable pendrive….. while am tryin to make my pendrive bootable thru vista setup in d 1st laptop…..
    plz help.., thnx in advance

  23. Hi,

    I got the same problem as Saleh98 et Catalin with ntoskrnl.exe, error 14 : ntoskrnl.exe could not be found. Please help !!!

  24. help please

    Chris, on June 15th, 2009 at 8:53 pm wrote:
    Hello,
    I have following issue: my bartpe bootdisk doesn’t find my local C: drive, it only has following drives:
    RAMDisk B:
    BartPe X:

    Have you tried to check up ur Bios after an option over AHCI or IDE? If you got AHCI enabled you might want to change to IDE. And see if you can read the files there.

  25. 1. Get Hiren 9.8 or 9.9
    2. Make Flash Bootable refer: http://www.hiren.info/pages/bootcd-on-usb-disk (works on brand pc or laptop 100%, others sometimes not – depends on board and bios).
    3. Copy into flash XP distributive folder, or iso. Remember Serial key.
    4. Boot from flash
    5. Select options Mini XP
    6. In XP:
    6.1. Find Local Harddisk’s C (maybe c, d, etc)
    6.2. Rename old system folders if you have that:
    6.2.1. “Documents and Settings”
    6.2.2. “Program Files”
    6.2.3. “WINDOWS”
    6.2.4. “Users”
    6.3. In harddisk’s C Make folder Install and copy here XP distributive or extract here an iso. then

    !!!!!!!!! REMOVE USB !!!!!!!!!!!

    In harddisk’s C \Install folder run setup
    type serial
    in Advanced options type folders:
    Source: C:\Install
    Destination: C:\Windows
    go ->
    after copying files reboot

    boot from HDD

  26. In response to:
    Chris, on June 15th, 2009 at 8:53 pm wrote:
    Hello,
    I have following issue: my bartpe bootdisk doesn’t find my local C: drive, it only has following drives:
    RAMDisk B:
    BartPe X:

    I had to use the DiskPart utility included with BartPE. I created the primary partition. When I rebooted, the local disk was assigned the C: drive letter and my USB drive had the E: letter. I could install after that.

  27. Great build, using it about a year:

    depositfiles.com/ru/files/kcnd005tt

    – Best Windows XP usb flash edition 2009.

  28. Works perfect so far.
    Used some random 2gig stick, a custom SP3 slipstreamed nlight copy of XP, and have had no trouble yet 😀

  29. Billion thanks for ur work and self for making this guide. Made me new experients.

    Thank you very very much 🙂
    p

  30. Used this to install XP on a Tosh NB100 running Ubuntu. Most difficult part was making a 1gig partition on the USB key. I used Boot-It and SFDisk for that.

  31. works a treat! Very good walk through especially for netbook/ultra portable laptop users who generally do not have CD drives to install from.

    I used this guide and it worked excellently.

    Thank You for taking the time to share this info!

  32. Pingback: cdromdrive
  33. Great guide! Had no issues at all! I couldn’t get my Dell Mini to boot from an external CD-ROM so I came here. You solved all my problems, thanks!

Leave a Reply