Halfwalker

How to boot/install from USB key ?

486 posts in this topic

@Ilko_t

Don't misunderstand me. I appreciate all your testings and findings.

I'm slitting myself:

At testing machines insane approaches are allowed, e.g. two USB sticks.

All data may be destroyed.

At testing machines I like grub4dos map and boot.ini signature.

I haven't understood BIOS, grub4dos and windows setup behaviour fully.

Contrary a final solution has to work at unknown machines too.

No partiton or data is destroyed.

At unknown machines I like a low risk solution.

Currently that's avoid grub4dos map. Boot.ini may have to be manually edited.

If there is a secure map solution, I happily change my mind and use this solution.

Thanks for migrate.inf scripting report.

First version is more a basic test version. Yes write-protect entries can be added.

I've limited free time: no further testings and no development so far.

0

Share this post


Link to post
Share on other sites

@ilko_t

Newish release of grub4dos has introduced a couple new commands:

******************************************************************************

*** Newly implemented operators `&&' and `||' ***

******************************************************************************

This implementation is very simple. It does not handle operator nesting.

Usage of `&&':

command1 && command2

Description:

If command1 returns true, then command2 will be executed.

Usage of `||':

command1 || command2

Description:

If command1 returns false, then command2 will be executed.

Examples:

is64bit && default 0

is64bit || default 1

This could be the way to introduce "automatic" selection of the grub4dos menu.lst entry during first and second boot.

jaclaz

0

Share this post


Link to post
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

I've used this method myself before, successfully. But when you try to install via these same files onto another pc, you get hardware BSODS - so that's why I just use the winnt.exe from dos.

You seem to be missing some crucial files in this method - when i did this, i just used the hp drivekey utility, and then do winnt32.exe and then copy the 2 folders over to my usb drive, along with ntldr (the pe2usb version, but it works with the normal version anyway as your usb key gets treated as a harddrive!), and a file called $LDR$, and boot.ini that points to bootsect.dat). Also you need txtsetup.sif in the root where $LDR$ is and so on otherwise setup wouldn't start for me! I might be forgetting some files here - oh yeah, you need ntdetect.com. (is that all?)

To be honest, i find it much easier installing using winnt.exe. :)

Edited by snowden
0

Share this post


Link to post
Share on other sites

snowden,

sorry, but evidently it's you that are missing something, like a few months work by several members. ;)

The initial "normal" way by porear you are referring to, due to the deletion of some files (and some other minor things) did work only once.

The new "final" method, thanks to ilko_t and cdob is repeatable:

http://www.msfn.org/board/index.php?showto...1384&st=128

(previous posts are to be considered obsolete by the above one)

As said in the other thread I too find the WINNT.EXE method better, but I personally have on ALL my machine a 1 Gb FAT16 partition as First Active Primary.

And, as said, speaking of nliting, removing WINNT.EXE install support makes the build smaller.

jaclaz

0

Share this post


Link to post
Share on other sites
The new "final" method, thanks to ilko_t and cdob is repeatable:

http://www.msfn.org/board/index.php?showto...1384&st=128

Thanks a lot to porear and jaclaz, ilko_t and cdob :D

The method that ilko_t described for installing Windows XP from a bootable USB-stick works perfect !

I have used an Apacer HT203 1GB USB-stick and Windows Setup on my laptop took only about 30 minutes !

The GRUB4DOS grldr was complaining about the CHS values of the USB-stick obtained from my BIOS,

but the warning was no problem for beginning Windows Setup.

There were some small differences with the normal setup from CD.

I obtained an extra file NTBOOTDD.SYS in the root of my C-drive,

which is an ATAPI IDE Miniport Driver.

Also in the boot.ini file there was an extra entry beginning with signature(87538753) ,

although UseSignatures="no" was used in the winnt.sif file.

The entry was marked as the default entry and slows down the booting of the computer by 20 sec.

Replacing signature(87538753)disk(0)rdisk(0)partition(1)\WINDOWS by

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS in the boot.ini file and removing the second entry,

