Jump to content

How to boot/install from USB key ?


Halfwalker

Recommended Posts

Yep, there might be some problem in the directories parsing, can you post the output of

findpart chsdir 2 0 1 1 >chsout01.txt

I just tried with "simple" directories with short names and no spaces in name, most probably the latter is the problem....

jaclaz

Link to comment
Share on other sites


Wow that's fast, worked great. ;) Output attached in two parts, the file was over the posting limit.

Also, just out of curiousity, I used dsfo to make an image of the first 700MB of the stick to my hard drive. Restoring the image takes only a few minutes (less than 5) but this method requires an additional 700M of storage. I am sure it would have taken considerably longer had the backup image also been on the stick, and of course twice as much space on the stick would be used. Not the preferable way to go.

Edited by porear
Link to comment
Share on other sites

I'll have a look at fixing the batch to "catch" the right directories.

Yes, DSFO, not having an option for starting from an offset, is not the right tool....

I was thinking about using dd for windows:

http://uranus.it.swin.edu.au/~jn/linux/rawwrite/dd.htm

which does have a "skip=" option

Or a combination of:

1) findpart putsect

2) piececopy:

http://www.inner-smile.com/dl_piece.htm

(don't be fooled by the screenshot, it can work even from command line....)

3) a batch to run the programs

The thing that still leaves me wondering, I'll have to do some tests about it, is where the files beyond the first (512bytes/sector/32bytes/sector=16 entries - 2 (. and ..) =14) are listed.....

jaclaz

Link to comment
Share on other sites

What version of dsfok do you have? I thought it was possible to start from an offset - I am using #4b. From the readme

Usage: dsfo source offset size destination

I've been researching to learn more about the FAT and directory structure on disk. Here are some good references. You may have found the same or very similar.

http://home.teleport.com/~brainy/fat16.htm

http://www.mcmillan.cx/fat.html

From what I gather, there is no central master table for entries other than the root. The rest are spread out over the disk. The FAT has a single entry for every cluster in the data section on the disk. The entry in the FAT for each cluster indicates whether the cluster has data, is unused, or is the last cluster for a file.

Directories are just a special file on disk with the table structure discussed in the second link above. An entry in the table points to the first block of data in the directory.

From the references, as I (think I) understand, FAT entries in these ranges mean the following

0000h available cluster

0002h-FFEFh next cluster (or first?) in file

FFF0h-FFF6h reserved cluster

FFF7h bad cluster

FFF8h-FFFF last cluster in file

If this is correct, we would need to parse the FAT, and look for all entries in the 0002h-FFEFh range that follow an entry that is NOT in the 0002h-FFEFh range. These entries will point to the first cluster of each file. The first byte in these clusters should be the first letter of each file name that will need to be backed up and restored. (This needs to be verified)

I also believe that for the situation to be this simple, we are assuming that files have no fragmentation and are completely contiguous. If not, we would have to follow the trail of the "next cluster" entries and where they point for the next piece of a file until we encounter a "last cluster" entry.

I hope that helps and perhaps provided something you didn't already know. I also hope it is all correct! :)

Idea: Maybe comparing before/after FATs will help identify pointers to the files that have been deleted, so that we only back up those that are necessary instead of all.

Update: Here is the FAT spec from Microsoft. Have not looked at it in depth yet but looks like it should answer all our questions. The pages are titled FAT32 but cover FAT12 and FAT16 as well.

http://www.microsoft.com/whdc/system/platf...are/fatgen.mspx

Edited by porear
Link to comment
Share on other sites

porear

thanks for the links I'll study them.

I thought it was possible to start from an offset - I am using #4b.

Well, no, from the same readme.txt:

2) dsfi

....

....

The offset argument has to be "0" with non-file objects.

If you have time/will to experiment with different "low-level" data copying program, here is a pretty much complete list:

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

The findpart putsect command should be more "accurate" as it works one sector at the time, also Roger Layton stated that he would implement in his MBRwiz a similar function, but even now, with 2.0 beta:

http://mbr.bigr.net/

http://www.geocities.com/mbrwizard/MBRWiz2.0.zip

http://www.geocities.com/mbrwizard/reference.html

one can use the /Sector - /Copy= and /Save= - /Restore= to achieve the same result.

