Wednesday, June 30, 2010

Install Windows XP on a USB flash/hard drive

I am building a new PC from old spare parts. The new PC will be used mainly for the Internet, so a hard drive won't be necessary unless there's a need to download music and movies. I'm going to put together a computer with no internal storage, but use a USB stick as the main storage. Windows XP Professional will be installed on the USB stick, and the computer will boot up from the USB stick. Here I show how to install XP onto a USB stick and boot the PC from it. You should have the following ready.





Let's begin.




  1. Get your Windows XP installation CD and copy its contents to an empty folder on the hard drive. If you don't have the CD, use utorrent or emule to download the ISO file.



    Then, use 7-zip to extract the contents of the ISO file into an empty folder.



  2. Start the Command Prompt, go to the I386 subfolder and type the following commands to uncompress the USB driver files:


    CD I386
    EXPAND -I USB.IN_
    EXPAND -I USBPORT.IN_
    EXPAND -I USBSTOR.IN_

    We'll get 3 new files: USB.INF, USBPORT.INF and USBSTOR.INF. Remove the original .IN_ files.


    ERASE USB.IN_ USBPORT.IN_ USBSTOR.IN_


  3. Edit TXTSETUP.SIF to include USB storage support at the initial stage of Windows XP installation. The highlighted entries were copied from the [InputDevicesSupport.Load] section to the [BootBusExtenders.Load] section:

    [BootBusExtenders.Load]
    pci = pci.sys
    acpi = acpi.sys
    isapnp = isapnp.sys
    acpiec = acpiec.sys
    ohci1394 = ohci1394.sys
    usbehci = usbehci.sys
    usbohci = usbohci.sys
    usbuhci = usbuhci.sys
    usbhub = usbhub.sys
    usbstor = usbstor.sys


    Likewise for [BootBusExtenders] and [InputDevicesSupport]:



    [BootBusExtenders]
    pci = "PCI Bus Driver",files.pci,pci
    acpi = "ACPI Plug & Play Bus Driver",files.acpi,acpi
    isapnp = "ISA Plug & Play Bus Driver",files.isapnp,isapnp
    acpiec = "ACPI Embedded Controller Driver",files.none,acpiec
    ohci1394 = "IEEE 1394 Bus OHCI Compliant Port Driver",files.ohci1394,ohci1394
    usbehci = "Enhanced Host Controller",files.usbehci,usbehci
    usbohci = "Open Host Controller",files.usbohci,usbohci
    usbuhci = "Universal Host Controller",files.usbuhci,usbuhci
    usbhub = "Generic USB Hub Driver",files.usbhub,usbhub
    usbstor = "USB Storage Class Driver",files.usbstor,usbstor


    Insert the following in the [HiveInfs.Fresh] section:


    [HiveInfs.Fresh]
    AddReg = hivedef.inf,AddReg
    AddReg = hivesys.inf,AddReg
    AddReg = hivesft.inf,AddReg
    AddReg = hivecls.inf,AddReg
    AddReg = hiveusd.inf,AddReg
    AddReg = dmreg.inf,DM.AddReg
    AddReg = usbboot.inf,usbservices


    Then, in the [SourceDisksFiles] section:



    [SourceDisksFiles]
    usbboot.inf = 1,,,,,,_x,3,,3
    bootvid.dll = 1,,,,,,3_,2,0,0,,1,2
    kdcom.dll = 1,,,,,,3_,2,0,0,,1,2


    Save and close TXTSETUP.SIF.



  4. Edit DOSNET.INF so that the second [Files] section looks like this:

    [Files]
    d1,usbboot.inf
    d1,_default.pif
    d1,12520437.cpx
    d1,12520850.cpx


  5. Edit USB.INF as follows:


    [StandardHub.AddService]
    DisplayName = %StandardHub.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbhub.sys
    LoadOrderGroup = Boot Bus Extender

    [CommonClassParent.AddService]
    DisplayName = %GenericParent.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbccgp.sys
    LoadOrderGroup = Boot Bus Extender



  6. Modify USBPORT.INF like this.


    [EHCI.AddService]
    DisplayName = %EHCIMP.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbehci.sys
    LoadOrderGroup = Boot Bus Extender


    [OHCI.AddService]
    DisplayName = %OHCIMP.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbohci.sys
    LoadOrderGroup = Boot Bus Extender


    [UHCI.AddService]
    DisplayName = %UHCIMP.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbuhci.sys
    LoadOrderGroup = Boot Bus Extender


    [ROOTHUB.AddService]
    DisplayName = %ROOTHUB.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbhub.sys
    LoadOrderGroup = Boot Bus Extender


  7. Edit USBSTOR.INF:


    [USBSTOR.AddService]
    DisplayName = %USBSTOR.SvcDesc%
    ServiceType = 1
    StartType = 0
    Tag = 3

    ErrorControl = 1
    ServiceBinary = %12%\USBSTOR.SYS
    LoadOrderGroup = Boot Bus Extender


  8. Create a new file USBBOOT.INF with the following contents:


    [usbservices]

    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","DisplayName",0x00000000,"USB Mass Storage Driver"
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","ImagePath",0x00020000,"system32\DRIVERS\USBSTOR.SYS"
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","Type",0x00010001,1

    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","DisplayName",0x00000000,"USB 2.0 Enhanced Host Controller Miniport Driver"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","ImagePath",0x00020000,"system32\DRIVERS\usbehci.sys"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Type",0x00010001,1

    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","DisplayName",0x00000000,"USB2 Enabled Hub"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","ImagePath",0x00020000,"system32\DRIVERS\usbhub.sys"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Type",0x00010001,1

    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","DisplayName",0x00000000,"Microsoft USB Universal Host Controller Miniport Driver"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ImagePath",0x00020000,"system32\DRIVERS\usbuhci.sys"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Type",0x00010001,1

    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","DisplayName",0x00000000,"Microsoft USB Open Host Controller Miniport Driver"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","ImagePath",0x00020000,"system32\DRIVERS\usbohci.sys"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Type",0x00010001,1


  9. If you haven't erased the original .IN_ files, do so now.


    erase USB.IN_
    erase USBPORT.IN_
    erase USBSTOR.IN_

    Compress the modified files with cabarc.


    cabarc n USB.IN_ usb.inf
    cabarc n USBPORT.IN_ usbport.inf
    cabarc n USBSTOR.IN_ usbstor.inf

    You'll get 3 compressed files with IN_ extension.



  10. Put these files back into the I386 subfolder of the Windows XP installation folder.

    • DOSNET.INF
    • TXTSETUP.SIF
    • USB.IN_
    • USBBOOT.INF
    • USBPORT.IN_
    • USBSTOR.IN_


  11. You'll need this boot sector (w2ksect.bin) to make your new CD bootable. Put w2ksect.bin inside the main folder containing XP files.



  12. Now, let's burn a new CD containing Windows XP files. Start ImgBurn and select Write files/folders to disc. Click the Browser for a folder... icon and select the folder containing Windows XP files. Then, set up options as follows.










    Insert a blank CD into your optical drive and burn it.



  13. Plug in your USB flash drive or USB hard drive to your computer and run the HP USB Disk Storage Format Tool. On Windows Vista or Windows 7, run it as administrator.




  14. From the I386 folder of XP installation CD, copy the following files to the USB drive:



    • ntldr
    • ntdetect.com

    Then, create a new file boot.ini with the following contents. Put it on the USB drive.


    [boot loader]
    timeout=30
    default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

    [operating systems]
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect


  15. Run the Partition Table Editor (PTEDIT32.EXE) as administrator. Select your USB drive from Hard Disk pulldown menu.




    Change the type of primary partition on the USB drive from 00 to 80. Click the Save Changes button.



    Partition Information should read FAT16X, Bootable



  16. Remove your hard drive from the computer. Then, connect your USB flash drive directly to your computer.



  17. Change the boot order in the BIOS so that your computer can boot from a USB drive. Typical BIOS options are as follows:


    • USB HDD
    • USB Hard Drive


  18. Insert your new Windows XP CD your burned above and boot your computer with it. During installation, don't format the USB drive. Just leave it as is.



  19. After successfully installing Windows XP on your USB drive, install the EWF or FBWF filter.