solved the problem and now the computer is booting as fast as normally :D

I understand that the procedure is not yet applicable to SATA harddisks,

but for the many people that use PATA harddisks, it is already an excellent solution :thumbup

Edited by wimb
0

Share this post


Link to post
Share on other sites

ilko_t wrote on Apr 22 2007 about SATA problem:

A way I can think of is somehow to force TXT SETUP to see USB stick as second drive, or removable if it is not seen as such, this will make it place the needed boot files on the hard drive, either by driver or by relevant registry entries placed by migrate.inf.

In the Help file of the Deployment Tools I saw the following sentence in the

description of the Unattended parameter TargetPath:

"If you want to specify the target drive, you must use the /tempdrive command-line switch

when you run Winnt32.exe

and:

/tempdrive:drive_letter:

Directs Setup to place temporary files on the specified partition.

For a new installation, Windows will also be installed on the specified partition. "

So I think it might be that using the command: winnt32.exe /makelocalsource /noreboot /tempdrive:C:

can help to force Windows Setup to use the C-drive of your SATA harddisk.

I have no SATA drive, so I cannot test the idea ....

Edited by wimb
0

Share this post


Link to post
Share on other sites

@wimb

Happy to hear a story of success! :)

There was a small difference with the normal setup from CD.

The GRUB4DOS grldr was complaining about the CHS values of the ATA harddisk obtained from my BIOS.

Probably as a result of that I obtained an extra file NTBOOTDD.SYS in the root of my C-drive,

which is an ATAPI IDE Miniport Driver.

Also in the boot.ini file there was an extra entry beginning with signature(87538753) ,

although UseSignatures="no" was used in the winnt.sif file.

The entry was marked as the default entry and slows down the booting of the computer by 20 sec.

Replacing signature(87538753)disk(0)rdisk(0)partition(1)\WINDOWS by

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS in the boot.ini file and removing the second entry,

solved the problem and now the computer is booting as fast as normally

This is a very interesting report, for two reasons:

1) it confirms that when booting Windows can use NTBOOTDD.SYS even if it is a ATAPI driver, not only SCSI and SATA, I am very interested in this as it is another little step on the road of using the possibility to use ANY driver, as long as it is a Miniport one, to boot.

2) it confirms that the signature sintax works perfectly, though with a delay

What would be interesting, if you could make some tests and report, it would be to understand whether the delay is due to:

a. the "sheer" presence of the signature syntax (hence the need to scan Hard Disk(s) MBR to check it

b. the presence of the Miniport driver renamed as NTBOOTDD.SYS (maybe different timings in initialization that cause the delay)

Proposed testing (given that you are familiar with procedures needed should the system become unbootable):

1. Only re-copy the NTBOOTDD.SYS to root of drive

2. Only re-add the signature syntax line in BOOT.INI

3. Both of the above

So I think it might be that using the command: winnt32.exe /makelocalsource /noreboot /tempdrive:C:

can help to force Windows Setup to use the C-drive of your SATA harddisk.

I have not any SATA equipped hardware, but I don't think that what you suggest is feasible/useful, as when you run the WINNT32.EXE C: will be almost invariably the First Active Partition of your First Hard Disk, and NOT the USB stick, moreover, if I am not mistaken, executing such a command will modify your "resident" BOOT.INI to start install at next reboot of the PC....

Cheers,

jaclaz

0

Share this post


Link to post
Share on other sites

Hi wimb, thanks for posting your results and welcome to the party :)

In my setup NTBOOTDD.SYS was not used, and I don't remember any delays when signature was present in BOOT.INI, I have no idea why it was used for your PATA drive/controller. Will you post your Motherboard model and what controller it uses along with its Hardware PID and VID, ?

As for the SATA disks, I am still nowhere, after days in researching on i-net and messing with TXTSETUP.SIF I beleive that the order Setup detects disks is hard coded, may be in DISK.SYS or somewhere else, PATA goes first, then USB, then SCSI/SATA. I have a new motherboard to test on with Intel ICH8R and the next few days I will study how Setup behaves when controller is in IDE, AHCI and RAID mode and will report results.