jaclaz

Link to comment
Share on other sites

Sorry I've been unavailable for a few days. Thanks for the links jaclaz, I will give the tools a shot. I'll try to make sure they have the basic functionality needed, as well as try to test their relative performance (speed).

Link to comment
Share on other sites

Just a quick update, just to say that this has not been abandoned, though I had very few time to look further into the problem.

I'm a bit stuck at the moment.

On my test virtual drive, with a cluster of 8.192 bytes formatted as FAT12 under 2K, it appears that I can create (beginning from a 00ed drive, just formatted):

exactly 127 entries in a directory in root, 128th entry goes out of the cluster.

This makes sense, as directories "." and ".." entries take 32 bytes each, while the 127 files (LFN) take 64 bytes each, thus:

2*32+127*64=8.192

Problem is understanding where the 128th entry is made and where this address is referenced....

...it seems like the entry is simply appended at the end of the 127th file.

It seems like findpart finddir is not the right tool to find this address...

...however, I'll take my time over Christmas Holidays to see if I have an idea.... :rolleyes:

Stay well, see you on the beginning of january, Merry Christmas and Happy New Year. :)

jaclaz

Link to comment
Share on other sites

I have been out of town and this "hobby" has been overtaken by enjoying time with family :) However, certainly not abandoned, will be back in January as well.

Your findings are consistent with the Microsoft FAT spec

http://www.microsoft.com/whdc/system/platf...are/fatgen.mspx

FAT12 and FAT16 have a fixed root directory size, while FAT32 does not.

For FAT12 and FAT16 media, the root directory is located in a fixed location on the disk immediately following the last FAT and is of a fixed size in sectors computed from the BPB_RootEntCnt value (see computations for RootDirSectors earlier in this document). For FAT12 and FAT16 media, the first sector of the root directory is sector number relative to the first sector of the FAT volume:

FirstRootDirSecNum = BPB_ResvdSecCnt + (BPB_NumFATs * BPB_FATSz16);

For FAT32, the root directory can be of variable size and is a cluster chain, just like any other directory is.

I had assumed that this root directory limit would be enforced by the OS, and you would not be allowed to place more than the maximum entries in the root on FAT12 and FAT16. Maybe that is not the case. The answer is probably in the spec, which I'll look over more when I can.

In the mean time, have a wonderful Christmas and Happy New Year!! :hello:

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

Windows will not just install as it is off a USB Drive, as many people has said, it needs a CMD Windows of some sort to launch a simple batch file that will copy over all the files Format your HDD, then install with your winnt.sif or unattened.txt file. So you need to find something that will boot off it, or make your own Custom Boot image, that will launch the CMD window, (Such as a Windows 9x* Floppy Setup Disc). then run a batch script automatically from with in that CMD window, so setup can launch the winnt.exe file, i Know i have repeated wot i have said here, but i hope it makes sence, and that it helps you

Ethan. ;)

Link to comment
Share on other sites

Ethan,

you see, the method you described does work, here we are simply trying to see if ANOTHER method is possible.

See the original post:

http://www.msfn.org/board/index.php?showto...mp;#entry563654

where I gave numbers to possible options.

The one you suggested looks to me like method #1 or #2 (method #1 is fully documented in 10 steps in the given link - at the moment unavailable due to some problems on the 911CD board).

GOOGLE cache here:

http://209.85.129.104/search?q=cache:FUaFj...owtopic%3D16713

Writing a batch to automatize it should be trivial.

With all due respect, I don't think that simply stating taht another way won't work helps, if you can hint anything on WHY it wouldn't work, it would be much appreciated.

jaclaz

Link to comment
Share on other sites

I tried option #1 using FreeDos. I ran into more or less the same problems. Maybe that would give some hint to your very deep research.

PS:

Just a word of caution to anyone using method #1. Do not use FreeDOS. Use a DOS bootable disk derived from XP. Fdisk.exe in this has a limitation in changing the primary partition. Use fdisk.exe from FreeDos to overcome this problem. Do not use anyother files form FreeDos....

Link to comment
Share on other sites

I tried option #1 using FreeDos. I ran into more or less the same problems. Maybe that would give some hint to your very deep research.

PS:

Just a word of caution to anyone using method #1. Do not use FreeDOS. Use a DOS bootable disk derived from XP. Fdisk.exe in this has a limitation in changing the primary partition. Use fdisk.exe from FreeDos to overcome this problem. Do not use anyother files form FreeDos....

Yep,

FreeDos has some problems on some USB devices.

They are said to be fixable, as they appear to be related to Freedos drive geometry autodetect and to a "magic" byte that needs to be in the bootsector, makebootfat mentions this:

http://advancemame.sourceforge.net/doc-makebootfat.html

-E, --drive DRIVE

Set the BIOS drive to setup in the FAT boot sector. Generally this value is ignored by boot sectors, with the exception of the FAT12 and FAT16 FreeDOS boot sectors that require the correct value or the value 255 to force auto detection.

I never had problems with it on my particular hardware, but I can confirm that I received reports of failures with FreeDos from other people, whilst both "XP extracted" (read Millennium Edition) and Win98 Dos Files (IO.SYS, MSDOS.SYS, COMMAND.COM) work flawlessly.

Another hint, if you don't have a floppy disk drive on your PC (nowadays quite uncommon on laptops), extracting the DOS files from XP could be a problem, there are a few ways out.

1) Use VFD from Ken Kato:

http://chitchat.at.infoseek.co.jp/vmware/vfd.html

2) Use this program by codebeetle:

http://www.gocoding.com/page.php?al=bootflashdos

3) Use this method inspired by the StarMan, focused by yours truly and actually put together by Nuno Brito to just extract the files and later use the HP USB utility normally:

www.911cd.net/forums//index.php?showtopic=16745

(as soon as the 911CD forum works again, for the moment Google cache is here):

http://72.14.221.104/search?q=cache:DXfWKb...owtopic%3D16745

http://72.14.221.104/search?q=cache:dlc3nN...16745%26st%3D20

If you don't have a 98/ME bootfloppy around, the problem might be FORMAT.COM, that is in the XP DOS disk, INSIDE the DELETED file ebd.cab, see this:

http://www.911cd.net/forums//lofiversion/i...php?t18896.html

http://209.85.129.104/search?q=cache:uSdTU...p%3Ft18896.html

You will need a little knowledge using a data recovery program to get it.

Or, even better, get the enhanced FORMAT.COM by Petr:

http://www.msfn.org/board/index.php?showtopic=85573

jaclaz

Link to comment
Share on other sites

Happy New Year! :D Just dropping a quick note to say I'm still here and still have not abandoned this, but my time will be spotty for a bit. The wife is nesting, so I have quite a few home projects in progress, and I've also changed job assignments at work. Will contribute again as soon as possible.

Link to comment
Share on other sites

  • 2 weeks later...
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.

[-snip-]

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.

[-snip-]

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!

Ok, I figured out a MUCH simpler method for getting NTLDR, and for getting one that doesn't point to \minint assuming you have the prereqs.

NOTE: I havent finished my testing yet as I am remaking my installdir right now with the new patches, so if there is something that comes up later on in setup due to this then shoot me a PM so I know.

Prereqs:

- WinImage (http://www.winimage.com) (the shareware version works fine for this)

- Bart's mkbt

- A working copy of XP

- The 6 boot floppy images from the Original XP Install CD

1) Open WinImage

2) Click the Disk menu, and select Edit Master Boot Record Properties

3) Check the checkbox Include non removable Hard Disks

4) Select the Hard Disk that XP is installed on (Usually Disk 1), and click Save

5) Give the bootsector a name and save somewhere you can find it (I save it to the mkbt directory with the name bootsect.bin)

6) Open a command prompt and switch to the directory mkbt is in

7) Run mkbt as follows:

mkbt -x bootsect.bin j:

NOTE: Make sure you insert the path to the bootsector file if it is not in the mkbt folder. Make sure you change bootsect.bin to the proper file name. Make sure you change j: to the proper drive letter for your USB drive, else you will overwrite the wrong bootsector and MAY not be able to boot back into XP

8) Within WinImage, hit File -> Open and select the first XP Setup Disk image.

9) Copy all of the files there to the root of your USB Drive

10) Open your USB Drive in explorer, and rename SETUPLDR.BIN to NTLDR, and move BIOSINFO.INF to a new folder named $WIN_NT$.~BT