2 comments:

  1. “Install Windows XP on a USB flash/hard drive”


    Great idea but I am not there yet.
    Ran into a problem with the newly edited Windows Xp CD.
    I get this:

    "inf file txtsetup.sif is corrupt or missing. Status 14"

    I used ISO Commander to put the edited files back into the I386 subfolder
    It seems that ISO Commander changed the location of txtsetup.sif , and windows is unable to find it.
    I don't have a fix yet. All suggestions appreciated.
    Thanks
    jolytroter@gmail.com

    ReplyDelete
  2. I boot my computer with the cd but when selecting disk this message appeared.
    Your computers startup program cannot gain access to the
    disk containing the partition or free space you chose.
    Setup cannot install windows XP on this hard disk.

    This lack of access doesn't necessarily indicate an error
    condition.
    For example, disk attached to a SCSI adaptor that wasn't
    installed by your computer manufacturer or to a secondary
    hard disk controller, are typically not visible to the
    startup program unless special software is used. Contact
    your computer manufacturer for more information.

    On x86 - based computers, this massage may indicate a
    problem with the COMS drive type settings.
    See your disk controller documentation for more
    information.

    ReplyDelete

About This Blog

KBlog logo This blog seeks to provide a collection of interesting pictures found on the Web. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

Powered By Blogger