For now I see 4 ways for overcoming SATA drives issue:

1. Make the stick formated (and bootable at the same time) the same way as SETUP will see it during TXT part and write MBR and ntldr/ntdetect.com on it, so even when those are written the information will remain intact, then copy those files to the hard disk using PRESETUP.CMD or any other way.

2. Somehow "force" SETUP not to write this information on the first active hard drive, I have no clue how :)

3. Somehow "force" SETUP the way it detects the hard drives, or "fool" it to see SATA/SCSI disks as ATA, detecting them before USB.

4. Anything else which one could suggest :)

As for the long delay at T-1 we could use CMDLINES @ T-12 to lift write-protection, rename the two folders on the stick and later use GUIRUNONCE to rename them back. Due to lack of time I haven't tested this yet and am not sure whether GUI setup would re-read registry information about USB write protect at that stage. I consider it as cosmetic issue and will test it after SATA/SCSI issue is fixed.

@jaclaz - what do you think of 1.- about the formating?

I looked on the new GRUB release, for compatibility reasons for now I prefer to stick with the method I posted- 1 manual selection for TXT setup, the GUI part remains the default selection.

0

Share this post


Link to post
Share on other sites
Make the stick formated (and bootable at the same time) the same way as SETUP will see it during TXT part and write MBR and ntldr/ntdetect.com on it, so even when those are written the information will remain intact, then copy those files to the hard disk using PRESETUP.CMD or any other way.

hmmm, :unsure: I don't get it, you CANNOT copy a MBR from stick to hard disk, the partition entry will be invalid (due to different size and geometry of partition) AND disk signature will be duplicated, which has been proved in the past to be a NO-NO due to the problems it causes in drive letter assignments; can you better elaborate?

I may be wrong, as often happens, expecially when guessing an undocumented or poorly documented feature, but I think the right approach could be to create a second migrate.inf entry for the SATA disk, linking it's first partition to C:, directly from scratch as per these posts of mine:

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

http://www.boot-land.net/forums/index.php?...c=2085&st=3

And find a way to write the signature to the SATA drive before starting install.

Signature should not be altered by FDISK /MBR or whatever similar action setup does when booting to prepare the HD.

This would probably lead (through a signature syntax boot.ini entry AND the appropriate SATA driver copied to root as NTBOOTDD.SYS) to make setup correctly attribute letter C: to the SATA drive.

If you could experiment a bit in this direction manually, we will later see if and how it is possible to replicate the procedure automatically, though this would probably mean having grub4dos/grub.exe and some flavour of DOS on the stick, thus, alas, substantially back to square one of the original method 1) through DOS and WINNT.EXE.

jaclaz

Edited by jaclaz
0

Share this post


Link to post
Share on other sites
..you CANNOT copy a MBR from stick to hard disk...

You didn't' get me right, SETUP writes that, thus making the stick unusable. Setup writes that using the geometry it sees the stick during TXT mode, which is different than the way its formated by HP format utility for example.

Formating the stick by XP will result probably in the same geometry which TXT setup will see it, and will not corrupt files, but USB stick formated by XP was in my tests non bootable, no matter FAT16/32 ot NTFS.

The idea is to leave TXT setup to rewrite that, and use BOOT.INI on the stick, in this scenario GRUB is not needed (or may be just for the GUI part) and we wouldn't care about improper boot.ini entries, as we could automatically copy a generic one to the hard drive later.

Edited by ilko_t
0

Share this post


Link to post
Share on other sites

I'm still a bit lost about it. :unsure:

The rewriting of the MBR on the stick only happens when a SATA drive is present, doesn't it?

Setup writes that using the geometry it sees the stick during TXT mode, which is different than the way its formated by HP format utility for example.

Can you use an utility like Dimio's HD hacker:

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

(or any other similar one)

to extract:

1) Stick MBR as formatted anew (before starting install)

2) Stick MBR modified by SETUP