11) Open each of the other Disk Images, and copy all of the files in them to the $WIN_NT$.~BT folder in the root of your USB Drive.

The rest I have not finished testing, I will edit this post once I figure out where to put the rest of the CD files.

Edited by Speeddymon
Link to comment
Share on other sites

  • 4 weeks later...

I have a question, why not just use ISOBuster and copy the XP CD to the USB key? There are at least two ways of doing this,

First method is just open ISO Buster and copy XP to the USB key and be done with it. Make sure you just copy the files and not create an ISO on the drive, this will give you basically a CD on the drive and it will be seen as a USB CDROM drive.

Second method:

requirements:

NOTE: These instructions are going to assume you're trying to create the Windows XP Profesional x32 SP2 cd from the Windows XP Professional x32 GOLD (Original CD.) SP1/1a and other flavors will be slightly different.

NOTE: You must have time to do this as well...

NOTE: ISOBuster is what I am using, you can use any software which allows you to see the hidden "Booable CD" folder on the O/S disk to do this with, I highly reccomend ISOBuster though. This is a major requirement!

1. Operating System Disk (OEM may work, but one from Dell, HP, Compaq, etc may not)

2. XPSP2.exe file which contains your SP2 slipstream information.

3. RyanVM's Update Pack.

4. Siginet's RyanVMIntegrator.

5. Your drivers if you want to add them.

6. Any applications from RyanVM's site, including his forums.

7. The "Labels.txt" file from the forums here. Make sure you know what the "name" of the CD you're going to create otherwise you "can" use any other name but these instructions will give you a proper looking Windows O/S CD/DVD when you're done.

8. The script below.

9. The instructions over at RyanVM's forums as well as at Unattended.msfn.org

10. A copy of these directions...

11. CDImage.exe and the code below or an ISO creator of your own choosing that can take those commands.

12. Did I mention time?

Step 1.

Grab your labels.txt file and look up the name of the operating system you're going to create.

Step 2.

Keep in mind here "HDD" is the drive location that you are working from it should have at least 10GB of working space on it for this, also the name of your O/S your going to create as well.

Using that information create HDD:\VRMPFPP_EN. You'll want to substitute the name from the labels.txt file, of the O/S you're going to create here.

Step 3.

Put the Windows GOLD cd into your optical drive and open ISOBuster.

In ISOBuster find the folder with the name of your CD on it, it should be red, right click on it and click on "Extract WXPFPP_EN".

It will ask you where you want it to be saved, point it to your HDD:\VRMPFPP_EN folder and let it copy it's contents inside that folder.

Do the same thing for the "Bootable CD" folder.

post-23860-1171019903_thumb.png

Shows what it should look like when you right click on the folder and highlights the line you need to click on.

post-23860-1171019914_thumb.png

Shows what it should look like when you go to save it and the directory structure on the disk after a save of both folders on the CD. NOTE HERE that I am using an SP2 cd to copy to that location, the Gold and SP1/1a disks will have a different folder name such as "WXPFPP_EN" for the GOLD edition, you'll want to change that folders name before you create the SP2 ISO to "VRMPFPP_EN", or one of the other names if your going to be building a different O/S. You'll also need to make the changes to the CDImage script below but that is beyond this tutorial.

Step 4.

Open the folder HDD:\VRMPFPP_EN and check that you have two folders in there. Rename the WXPFPP_EN folder to VRMPFPP_EN. Now open that folder up, you should see the directory structure that you normally see on your CD.

Step 5.

Run RyanVM Integrator to Slipstream in SP2, add the RyanVM UpdatePack, and any programs you may want to add. This will take a while to do, so take yourself a break for a while while it's doing it's thing...

*You can find the directions for using this over at his forums.

*Your folder your going to be copying to is located at HDD:\VRMPFPP_EN\VRMPFPP_EN if you've done what I have said thus far.

Step 6.

Add your drivers using the directions over here at Unattended.msfn.org. (I reccomend the $OEM$ setup at the root of the VRMPFPP_EN folder.)

Folder structure at this point:

.\VRMPFPP_EN

.\VRMPFPP_EN\VRMPFPP_EN\

.\VRMPFPP_EN\VRMPFPP_EN\$OEM$

.\VRMPFPP_EN\VRMPFPP_EN\i386

