Halfwalker

How to boot/install from USB key ?

486 posts in this topic

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.

VERY interesting. :)

Did you succeed with the above on real hardware, not a VM?

Can you post details on the hardware you tested that on?

Can you confirm that a USB stick with a CDFS filesystem is seen by BIOS/setup as a CD-ROM drive?

jaclaz

0

Share this post


Link to post
Share on other sites

If read somewhere that Vista does a great job at creating Bootable USB drives, but ONLY from within Vista. I'll see if I can find that article.

'nuff

EDIT: Found the article. It describes how to create a bootable WinPE 2.0 USB stick. The stick must be formatted from within Vista. Is that of any use to you?

Edited by enuffsaid
0

Share this post


Link to post
Share on other sites

Yes,

every info is interesting, but maybe Vista and WinPE 2.0 have nothing to do with windows XP, and with installing it from USB.

Why don't you post a new thread with a link to the article in the Vista section?

jaclaz

0

Share this post


Link to post
Share on other sites

You needed to format the USB stick with Vista. That's all that Vista was needed for if I remember correctly. Let me look for that article.

0

Share this post


Link to post
Share on other sites

Any updates on the methods posted here? Does all USB sticks work though?

0

Share this post


Link to post
Share on other sites
Any updates on the methods posted here?

Not yet, still have to find the time to "invent" or "find" a way to avoid (or restore) the deletion of files.

Does all USB sticks work though?

Yes.

jaclaz

0

Share this post


Link to post
Share on other sites

Setup deletes files at two times:

-end of textmode setup

-end of graphic mode setup: T -1 minutes

Set USB WriteProtect twice.

First \$WIN_NT$.~BT\migrate.inf

[Version]
Signature = "$Windows NT$"

[Addreg]
;fix USB drive letter, adjust setting to your partition
HKLM,"SYSTEM\MountedDevices",,0x00000010
HKLM,"SYSTEM\MountedDevices","\DosDevices\U:",0x00030001,\
5c,00,3f,00,3f,00,5c,00,53,00,54,00,4f,00,52,00,41,00,\
47,00,45,00,23,00,52,00,65,00,6d,00,6f,00,76,00,61,00,62,00,6c,00,65,00,4d,\
00,65,00,64,00,69,00,61,00,23,00,37,00,26,00,31,00,64,00,64,00,65,00,34,00,\
37,00,39,00,65,00,26,00,30,00,26,00,52,00,4d,00,23,00,7b,00,35,00,33,00,66,\
00,35,00,36,00,33,00,30,00,64,00,2d,00,62,00,36,00,62,00,66,00,2d,00,31,00,\
31,00,64,00,30,00,2d,00,39,00,34,00,66,00,32,00,2d,00,30,00,30,00,61,00,30,\
00,63,00,39,00,31,00,65,00,66,00,62,00,38,00,62,00,7d,00

;WriteProtect USB
HKLM,"SYSTEM\ControlSet001\Control\StorageDevicePolicies","WriteProtect",%REG_DWORD%,1

[Strings]
;Handy macro substitutions (non-localizable)
REG_SZ = 0x00000000
REG_BINARY = 0x00000001
REG_DWORD = 0x00010001
REG_MULTI_SZ = 0x00010000
REG_SZ_APPEND = 0x00010008
REG_EXPAND_SZ = 0x00020000

MountedDevices fixes USB drive letter to U: This can be used at PNP time.

Setting is hardware related, export MountedDevices USB setting from local registry.

Different USB Sticks may require different MountedDevices settings. Create different migrate.inf.

Second \$WIN_NT$.~LS\I386\hiveOEM.inf

[Version]
Signature = "$Windows NT$"
DriverVer=07/01/2001,5.1.2600.2180

[AddReg]
;WriteProtect USB
HKLM,"SYSTEM\CurrentControlSet\Control\StorageDevicePolicies","WriteProtect",0x10001,1

\txtsetup.sif: add hiveOEM.inf

