Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

How to boot/install from USB key ?


  • This topic is locked This topic is locked
485 replies to this topic

#1
Halfwalker

Halfwalker

    Junior

  • Member
  • Pip
  • 86 posts
  • Joined 12-October 05
Hey -

I've done some digging around, and I can only find one comment on booting to install XP Pro from a USB key. That's on the http://www.experts-exchange.com forum, which is a PAY for information one ... As Stallman says, information should be free :)

Given that CDs only hold around 700meg, maybe 800, and that 2G USB keys are now common, I would like to set up an XP Pro installation on a USB key. Pop in the key rather than a CD, set to boot from USB-HDD, and install away, with more room for apps etc.

Note - this is not actually running XP from the key - I've seen lots of examples of that. This is basically emulating a normal CD install, just sourcing it from a USB key rather than CD.

Any ideas ?

D.


How to remove advertisement from MSFN

#2
cluberti

cluberti

    Gustatus similis pullus

  • Supervisor
  • 11,253 posts
  • Joined 09-September 01
  • OS:Windows 8.1 x64
  • Country: Country Flag
You'd need a BIOS that is capable of using the USB key as a boot device - I know this is common in newer machines, but not quite sure how widespread this is yet.

However, if your BIOS supports USB booting, it is possible:
http://www.aaltonen....b-key-addendum/
MCTS Windows Internals, MCITP Server 2008 EA, MCTS MDT/BDD, MCSE/MCSA Server 2003, Server 2012, Windows 8
--------------------
Please read the rules before posting!
Please consider donating to MSFN to keep it up and running!

#3
Halfwalker

Halfwalker

    Junior

  • Member
  • Pip
  • 86 posts
  • Joined 12-October 05
Yup - I've seen that page. Actually booting from the USB key is not the problem. It's setting up the files, boot image etc, on the key that's the hiccup.

The CD normally boots via the Microsoft Corporation.img bootimage. That's a tiny program that then loads up setup.exe, which in turn is only 1.3k in size. I'm guessing that Microsoft Corporation.img also does the "press any key to boot from CD" msg ...

It's a pity that syslinux doesn't support cluster sizes greater than 16K, which limits it to 1G filesystems. That would be ideal to have a generic installation USB key, able to install XP Pro, Linux etc, all right from one device.

D.

#4
cluberti

cluberti

    Gustatus similis pullus

  • Supervisor
  • 11,253 posts
  • Joined 09-September 01
  • OS:Windows 8.1 x64
  • Country: Country Flag
You might consider putting WinPE (or bartPE) on the USB key to kick off the installations - that might be a better road to take than installing directly from the USB key. From the PE you could format the hard disk(s), copy the files to the disk, and start the installation using your unattended file.

Edited by cluberti, 26 November 2005 - 12:04 PM.

MCTS Windows Internals, MCITP Server 2008 EA, MCTS MDT/BDD, MCSE/MCSA Server 2003, Server 2012, Windows 8
--------------------
Please read the rules before posting!
Please consider donating to MSFN to keep it up and running!

#5
Claymore1746

Claymore1746

    Newbie

  • Member
  • 23 posts
  • Joined 05-November 05
Here are some instructions you may find helpful:

WeetHet USB Boot setup

#6
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,859 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Note - this is not actually running XP from the key - I've seen lots of examples of that.


Oh, yeah, can I ask you where? :w00t:

As far as I know, the ONLY project that ever succeeded in booting XP from a USB key/drive is Dietmar Stoelting's one, published first time at the end of October 2005, still VERY experimental:
http://home.graffiti...SB/USBfaqs.html
http://www.911cd.net...showtopic=14181

However as I see it, the easiest way to achieve what you want is to install some kind of DOS/Win9x OS on the stick then run the 16 bit install program WINNT.EXE.
There are some known problems using it if you use nlite with it and there could be some problems about drive lettering also, but it shoul be possible to find some workarounds for these latter ones.

Using a BartPE install on the USB pendrive and using the 32 bit install program WINNT32.EXE has no known problems, but you will need enough space for the BartPE install and it's booting will be slow.


jaclaz

#7
Halfwalker

Halfwalker

    Junior

  • Member
  • Pip
  • 86 posts
  • Joined 12-October 05
So how exactly is the CD starting the install ? It doesn't need any 32bit OR 16bit environment ... The Microsoft Corporation.img loader comes up and starts up setup.exe. There must be an emulation for the MasterBootRecord of the USB drive that can hold and properly load up in the same way ...

If syslinux could handle larger than 16k clusters, it would work fine. Use memdisk, and point the initrd at Microsoft Corporation.img. memdisk requires diskette images, so it may not work that way, so perhaps isolinux - that takes no-emulation boot records.

