Jump to content

How to boot/install from USB key ?


Halfwalker

Recommended Posts

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/page.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:

Link to comment
Share on other sites


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/forums//index.php?showtopic=16381

http://www.911cd.net/forums//index.php?sho...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/board/index.php?showtopic=58410&st=0

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Update edit - still not fully working yet, see post below.

:thumbupI 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.com/page.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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

You might be interested in these:

http://support.microsoft.com/kb/234048/en-us

http://technet2.microsoft.com/WindowsServe...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/board/index.php?showto...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/forums//index.php?sho...c=17425&hl=

jaclaz

Link to comment
Share on other sites

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.

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/board/index.php?showto...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.

Link to comment
Share on other sites

Getting close. First, some info.

The format and info for winnt.sif is indeed the same as for unattend.txt.

Oempreinstall is not really valid for what we are trying to do. It is used during unattended install to setup other vendor and install-specific programs and drivers during install. These are placed in a setup $oem$ folder. From the deployment tools help file,

Syntax OemPreinstall = Yes | No

Yes

Setup copies the subfolders and files contained in the \platform\$oem$ folder.

No

Setup does not copy these files.

I followed the steps again from the previous post, only this time I removed migrate.inf, but not winnt.sif

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 migrate.inf from \$WIN_NT$.~BT on the USB drive

Things work fine. The problem now is, that during install, as the extra files created in step 1 by the /makelocalsource switch are copied to the hard drive, they are deleted from the USB stick.

I am sure there is a switch to prevent this, but for now I've got to run out to dinner. It looks like the solution will lie in the TXTSETUP.SIF file.

Edited by porear
Link to comment
Share on other sites

To avoid the problem of steps 4 and 5 above, you can try using Grub4DOS to chainload SETUPLDR.BIN directly.

This would give you also more options when booting, say, access to a DOS or Linux boot, etc.

All you need to do is copying to the root of the stick grldr (from the grub4dos package), rename it to NTLDR and add a menu.lst with this entry:

# This loads SETUPLDR.BIN in /$WIN_NT$.~BT

# from the current root (the device you booted from)

chainloader /$WIN_NT$.~BT/SETUPLDR.BIN

Get grub4dos here:

http://grub4dos.jot.com/WikiHome

Search posts by me on 911cd forum with text "grub4dos" for some examples and tips.

Things work fine. The problem now is, that during install, as the extra files created in step 1 by the /makelocalsource switch are copied to the hard drive, they are deleted from the USB stick.

GOOD! :)

I'll have a look too if I can find a way to avoid deletion of that....

jaclaz

Link to comment
Share on other sites

To avoid the problem of steps 4 and 5 above, you can try using Grub4DOS to chainload SETUPLDR.BIN directly.

Thanks I might give Grub4DOS a shot. I've used BootitNG for multibooting USB before and was expecting to try it. I was trying to establish a working standalone project before adding the other boot loader, but maybe I should go ahead and add that piece now.

Thanks! :)

Link to comment
Share on other sites

Ugh. I am trying my best to only vary one thing at a time but somehow another detail slipped through, and I'm not sure how I got past it before. When setup copies the files from the USB to the HD, it sets up the next boot from the HD for the GUI portion of setup to continue. This is done in boot.ini on the HD.

When installing from the USB stick, it thinks the USB is HD0, and that the HD being installed to is HD1. So, the new boot.ini entry is

multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP Professional"

when removing the USB stick to reboot for Windows GUI setup, your HD becomes HD0, so the boot.ini entry needs to be

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional"

for it to work. Another minor detail. I would think this could either be fixed by

1. config setting during setup to explicitly state what the boot.ini entry should be, or

2. at the end of text setup run a simple batch or command file that edits boot.ini, or

3. use a USB drive boot manager to make sure the HD on which Windows will be installed is always seen as HD0 by the USB drive, which can then be assigned HD1 (or HDx)

I don't know which of these are possible or which would be simplest. I truly believe this issue and the USB setup file deletion at copy are the last two hurdles (but I could be wrong?) :unsure:

Link to comment
Share on other sites

When installing from the USB stick, it thinks the USB is HD0, and that the HD being installed to is HD1.

Yep, that is what made me ask before which letter was assigned to the HD, booting from the stick automatically makes it first drive.

2. at the end of text setup run a simple batch or command file that edits boot.ini,

If the drive lettering ( C: ) of the hard drive is correct, thus should be the easiest solution.

Please find here a small batch and some useful info to that effect:

http://www.msfn.org/board/index.php?showtopic=66101&hl=

3. use a USB drive boot manager to make sure the HD on which Windows will be installed is always seen as HD0 by the USB drive, which can then be assigned HD1 (or HDx)

You can try using Grub4DOS to map the stick as another HD or even FD, something along the lines of:

map --read-only (hd0,0)+1 (fd0)
chainloader (fd0)+1
rootnoverify (fd0)
boot

maybe mapping it as read-only will prevent deletion of the files.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...