Jump to content

How to boot/install from USB key ?


Halfwalker

Recommended Posts

So, strangely enough.. I have found a bug perhaps.

I believe it is hardware specific though.

I have a Corsair Flash Voyager 4gb usb stick.

One of its features is wear leveling.

http://www.corsair.com/_faq/FAQ_flash_driv...ar_leveling.pdf

After doing several reads and writes and modifications to the files on this usb stick, it somehow became unbootable.

Since the ntldr is geometry specific, and this drive moves data around for wear leveling, I belive its somehow related.

Solution, please make it possible to rewrite the mbr and extract the bootsector without having to format.

Link to comment
Share on other sites


After doing several reads and writes and modifications to the files on this usb stick, it somehow became unbootable.

Since the ntldr is geometry specific, and this drive moves data around for wear leveling, I belive its somehow related.

Solution, please make it possible to rewrite the mbr and extract the bootsector without having to format.

ntldr is not geometry specific and it is unlikely that the NTLDR Bootsector of the USB-stick has changed.

You can use HDHacker to Save and Write the USB-stick Logical Drive bootsector

http://dimio.altervista.org/eng/

The files NTLDR, ntdetect.com, boot.ini and SETUPLDR.bs ( =Bootsector file for launching TXT Mode XP Setup)

are essential for booting. Check if they are still present on the USB-stick.

These files might be corrupt or there position on the stick might give the boot problem.

Tiny Hexer has an option Compare to check if the files are corrupt

http://www.mirkes.de/en/freeware/tinyhex.php

The position of files on the USB-stick can be analysed with WinHex using 1stSector column

http://www.x-ways.net/winhex/

wimb

Link to comment
Share on other sites

Rats.. I just ordered a Corsair GT 4Gig just for this.

Guess I'll find out if "wear leveling" is an issue when it gets here.

By reading the doc though it doesn't look like it should be an issue.

The addressing of data is the same to the computer, it's the lookup table

in the stick itself that does the remapping and is supposed to be

transparent to the system.

It isn't doing this at an OS/FS level.

But we shall see.

Edited by signal64
Link to comment
Share on other sites

I haven't had the chance to investigate any further but I should have some time in a few days.

I have another question though, I noticed with the scripts there are a bunch of $OEM$ and registry files.

But I have noticed they do not copy (nor does my OEMinfo.ini and OEM.bmp)

There seems to be a discrepancy in which option in the winnt.sif that copies files from the $OEM$ folder.

Its supposed to be OEMPreinstall option - the one that breaks F6 compatibility.. but..

In fact I made a cd with Nlite to see what was going on, and it still didn't copy those files.

Very strange.

Link to comment
Share on other sites

I have another question though, I noticed with the scripts there are a bunch of $OEM$ and registry files.

But I have noticed they do not copy (nor does my OEMinfo.ini and OEM.bmp)

There seems to be a discrepancy in which option in the winnt.sif that copies files from the $OEM$ folder.

Its supposed to be OEMPreinstall option - the one that breaks F6 compatibility.. but..

In fact I made a cd with Nlite to see what was going on, and it still didn't copy those files.

I think the winnt.sif file in your XPSOURCE\I386 folder contains an [unattended] Section with OemPreinstall=Yes

which [unattended] Section should be removed completely for making XP LocalSource for bootable USB-stick,

which will be nevertheless suitable for UNATTENDED INSTALL !!

When the [unattended] Section is present, an empty $OEM$ folder wil be made in the $WIN_NT$.~LS folder.

I am using RyanVM Integrator and have not all the knowledge about what NLite is doing with $OEM$ folder.

May be ilko_t can comment on that.

If an EXISTING (empty) $OEM$ folder is detected in the $WIN_NT$.~LS folder of the TEMPDRIVE,

then the $OEM$ folder of usb_prep5 folder is not copied to the $WIN_NT$.~LS folder of the TEMPDRIVE.

This was introduced on request of ilko_t in relation to using NLite, see:

http://www.msfn.org/board/boot_install_USB...html&st=360

Anyway it is very good to check the composition of your $OEM$ folder in the $WIN_NT$.~LS folder of the TEMPDRIVE

before the FileCopy to USB-stick begins.

Help_usb_prep.txt

UNATTENDED INSTALL: use winnt.sif for making LocalSource Windows XP for bootable USB-stick

Change file winnt_sif.txt to your needs and COPY in XPSOURCE\I386 folder as file winnt.sif

Use for Preparing USB-stick Only winnt.sif file without an [unattended] Section.

Edit 24-10:

The problem when an empty $OEM$ folder is detected in the $WIN_NT$.~LS folder of the TEMPDRIVE,

which blocks the copy of the $OEM$ folder from usb_prep5 folder, can be overcome by using in the usb_prep5.cmd

program a different markerfile e.g. CMDLINES.TXT in $OEM$ folder , instead of the $OEM$ folder itselves.

I will change that in the next version. That covers better the different cases.

Edit 25-10:

It is the posisition of the $OEM$ folder in the XPSOURCE which plays an interesting and important role.

If $OEM$ is located outside i386 folder in XPSOURCE , which is normal for an XP Setup CD,

then it is not used in making a LocalSource and [unattended] Section with OemPreinstall=Yes

will generate an empty $OEM$ folder in the $WIN_NT$.~LS folder of the TEMPDRIVE.

But when $OEM$ is located inside i386 folder in XPSOURCE , then [unattended] Section with OemPreinstall=Yes

will use this $OEM$ folder to generate a correct $OEM$ folder in the $WIN_NT$.~LS folder of the TEMPDRIVE.

However, the best way is to use $OEM$ folder from usb_prep5 folder and adapt it to your needs and keep it there.

Remove completely in winnt.sif file the [unattended] Section with OemPreinstall=Yes

and place winnt.sif file in XPSOURCE\I386 folder. Then there is no problem at all :)

wimb

Edited by wimb
Link to comment
Share on other sites

Rats.. I just ordered a Corsair GT 4Gig just for this.

Guess I'll find out if "wear leveling" is an issue when it gets here.

By reading the doc though it doesn't look like it should be an issue.

The addressing of data is the same to the computer, it's the lookup table

in the stick itself that does the remapping and is supposed to be

transparent to the system.

It isn't doing this at an OS/FS level.

But we shall see.

Correct :), the "wear leveling" thingy does NOT affect the position of files on the stick (as seen by the OS), but other things may cause it, most probably previously deleted/overwritten files, incorrect order when copying files to it, and what not.

In the famous "Dietmar's Thread" on 911CD, experiments proved that the best way to make sure that USB booting procedure is to start from a "wiped" drive, though noone was able to pinpoint the actual cause of the occasional failures.

However, there is no need to write 00's or (better) F6's to the whole device, but doing so for the first, say, 100 sectors, i.e 51200 bytes, should ensure that there are no "leftovers" that can cause problems to filesystem.

jaclaz

Link to comment
Share on other sites

Still waiting for the Corsair GT to get here so in the meantime decided to try this out on a generic PQI 4GB stick.

1. The text mode copy took about an hour.

I bench'd the stick on the same system prior to the install and got 12MB reads.

While not great, it seems it shouldn't have been that slow on the copy.

I saw another reference here to larger sticks and fat32 being slow.

The total space being used on the stick now is 522MB so going to try to partition it as 700MB with FAT16 for grins.

2. The key doesn't show as C: during the partition portion of the setup.

Think this lead to the boot.ini issues that showed up after text mode install.

And yes, I'm making sure the boot selection of the stick is done in BIOS.

Stick was never removed.

What's also kind of odd is when the stick had a dos image on it, it did boot up as C:

System Info:

Abit NFM2 - BIOS 214

Single PATA with 2 partitions (30Gig primary active + 200Gig primary)

During text mode setup I deleted the 30Gig partition and selected it to install on.

When text mode finishes, reboot, and select GUI, I got an error that is a bit misleading. "missing <Windows root>\system32\hall.dll" due to boot.ini telling it to look at the other partition (which has NTFS on it).

I had to set the boot.ini GUI line to partition 2 (original had 1) on the stick for it to work. And of course it errored out trying to put a boot.ini on the hdisk after login. Had to manually put one on.

The resulting install did end up with a C:

So it looks like to setup I have 2 partitions but it's treating the second as C: and the first as D: which is weird (c: was partitioned first).

I'm backing up the D: partition and going to nuke both and try again.

So while off to somewhat of a rough start I have some things to try.

Edited by signal64
Link to comment
Share on other sites

1. The text mode copy took about an hour.

I saw another reference here to larger sticks and fat32 being slow.

The total space being used on the stick now is 522MB so going to try to partition it as 700MB with FAT16 for grins..

The Program asked you to do:

	  First Format to Make Bootable USB-stick with NTLDR Bootsector Using:
PeToUSB.exe OR HP USB Disk Storage Format Tool Version 2.0.6
Settings PeToUSB: Enable Disk Format with LBA FAT16X