Heh, I take back the lots - I did see Dietmar's page, and a few others as I recall. All via google and a couple of hours of digging around. But definitely more than one. I skimmed them looking for examples of installing via USB drive, but no luck.

D.

#8
Bezalel

Bezalel

    Senior Member

  • Member
  • PipPipPipPip
  • 591 posts
  • Joined 11-October 05
Setup.exe is a 32 bit program and is not used when booting from a CD. Microsoft Corporation.img loads setupldr.bin. Setupldr.bin does the text mode setup based on txtsetup.sif and winnt.sif.

#9
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,859 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Setup.exe is a 32 bit program and is not used when booting from a CD. Microsoft Corporation.img loads setupldr.bin. Setupldr.bin does the text mode setup based on txtsetup.sif and winnt.sif.


....and as you can rename setupldr.bin to NTLDR as when building a WinPE/BartPE:
http://www.nu2.nu/pebuilder/
http://www.prime-exp...s/UserGuide.pdf

....or rename NTLDR to setupldr.bin as seen here:
http://daniweb.com/t...read.php?t=4644

...you should have a good start.

Also, have a look at this, seemingly completely unrelated but useful if you want to make a multi-install hard-disk (as the multi-install DVD depicted):
http://www.magiciso....multi-os-cd.htm

Just for the record, the answers on the "pay for site" you mentioned can be viewed, at least at the moment, here:
http://216.239.59.10..._21475584.htmla

It seems like you got same or better answers here for free....;)

jaclaz

#10
pmshah

pmshah

    Member

  • Member
  • PipPip
  • 292 posts
  • Joined 10-September 05
If the USB device in question supports booting from it, it would have come with a utility to make it bootable including selecting emulation ( usb : floppy, hdd, cdrom, zip, ls-120 or what ever else your bios might support), the boot image & all the files you want on it. If you do this & manage to boot from it all you have to do is to select the option of copying the installation files to the HDD & you are all set.

#11
net_user

net_user

    Advanced Member

  • Member
  • PipPipPip
  • 371 posts
  • Joined 02-June 05
  • OS:Windows 7 x86
  • Country: Country Flag
check out ...
http://www.911cd.net...6&mode=threaded


i have bartpe on a usb stick....so any pc that supports usb booting...i can just pop in my usb stick and load my bartpe without a cd. works pretty good also when i need to update the image, i don't waste any more cd's.

Edited by net_user, 29 November 2005 - 07:47 AM.

Hex:
526573697374616e636520697320667574696c6521

A+

#12
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,859 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
Just to keep things together, a small howto to boot from BartPE (CD) to install XP has been posted here:
http://www.msfn.org/...showtopic=68252
adapting it to USB drive/key (a BIG one, ;) ) should not be a problem.

jaclaz

#13
davinci83

davinci83
  • Member
  • 1 posts
  • Joined 07-November 06
Isn't there a way to transfer the boot sector from the cd onto a usb flashdisk, without getting into BartPE?

I'm looking for a way in essence to install xp from a usb stick with the absolute same look and feel as if it were being done from cd.

#14
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,859 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Isn't there a way to transfer the boot sector from the cd onto a usb flashdisk, without getting into BartPE?

I'm looking for a way in essence to install xp from a usb stick with the absolute same look and feel as if it were being done from cd.


Look here:
http://www.msfn.org/...showtopic=81537
http://www.msfn.org/...showtopic=81788

jaclaz

#15
LLXX

LLXX

    MSFN Junkie

  • Banned
  • PipPipPipPipPipPipPipPipPip
  • 3,399 posts
  • Joined 04-December 05

I've done some digging around, and I can only find one comment on booting to install XP Pro from a USB key. That's on the http://www.experts-exchange.com forum, which is a PAY for information one ... As Stallman says, information should be free :)

Just scroll down... :lol: I always wonder if that site was purposely setup to see how many lusers would actually pay for the equivalent of scrolling down... :D

#16
porear

porear

    Newbie

  • Member
  • 49 posts
  • Joined 10-August 04
Greetings. I feel I'm verrrrrrrrrrry close on this one, but that may be naive confidence. I believe I've reduced it down to an issue of pointing the right part of the setup to the location of the setup files on my USB key. Forgive me if I'm actually way off.

I'm using WinXP slipstreamed with SP2 and most of the subsequent hotfixes with the command script found at http://smithii.com/node/12. My flash drive is a Lexar Firefly 2GB.

Steps taken:

1. Run the smithii command script and build the slipstreamed installation and burn to a CD
2. Copy CD contents to a working directory C:\WINSET on my HD
3. Follow Flyakite's instructions at http://flyakite.msfn.org/ to copy installation files to C: by running C:\WINSET\I386\WINNT32.EXE /NOREBOOT
4. Copy installation boot directory C:\$WIN_NT$.~BT created in step 3 to C:\WINSET
5. Delete winnt.sif, migrate.inf, and bootsect.dat from C:\WINSET\$WIN_NT$.~BT
6. Use CodeBeetle's PeToUSB from http://gocoding.com/....php?al=petousb to format and load my USB stick by pointing it to C:\WINSET

Results:

The stick boots, Windows Executive and the drivers load, and I make it all the way to the "Press Enter to install/press R to repair" screen. When I press Enter, I am prompted to "Insert Windows XP Professional Service Pack 2 CD". It doesn't see the setup files on the stick.

Troubleshooting:

I've tried modifying the TXTSETUP.INF file in both the \minint directory that PeToUSB creates (its the I386 files from the setup CD) as well as the one in \$WIN_NT$.~BT to point the SETUPSOURCEPATH to \minint. Same result, asks for the CD.

I've also tried hex editing the SETUPLDR.BIN file in both \minnit and \$WIN_NT$.~BT to replace i386 strings with minint. Asks for the CD.

Conversely I've tried editing the two SETUPLDR.BIN files to replace instances of minnit with I386, and renamed the minint directory to I386. Got a message that TXTSETUP.SIF was missing or corrupted, so obviously the boot sector created by PeToUSB wants that file (or chain via SETUPLDR.BIN) to be in the \minint directory.

The first time I tried all of this I forgot to delete the 3 files in step 5. Instead of asking for the SP2 CD, I got an error message that installation files were not found where setup thought they had been copied, so one of these files must point to where a continued installation would expect to find them after reboot.

Next Step(s)?:

How can I correct the problem of setup asking for the SP2 CD and not knowing that the setup files are on the USB stick in the \minint directory?

I am considering not deleting the 3 files in step 5, and instead copying the C:\$WIN_NT$.~LS directory created by the setup in step 3 to the USB stick. Perhaps it will then consider this a continued installation and find the setup files.

Any ideas? Be gentle on the rookie... :hello:

#17
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,859 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

When I press Enter, I am prompted to "Insert Windows XP Professional Service Pack 2 CD". It doesn't see the setup files on the stick.

Cannot really say, but that error should come out if the "root" files on CD are not found:
WIN51
WIN51IP
WIN51IP.SP1
WIN51IP.SP2


See these threads here:
http://www.911cd.net...showtopic=16381
http://www.911cd.net...o...c=17425&hl=

Putting those files in the root of the stick should make no harm.

Got a message that TXTSETUP.SIF was missing or corrupted,

No, it should not be needed to hexedit SETUPLDR.BIN, but is it possible that the version you are using has a CHECKSUM ? :
http://www.msfn.org/...opic=58410&st=0

jaclaz

Edited by jaclaz, 09 November 2006 - 02:43 PM.


#18
porear

porear

    Newbie

  • Member
  • 49 posts
  • Joined 10-August 04
Update edit - still not fully working yet, see post below.

:thumbup I GOT IT!!! :thumbup
I am successfully running a Windows XP SP2 installation off of my USB stick.

I don't really know what I am doing, so this is a brute force method, but it works for me. Please help me to make it more elegant.

For this procedure you need:

Your USB drive
Your Windows installation source and
CodeBeetle's PeToUSB from http://codebeetle.co....php?al=petousb

For the steps below I am assuming you are working from a PC with windows loaded on C:

1. Make a copy of your C:\boot.ini to boot.bak

2. Navigate to your windows installation source and run a noreboot setup. For me from my CD it was

Start->Run and type E:\I386\winnt32.exe /noreboot
When prompted, choose Installation Type "New Installation"
At Setup Options - Advanced Options Check the box for "Copy Setup Files" to directory \WINDOWS
At Get Updated Setup files choose No

Thanks to FlyAKite and gosh at http://flyakite.msfn.org/ for this part. Once all of the installation files have been copied. the installation will simply stop without a reboot. You will now have two new hidden directories on your PC, C:\$WIN_NT$.~BT and C:\$WIN_NT$.~LS . If you can't see them, go to Tools->Folder Options->View in Windows Explorer and choose to show hidden and operating systems files.

3. Once the installation has finished, delete C:\boot.ini and rename C:\boot.bak to C:\boot.ini

4. Build with PeToUSB as follows

Insert your USB stick
Start PeToUSB
In PeToUSB, choose your USB stick drive,
Make sure Enable Disk Format is checked, and
Point Source Path to your installation source (for me it was my CD drive, E:\) then
Click Start, Yes, Yes to run PeToUSB.