[SourceDisksFiles]
hiveOEM.inf = 100,,,,,,_x,,3,3

[HiveInfs.Fresh]
AddReg = hiveOEM.inf,AddReg

\$WIN_NT$.~BT\winnt.sif

[data]
msdosinitiated="1"
UseSignatures="no"
EulaComplete="1"

Install windows.

At T -1 minutes wait a looong time or remove USB stick. Setup reboots then.

No files are deleted at USB stick.

After windows installation USB stick is write protected still.

You may change StorageDevicePolicies to 0 to disable write protection and delete USB stick in device manager.

Another solution might be fbwf (File Based Write Filter Driver): write protect drive letter U:

A XP Embedded user may have more knowledge.

0

Share this post


Link to post
Share on other sites

@cdob

VERY interesting! :)

Any idea for the reason for the "loong" wait?

About the migrate.inf setting, I remember having started (and not actually finished as most of my projects ;) ) looking into the data written into MountedDevices keys, I am pretty confident that a batch that can automate the creation of it can be made.

about:

[strings]

;Handy macro substitutions (non-localizable)

REG_SZ = 0x00000000

REG_BINARY = 0x00000001

REG_DWORD = 0x00010001

REG_MULTI_SZ = 0x00010000

REG_SZ_APPEND = 0x00010008

REG_EXPAND_SZ = 0x00020000

since the .inf only contains one "directive", cannot it be eliminated changing the line to:

HKLM,"SYSTEM\ControlSet001\Control\StorageDevicePolicies","WriteProtect",0x10001,1

?

:unsure:

jaclaz

0

Share this post


Link to post
Share on other sites
Any idea for the reason for the "loong" wait?
Setup tries to delete all files still, but can't delete files.

I've no idea, how setup works internally.

Yes, a batch can convert MountedDevices keys.

This is a job for a Rob van der Woude third party author.

Rember a fixed USB drive letter is not required, but may be nice anyway.

Yes, StorageDevicePolicies could be one line in migrate.inf.

REG_BINARY is easier to read and may get less errors at editing migrate.inf.

And this was a hint, migrate.inf can hold additional entries.

BTW: At PE setupldr.bin read \minint\system32\migrate.inf.

0

Share this post


Link to post
Share on other sites

It worked as described, great job cdob, thanks :)

I didn't keep mounted devices in migrate.inf, just the write-protect entry and the USB device got D, hard drive got C. No files were deleted, to avoid the long wait I removed the USB stick after 2-3 minutes waiting.

However I had to made a little change for the text- mode in menu.lst :

title Phase 1 WinXP Text Mode Setup

map --read-only (hd0) (hd1)

map --hook

rootnoverify (hd1)

chainloader (hd1,0)/setupldr.bin

savedefault 1

boot

title Phase 2 WinXP GUI Mode Setup

map (hd1) (hd0)

map (hd0) (hd1)

rootnoverify (hd1)

chainloader +1

savedefault 0

boot

otherwise I was getting blinking cursor and nothing was happening, with grub4dos-0.4.3-2007-03-16.

@jaclaz- many thanks for keeping this thread alive and all your useful posts, here, in 911cd.net and any other forums :thumbup

0

Share this post


Link to post
Share on other sites

@ilko_t

VERY good! :thumbup

It seems like we are almost done. :)

I guess most of the merit has to go to cdob, whose help and knowledge has been decisive, and to porear whose contribution of ideas and testing was fundamental. :hello:

While the first of your menu.lst entries does make sense to me, I am still curious how the second one works, as I see it things must have some logic behind, if BOTH the entries work, this:

title Phase 1 WinXP Text Mode Setup

map --read-only (hd0) (hd1)

map --hook

rootnoverify (hd1)

chainloader (hd1,0)/setupldr.bin

savedefault 1

boot

should be also working if rewritten as:

title Phase 1 WinXP Text Mode Setup

map (hd1) (hd0)

map (hd0) (hd1)