(those are the two most important in that folder but search for reasons and how to do it that way technically there will be more directories here but I'm abrieviating this for sake of longevity.)

.\VRMPFPP_EN\Bootable CD

Step 7

Using the script below in the code, create the CDIMAGE.CMD file and put it next to your CDIMAGE.EXE file and run it. Be sure you have made whatever modifications you need first as there will be different names for different O/S's that need to be there.

CLS
@echo off
TITLE Creating ISO Image of Windows XP Professional SP2
ECHO.
ECHO CDIMAGE.CMD
ECHO Builds a Windows XP Professional SP2 x32 edition CD/DVD.
ECHO If you're using another operating system, change the -l, -t, -b, -m, and the locations below.
ECHO See your ISOBuster screen for the information needed as well as label.txt for new label.
ECHO Close this if you've not already made those changes, otherwise hit any key to continue...
PAUSE
ECHO Removing any possible attributes set on your XP CD/DVD build and its subfolders...
attrib -R -A -S -H Drive:\VRMPFPP_EN /S /D
ECHO.
ECHO Creating ISO for you get yourself a sandwich while you wait...
CDIMAGE.EXE -lVRMPFPP_EN -t08/04/2004,08:00:00 -h -j1 -b"DRIVE:\VRMPFPP_EN\Bootable CD\Microsoft Corporation.img" -x -m DRIVE:\VRMPFPP_EN\VRMPFPP_EN DRIVE:\VRMPFPP_EN.ISO -yt0000
ECHO.
ECHO All done, burn this baby now and try it out!
PAUSE
EXIT

Step 8.

Now you have an ISO that you can open in a VM and check out to assure it's working, with the exception of the drivers. I reccommend this step but you don't have to do it if you know what you're doing and realise that you're not going to be able to get back to the desktop without going the long route if you don't have a second machine to revise the build on.

Once you have checked out your ISO file, Open ISOBuster back up, click on "File" and then click on "Open Image File" and locate the ISO you just created. From that ISO, copy everything to the root of your USB key using the instructions in Step 3 above.

Step 9.

After the copy process has stopped on the USB Key use "Safely Remove.." to remove the key and after a brief wait, (aprox 10 secs or so,) plug the key back in and see if you don't have XP come up like it would normally if you had inserted it in a Optical Drive.

Step 10.

Assuming it did, remove all optical disks and reboot into your BIOS, (search how to do this for your machine...)

In the BIOS, look for the settings for "Boot Order" change it so that you're booting from the USB-CD, you may have to make a change in your USB settings there to find it.

After you have found it, save and exit the BIOS.

Step 11.

You should have booted up into your installation at this point, skip it for now...

Once back to your desktop, open your VM again and check that it recognises your USB key and try the install through it first. If this works then reboot again and let it run...

If it doesn't run in VM, then you need to go and check that everything you did was correct, checking all your modifications for typo's, etc. Try it from the ISO and if everything works from that, then debug your key's files.

If that's not the case make sure you set the BIOS up correctly and that it is recognising your USB key as a USB-CD, if not you're going to have to find another method to doing this or upgrade your system. (Most likely you need an upgrade to your system.)

Step 12.

You should be at your desktop at this point and able to see that you don't have any or very many updates from MicrosoftUpdate and all your drivers and most if not all your programs should be installed as well as any settings you made during the creation process should be set.

If so, congradulations you're done!

If not, did you use the VM check in the last step?

If not, and even if you did in some cases, go back and reread all the instructions and check everything you did looking for any typos and that everything was saved correctly. Also make sure of your settings that you set everything up correctly in the .sif, inf, ect files as well as placed everything where it's supposed to go. Again even if there's nothing wrong with what you did, you're probably going to need an upgrade to your system. Do a search to debug all of this.

This seems harder than it really is though and a lot of the questions are answered in these forums or over at RyanVM's forums, some cases both. If everything went well for you, congrats you're now a proud owner of a slipstreamed version of your operatng system with the latest drivers, updates, etc that you can modify at any time and keep updated for your system on your USB key. If your doing multi-O/S installs, you should be able to do them on here as well and have more space for those extras that you would have liked to have used if you had a larger DVD to do them on.

Edited by DisabledTrucker
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...