5. When PeToUSB is finished, delete everything off of the USB stick EXCEPT

NTLDR
NTDETECT.COM
WIN51
WIN51IP
WIN51IP.SP2


Your WIN files may vary depending upon the service pack level of your install source.

Yes, even delete the \minint directory. All we really obtained from this build is NTLDR, this is where someone smarter than I could simplify the process and save some time if they could help obtain a proper NTLDR another way.

6. Copy the directories C:\$WIN_NT$.~BT and C:\$WIN_NT$.~LS onto your USB stick

7. Create a directory \minint on your USB stick

8. Copy C:\$WIN_NT$.~BT\TXTSETUP.INF to the new \minint directory on your USB stick

Steps 7 and 8 are another place where a proper NTLDR file that does not point to \minint would help create a more correct method.

9. Delete the following files from the \$WIN_NT$.~BT directory on your USB stick (thanks again to FlyAKite):

BOOTSECT.DAT
migrate.inf
winnt.sif


10. On your PC hard drive, rename C:\$WIN_NT$.~BT to C:\$WIN_NT$.~BT.OLD and C:\$WIN_NT$.~LS to C:\$WIN_NT$.~LS.OLD

We're hanging on to these files for now in case there are any problems, but we need to change the names. Otherwise when running from your USB stick you may actually be copying the setup files off of your hard disk instead of the stick. I found this out when one time I pulled out my stick during installation - and it kept running!

11. Try it! It if works, delete the two directories in step 10 to clean up.

Hope this works for you, please give it a shot. Any suggestions and improvements are more than welcome, I could really use help with the NTLDR issue so that the time-consuming PE build would not be needed. I'll be glad to answer any questions I can, but like I said, this was a blind squirrel/acorn "hit and miss" for me!

Pat :D

Edited by porear, 09 November 2006 - 09:04 PM.


#19
porear

porear

    Newbie

  • Member
  • 49 posts
  • Joined 10-August 04
Of course, for all I know, this may get you to the exact same place as making a DOS bootable stick, copying the setup disk to it, and running winnt.exe... :P

#20
porear

porear

    Newbie

  • Member
  • 49 posts
  • Joined 10-August 04
So, so sorry guys. Still a step away. I just tried a full run through and got all the way to where setup would start copying files to the hard disk, and got the message

"Setup cannot access the CD containing the Windows XP installation files".

This is right after you pick a partition to install to.

My successful run must have been before I renamed the two directories on the hard disk. Something in the setup is still pointing there. So close... any help?