rootnoverify (hd1)

chainloader (hd1,0)/setupldr.bin

savedefault 1

boot

by the same principle, viceversa, the entry:

title Phase 2 WinXP GUI Mode Setup

map (hd1) (hd0)

map (hd0) (hd1)

rootnoverify (hd1)

chainloader +1

savedefault 0

boot

should work as well if rewritten as:

title Phase 2 WinXP GUI Mode Setup

map --read-only (hd0) (hd1)

map --hook

rootnoverify (hd1)

chainloader +1

savedefault 0

boot

As said, the final boot command is unnecessary, and it should be possible to replace:

chainloader (hd1,0)/setupldr.bin

with:

chainloader (hd1,0)/$WIN_NT$.~BT/setupldr.bin

to avoid copying SETUPLDR.BIN and NTDETECT.COM to the root of the stick.

And, besides, once you have issued a root or rootnoverify command, root is established, and you only need the forward slash, i.e. :

chainloader (hd1,0)/$WIN_NT$.~BT/setupldr.bin

should be functionally equivalent to:

chainloader /$WIN_NT$.~BT/setupldr.bin

(as in the second menu.lst entry)

I would be nice if you could test the above and make a new post with all steps together, something one could post a direct link to, to avoid other members to jump forward and backward on this longish thread, as is it is causing me headaches, and I already now most of it. :P

jaclaz

0

Share this post


Link to post
Share on other sites

In my excitement I forgot to thank porear :blushing: , many thanks to him :thumbup

map --read-only (hd0) (hd1)

map --hook

rootnoverify (hd1)

chainloader /$WIN_NT$.~BT/setupldr.bin

gives Error 19, cannot mount selected partition
map (hd0) (hd1)

map (hd1) (hd0)

rootnoverify (hd1)

chainloader /$WIN_NT$.~BT/setupldr.bin

gives the same message

If in command line I type

map (hd0) (hd1)

map (hd1) (hd0)

map --hook - as far as I know it should be done in order to apply and see the changes in command line

rootnoverify (hd1)

find /$WIN_NT$.~BT/setupldr.bin --->result is hd(1,0)

chainloader /$WIN_NT$.~BT/setupldr.bin gives error 19

chainloader (hd1,0)/$WIN_NT$.~BT/setupldr.bin gives the encouraging "Will boot NTLDR from drive=0x81, partition=0x0..."

now booting SETUP is possible, but as far as I remember it will end up with improper boot.ini, pointing to rdisk(1), instead of (0), that's why I stuck with the map --read-only... variant for TEXT mode. This will be first to test.

Honestly GRUB for me by far not so easy to understand, in some commands I just can't see logical explanation why work or why not.

For example in README.TXT:

4. Emulates an HD partition as the first hard disk and boot DOS from it:

map --read-only (hd2,6)+1 (hd0)

map --hook

chainloader (hd0,0)+1

rootnoverify (hd0)

map --harddrives=1

boot

In this example, (hd2,6)+1 represents an extended logical DOS partition

of the third BIOS hard disk (hd2).

breaks the rule map (TO) (FROM) and is opposite (or at least not similar) for me as written here

http://www.gnu.org/software/grub/manual/grub.html#map :

13.3.23 map

— Command: map to_drive from_drive

Map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. Here is an example:

grub> map (hd0) (hd1)

grub> map (hd1) (hd0)

The example exchanges the order between the first hard disk and the second hard disk

I beleive

title Phase 2 WinXP GUI Mode Setup

map (hd1) (hd0)

map (hd0) (hd1)

rootnoverify (hd1)

chainloader +1

savedefault 0

boot

makes sense to be changed to
title Phase 2 WinXP GUI Mode Setup

map --read-only (hd0) (hd1)

map --hook

rootnoverify (hd0)

chainloader (hd0,0)/ntldr

savedefault 0

This will be second to test and I will report the results with a full step by step guide.

Edited by ilko_t
0

Share this post