Did you use PeToUSB to Format the USB-stick with FAT16 ?

2. The key doesn't show as C: during the partition portion of the setup.
This is Normal, the USB-stick will normally get U: and otherwise it will get D: if you did not select to change migrate.inf
What's also kind of odd is when the stick had a dos image on it, it did boot up as C:
This is Normal, when booting with MS-DOS from USB-stick seen as Harddisk.
Single PATA with 2 partitions (30Gig primary active + 200Gig primary)

During text mode setup I deleted the 30Gig partition and selected it to install on.

When text mode finishes, reboot, and select GUI, I got an error that is a bit misleading. "missing <Windows root>\system32\hall.dll" due to boot.ini telling it to look at the other partition (which has NTFS on it).

You should NOT Delete the Active Partition having DriveLetter C:

Just Select the partition C: as the partition on which you are going to Install Windows XP,

and then Select Quick Format with NTFS FileSystem.

There is no need at all to Delete Partitions.

If you Delete and Create New partitions, you have to Finish with F3 and Boot from USB-stick again and

run 1. TXT Mode Setup again so that DriveLetters get their correct value, just as for a new harddisk

Help_usb_prep.txt

For a brand new harddisk Reboot the computer after creating partitions with TXT mode Setup.

So in this case one boots twice in the TXT-mode Setup,

so that after the reboot drive letters get their correct value.

Edited by wimb
Link to comment
Share on other sites

The Program asked you to do:

	  First Format to Make Bootable USB-stick with NTLDR Bootsector Using:
PeToUSB.exe OR HP USB Disk Storage Format Tool Version 2.0.6
Settings PeToUSB: Enable Disk Format with LBA FAT16X

Did you use PeToUSB to Format the USB-stick with FAT16 ?

For whatever reason you can't use FAT16 on this 4GB stick (or the Corsair 4GB - it just arrived) using the HP USB Disk Disk Storage Format Tool. I had ignored the FAT16 requirement mentioned for PeToUSB as being needed for all and didn't see it as a requirement.

PeToUSB did format the sticks as FAT16.

Suggestion for a change to the wording to:

BEFORE YOU START - Make sure you have a FAT16 formated USB-stick using the HP USB Disk Storage Format Tool or PeToUSB.  Make sure you use "Enable Disk Format with LBA FAT16X" when using PeToUSB.

or something similar. It might make it even better to mention up front you can't use some 4GB with the HP Tool (and obviously larger sticks will need some extra work).

If you Delete and Create New partitions, you have to Finish with F3 and Boot from USB-stick again and run 1. TXT Mode Setup again so that DriveLetters get their correct value, just as for a new harddisk

Ok - seemed to have missed that bit in the doc.

Link to comment
Share on other sites

@signal64

FAT16 is for USB boot compatibility and sometimes speed. If FAT32 works for you, that's ok.

About slow speed- 1) check your USB speed settings in BIOS and 2) do some benchmarks with small files, the speed you mentioned is probably valid ONLY for large files. A few posts before (post #386) you will find link to a good program, it will tell you how fast your stick is with small files, like the most of source files are.

Edited by ilko_t
Link to comment
Share on other sites

At times I have seen some boards running USB 1.0 speed with certain USB CD drives when installing Windows.

This is even though USB 2.0 is enabled in BIOS so was wondering if that was the issue in this case.

I used bench32 for the speed test I mentioned earlier.

Here's the results on my victim Abit NFM2 system I'm testing the install with.

PQI 4GB:

http://img206.imageshack.us/img206/8015/000001vb3.jpg

And for grins the Corsair 4GB Voyager GT:

http://img141.imageshack.us/img141/7081/000002go1.jpg

Now that things are clearer I did a quick install with the Corsair (FAT16) and text mode took about 15min to copy.

I wasn't timing it closely as I was just seeing if it would work at this stage.

If anyone is interested I'll do some comparison testing (and timing things closely this time) with FAT32/FAT16 on these sticks with a 680i motherboard.

Need to load that puppy up again tomorrow.

Edited by signal64
Link to comment
Share on other sites

:thumbup

Finally got it working with USB hard drives.

Dummydisk.sys was remade, many many thanks to Anton Bassov, who responded to my emails and gave the hint what had to be changed in source code, despite being a single statement. :blushing:

The new rdummy.sys worked fine loaded from txtsetup.sif :) , USB hard drives are now seen as removable, thus having lower priority when getting drive letters. To be tested on other machines and sources.

Without rdummy.sys:

img0939sc8.th.jpg

With rdummy.sys:

img0940rz7.th.jpg

Furthermore- Setup considers it as critical SCSI driver and adds it as service in the new installation starting at boot time. Every USB hard disk attached is seen as removable. This is not wanted, will be taken care of.

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\rdummy]
"Type"=dword:00000001
"Start"=dword:00000000
"Group"="SCSI miniport"
"ErrorControl"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\rdummy\Enum]
"0"="Root\\LEGACY_RDUMMY00"
"Count"=dword:00000001
"NextInstance"=dword:00000001

A little bug in the driver- if during Txt Setup when disks are detected and/or format or repartitioning performed, quit by pressing F3 causes BSOD, without any harms though. The driver doesn't have unload functionality, I believe that's why, may be Anton or anyone else familiar with this matter could add such.

If Setup is let to finish copying files and restart everything is fine, no BSODs, unattended install was performed without any glitches with XP SP2 source. Boot.ini and source folders are as with USB sticks.

Next days I'll add the necessary changes to the bat files, wimb already included an excellent help file so not much left to be done here.

A few more results:

Make small (15MB) image file, mount it as disk, copy boot files there ($win_nt$.~bt folder, setupldr.bin, ntdetect.com and txtsetup.sif in root), use Grub4Dos to mount it as fd0- no go, Setup starts, but cannot find biosinfo.inf in $win_nt$.~bt. Grub4Dos floppy is ignored, why it searches in $win_nt$.~bt? TXT Setup considers it as hard disk. Copy all files for ~BT folder to root- same result.

Mount it as non- existing HD- hd5. Same story, in previous tests I found that setup insist on having all boot files on first HD or complains about biosinfo.inf

setupldr.bin in 6 XP boot floppies differs from normal XP setupldr.bin. Using it didn't help, neither disk101 marker files.

I've tried also to speed up USB boot, moving usbstor.sys, disk.sys and all usb drivers to earlier stages, like in [bootBusExtenders], this didn't help. It seems like Setup loads all drivers, but actually starts them when "WINDOWS IS STARTING" is displayed. I've read similar statement in the past, no idea where it was.

Regards,

ilko

Link to comment
Share on other sites

:thumbup

Finally got it working with USB hard drives.

Dummydisk.sys was remade, many many thanks to Anton Bassov, who responded to my emails and gave the hint what had to be changed in source code, despite being a single statement. :blushing:

The new rdummy.sys worked fine loaded from txtsetup.sif :) , USB hard drives are now seen as removable, thus having lower priority when getting drive letters. To be tested on other machines and sources.

The Batch Program usb_prep6.cmd was further improved:

- More Help at Begin and End of the Program

- Delete of tempimage.img needs now User Approval

This is good in view of the possibility to use tempimage.img again for copy to USB-stick

- $OEM$ folder is now only copied if CMDLINES.TXT does not Exists already in LocalSource on TEMPDRIVE

The Attachment gives the new version in the usb_prep6.zip file :)

@ilko_t

Congratulations with the possibility to use USB hard drives in future versions. :thumbup

I hope that you can use this new version of the Batch Program for

adding the necessary changes to the bat files for support of rdummy.sys

Regards,

wimb

usb_prep6.zip

Edited by wimb
Link to comment
Share on other sites

A few more results:

Make small (15MB) image file, mount it as disk, copy boot files there ($win_nt$.~bt folder, setupldr.bin, ntdetect.com and txtsetup.sif in root), use Grub4Dos to mount it as fd0- no go, Setup starts, but cannot find biosinfo.inf in $win_nt$.~bt. Grub4Dos floppy is ignored, why it searches in $win_nt$.~bt? TXT Setup considers it as hard disk. Copy all files for ~BT folder to root- same result.

Mount it as non- existing HD- hd5. Same story, in previous tests I found that setup insist on having all boot files on first HD or complains about biosinfo.inf

setupldr.bin in 6 XP boot floppies differs from normal XP setupldr.bin. Using it didn't help, neither disk101 marker files.

That's strange, I have small HD images of recovery console working allright, directly or from grub4dos, both "directly" and using the 2003 RAMDISK.SYS to boot them.

I have experimented with /minint, /CMDCONS and $win_nt$.~bt

(but this works with image mounted as HD0)

Some info is on this thread:

http://www.boot-land.net/forums/index.php?...=2692&st=10

Most probably it won't work on "FD" type of image, but maybe one can use once again the grub4dos mapping features to exchange drives?

Can you post a DIR /S>Setupdir.txt of your 15 Mb image?

I'll see if I can re-create it in a way that it works.

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...