Again, I apologize profusely on jumping the gun calling total success. :(

Also sorry jaclaz, I didn't address your post.

Cannot really say, but that error should come out if the "root" files on CD are not found:
WIN51
WIN51IP
WIN51IP.SP1
WIN51IP.SP2


Yes, I had these files on the root earlier during my first try, but it didn't seem to be looking there.

Edited by porear, 09 November 2006 - 09:03 PM.


#21
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,859 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Start->Run and type E:\I386\winnt32.exe /noreboot


You should try using the syntax posted here:

http://www.msfn.org/...topic=77526&hl=

using the /makelocalsource should be the "missing" step.

jaclaz

#22
porear

porear

    Newbie

  • Member
  • 49 posts
  • Joined 10-August 04

using the /makelocalsource should be the "missing" step.

jaclaz


Wow that looks very promising. I'm off from work today, I'll give it a shot. Thanks very much for the tip.

Also have read some things that lead me to believe that copying SETUPLR.BIN to NTLDR may provide the appropriate NTLDR needed without doing the whole PEToUSB copy.

Will post results... fingers crossed.

#23
porear

porear

    Newbie

  • Member
  • 49 posts
  • Joined 10-August 04
Well, its working, but I don't think its correct. I'll post what I did and then my concern. I was using a Windows install CD in my drive E:.

1. Run a setup by E:\I386\winnt32.exe /noreboot /makelocalsource
2. Format USB drive with PeToUSB (but did not copy any build files - format only)
3. Copy directories C:\$WIN_NT$.~BT and C:\$WIN_NT$.~LS to the USB drive (takes a while)
4. Copy the following from C:\$WIN_NT$.~BT to the USB root \

TXTSETUP.SIF
NTDETECT.COM
SETUPLDR.BIN

5. Rename SETUPLDR.BIN on the USB root to NTLDR
6. Delete WINNT.SIF from \$WIN_NT$.~BT on the US drive

This last step is not necessary but otherwise the product ID and other info you provide in step 1 will always be used.

Very simple. The problem: does not work if you delete \$WIN_NT$.~BT\migrate.inf, and instead prompts for the install CD, even if the WIN51.IP tag files are placed on the USB drive.

migrate.inf is created in step 1 and seems to contain an enumeration of the mounted devices that setup sees when it is ran. My concern is that this then ties the installation to a specific hardware configuration and will not work on other machines. It works fine for re-installing from USB upon the machine for which migrate.inf was created.

How can this dependency be removed such that migrate.inf is either not needed, or is generic for all situations (not likely)? Thanks for the help!

I think I'll try simply formatting, copying the CD to the stick and perform steps 4 and 5. This takes out creation of and need for the migrate file.

#24
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,859 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
You might be interested in these:
http://support.micro...kb/234048/en-us
http://technet2.micr...3.mspx?mfr=true

It seems like a directive

"oempreinstall=yes"

in the answer file will avoid the creation of migrate.inf, but actually, as I see it, a form of "migrate.inf" might be necessary to provide for "correct" drive lettering on the installed system.

Using the method above, were you able to install on C: drive?

Which drive letter was given to the USB stick?

Just to keep things as clear as possible, with reference to my post here:
http://www.msfn.org/...mp;#entry563654

Until now you were exploring the possibilities of method #4, if you

I think I'll try simply formatting, copying the CD to the stick and perform steps 4 and 5. This takes out creation of and need for the migrate file.

you would "fall" in method #3, won't you?

If I am correct, some info in here might be of help:
http://www.911cd.net...o...c=17425&hl=

jaclaz

#25
porear

porear

    Newbie

  • Member
  • 49 posts
  • Joined 10-August 04
Think we may be on to something but I'm in the middle of a long file copy so I will catch things up here while waiting.

You might be interested in these:
http://support.micro...kb/234048/en-us
http://technet2.micr...3.mspx?mfr=true

Excellent references. Currently all new info to me and over my head, but I plan to go back and look at these in more detail.

It seems like a directive "oempreinstall=yes" in the answer file will avoid the creation of migrate.inf, but actually, as I see it, a form of "migrate.inf" might be necessary to provide for "correct" drive lettering on the installed system.

You may be right about the migrate.inf. It seems that to boot the CD installation, you must either use the original NTLDR or SETUPLDR.BIN renamed to NTLDR, since the boot sector is looking for NTLDR.

The problem with the original NTLDR is that it wants an associated boot.ini that points to where the boot should continue. When booting to an NTFS file system, the ARC naming convention must be used, e.g. multi(0)disk(0)rdisk(0)partition(1). When booting to a DOS boot sector, the drive letter can be used, e.g. C:\BOOTSECT.DOS="Win98". I do not know how to reference a USB stick for either of these scenarios or if it is possible, since you won't know what drive letter the target machine will assign to the USB stick at boot time (I am sure this can be controlled somehow).

This leaves the SETUPLDR solution, which seems to assume that you have already performed stage 1 of a setup, and have created an info store (migrate.inf) that will tell the setup how to continue.

The oempreinstall switch seems to be for unattended operations, and goes in a file called unattend.txt which I don't have since I'm not doing an unattended install. However, in my case I do seem to be utilizing the winnt.sif file, which looks like it is analogous to unattend.txt for my situation. I do not know if oempreinstall is a valid switch for winnt.sif but I will certainly be investigating this angle.

Using the method above, were you able to install on C: drive?
Which drive letter was given to the USB stick?

Yes, I was able to install to C:, and the USB was assigned drive F: (my CD ROM is E:, and my HD0 is partitioned C: and D: )

Just to keep things as clear as possible, with reference to my post here:
http://www.msfn.org/...mp;#entry563654

Until now you were exploring the possibilities of method #4, if you

I think I'll try simply formatting, copying the CD to the stick and perform steps 4 and 5. This takes out creation of and need for the migrate file.

you would "fall" in method #3, won't you?

I believe the method so far has been a bit of a combo of 3 and 4 since I was trying the FlyAKite usage of the stage 1 setup along with SETUPLDR.BIN. You're right though, if I could get this simple CD copy to work it would be much more in the #3 category. However, I've given it a shot, and ran right back into the problem that without migrate.inf, the installation will not continue and prompts for the setup CD, even if all the WIN51.IP tag files are in place on the USB.

Thanks for hanging with me on this one. It really does seem like what we are missing is only a simple switch somewhere. I believe the stick setup boot process is obtaining data per this flow:

Boot sector - NTLDR (copy of SETUPLDR.BIN) - TXTSETUP.SIF - WINNT.SIF and migrate.inf

I'll be back when there's more to tell after the file copy.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users