Link to post
Share on other sites

VERY GOOD.

Also, try with "root" instead of "rootnoverify"....

jaclaz

0

Share this post


Link to post
Share on other sites

Here are some findings:

-setupldr.bin (renamed in my case as ntldrstp), ntdetect.com and txtsetup.sif must be copied in root, or it simply reboots when chainloaded, tried many options, but all results were either a hang with blinking cursor or just restart.

Some experiments with GRUB, with red color were unsuccessful:

TXT setup

map (hd1) (hd0)

map (hd0) (hd1)

map --hook

....

in this case ntldrstp cannot be found

TXT mode

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

root (hd1,0)

chainloader (hd1,0)/ntldrstp

Setup starts, but gives error 14, txtsetup.sif is missing or damaged.
GUI setup

map --read-only (hd1) (hd0)

map (hd0) (hd1)

root (hd0,0)

chainloader (hd0,0)+1

boots GUI mode fine, read only switch shouldn't be needed anyway. It finds ntldr in (hd0,0) and completes the GUI part just fine.
GUI setup

map --read-only (hd1) (hd0)

map --hook

root (hd0,0)

chainloader (hd0,0)+1

Boots and completes GUI mode fine, ntldr is found in both in (hd0,0) and (hd1,0), but this seems to cause no problems.
GUI setup

map --read-only (hd0) (hd1)

root (hd0,0)

chainloader (hd0,0)+1

ntldr couldn't be found

-----------------------------------------------------------

The last working menu.lst I is:

color black/cyan yellow/cyan

timeout 10

default /default

title Phase 1 WinXP Text Mode Setup

map --read-only (hd0) (hd1)

map --hook

root (hd1,0)

chainloader (hd1,0)/ntldrstp

savedefault 1

title Phase 2 WinXP GUI Mode Setup

map --read-only (hd1) (hd0)

map --hook

root (hd0,0)

chainloader (hd0,0)+1

savedefault 0

ntdetect.com, txtsetup.sif and setupldr.bin are copied to root and setupldr.bin renamed to ntldrstp in my case.

It would have been perfect if all this worked on my laptop too, but it did not. :)

All the test so far were done on ABIT AN7 motherboard with NF2 chipset and a blank, not partitioned IDE disk.

On Dell Inspiron 6000 when I use same menu.lst it reboots when TXT mode is selected. It has 3 partitions with XP Home installed- Dell Diagnostic, System and Dell Recovery. Double mapping didn't work, mapping (hd1,0-2) too, but when I use only:

rootnoverify (hd0,0)

chainloader /ntldrstp

it works just fine with no drive mapping at all. On the desktop computer using the same entries result in incorrect boot.ini ( rdisk(1) )as I already wrote about. Haven't tested yet will it set the correct entries on the laptop with no mapping.

Is it because of the different BIOS-es and the way they handle USB? Any ideas?

Edited by ilko_t
0

Share this post


Link to post
Share on other sites

OK, so definitely we need the SETUPLDR.BIN and NTDETECT.COM on root.

A possible "definitive" way out could be:

color black/cyan yellow/cyan

timeout 10

default /default

title Phase 1 WinXP Text Mode Setup

map --read-only (hd0) (hd1)

map --hook

find --set-root /ntldrstp

chainloader /ntldrstp

savedefault 1

title Phase 2 WinXP GUI Mode Setup

map --read-only (hd1) (hd0)

map --hook

find --set-root /ntldr

chainloader /ntldr

savedefault 0

In the second item if ntldr is found on both disks, it could maybe cause problems, one could use another file as a marker even if it is found in a subdirectory, the "root" will be to the drive, I am not at all an expert in this, but if one cannot find a file that is on the HD and not on the stick, it should be possible to create it with some entry in TXTSETUP.SIF or similar.

Also, maybe there is something "between the lines" of this:

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

(if we can find an alternative to the "loong" wait and/or the extraction and reinsertion of the key, we would have a potential "unattended" method)

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.