3) HD MBR as written by SETUP

and attach them in a .zip file so that I can have a look at them?

And, sorry, I know I seem a bit tough, and maybe I'm becoming a nuisance but can you re-cap for me if:

Continuing installation when SATA drive is second cause XP boot sector and NTLDR/BOOT.INI being written to the USB stick, corrupting the partition table, then SETUP complains about damaged drive D (or U when old mounted devices was used) and a new boot from the stick is not possible. Repairing GRUB MBR fixes boot, but some files are missing.

means that you are running the stick with GRUB MBR and not with the "standard" MBR + NTLDR + Boot.ini with entry C:\GRLDR?

Did you try with the second one above (it is possible that SETUP finds a "strange" code (not geometry) in the MBR and replaces it, what happens if the code is ALREADY a Win2K/XP/2003 MBR?

jaclaz

P.S.: did you also try putting on the stick the appropriate SATA miniport driver renamed as NTBOOTDD.SYS? This might avoid the different order of enumeration of the drives...

Edited by jaclaz
0

Share this post


Link to post
Share on other sites

jaclaz wrote:

What would be interesting, if you could make some tests and report, it would be to understand whether the delay is due to:

a. the "sheer" presence of the signature syntax (hence the need to scan Hard Disk(s) MBR to check it

b. the presence of the Miniport driver renamed as NTBOOTDD.SYS (maybe different timings in initialization that cause the delay)

Proposed testing (given that you are familiar with procedures needed should the system become unbootable):

1. Only re-copy the NTBOOTDD.SYS to root of drive

2. Only re-add the signature syntax line in BOOT.INI

3. Both of the above

The NTBOOTDD.SYS Miniport Driver is used by the signature(87538753)... entry in the boot.ini file,

and they together cause a 20 sec delay before the Windows logo appears.

In this case removing the NTBOOTDD.SYS file is fatal: Windows won't start due to disk geometry problem.

The signature(87538753) corresponds to the 4 bytes from offsets 1B8h through 1BBh in the MBR,

which are called the Windows™ 2000/XP Disk Signature or NT Drive Serial Number.

For every install from bootable USB-stick they have the same value,

whereas I think that they should change.

see: http://www.geocities.com/thestarman3/asm/mbr/Win2kmbr.htm

However, after a drive has any of the NT-type Operating Systems installed and running,

they will write a Disk Signature in the MBR.

The second entry of boot.ini beginning with multi(0)... does not make use of the NTBOOTDD.SYS file.

Removing the NTBOOTDD.SYS file has in this case no effect.

The multi(0)... entry is also the entry normally occurring in boot.ini when installing from CD.

Edited by wimb
0

Share this post


Link to post
Share on other sites

ilko_t wrote:

In my setup NTBOOTDD.SYS was not used, and I don't remember any delays when signature was present in BOOT.INI, I have no idea why it was used for your PATA drive/controller. Will you post your Motherboard model and what controller it uses along with its Hardware PID and VID, ?

I have used a Medion Laptop type MD6100 with a Medion Motherboard with Intel Pentium 4 processor.

The Chipset is from SIS: SIS648 CPU to PCI Bridge and SIS963 South Bridge.

How can I determine the PID and VID ?

0

Share this post


Link to post
Share on other sites
How can I determine the PID and VID ?

You can use regedit and explore in the:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI

Or (more simply) use SIW:

http://www.gtopala.com/

or SIV:

http://siv.mysite.wanadoo-members.co.uk/

jaclaz

P.S.:

which are called the Windows™ 2000/XP Disk Signature or NT Drive Serial Number.

For every install from bootable USB-stick they have the same value,

whereas I think that they should change.

Yes, but how the "signature number" is generated is not at all clear, not even Daniel B.Sedory, who appears one of the first people to document the feature has a clear take on it.

It is possible that some form of "checksum" is generated thus signature on same system (but in subsequent installs) remains the same.

However "normal" installs appear to change the disk signature ONLY if it is not already present (i.e. 00 00 00 00).

Edited by jaclaz
0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.