Jump to content

How to boot/install from USB key ?


Halfwalker

Recommended Posts

Yep, never said it was faster! ;):whistle:

All the idea of trying to find other methods was behind the fact that that method wasn't perfect.

The link you posted does not work, a "tentative" list of possible methods is here:

http://www.msfn.org/board/Installing_Unatt...8.html&st=6

Are you referring to method #3?

The answer to this is 'yes'. But (as I think I already mentioned) they appear to lead back onto grub4dos and other methods.

I am quite sure that it would be possible to write from scratch a somewhat smarter "loader" or "setup" program running under DOS for 2K/XP, or somehow modify the original files as you suggested, but I am afraid it is far above my capabilities to contribute anything useful on that.

I would have thought that whoever came up with the idea of using grub to load the setupldr.bin would (and should!) probably have the technical know-how to hex the ntldr/make a bootsector for usbkeys, that allows to boot setup from a usb with just the i386 folder present (similar to a cdrom)! But as you say, they probably would have done it by now considering it is a whole lot easier a method (although probably not easier to code unless you know about MBRs and so on). For example, just take a look at this MBR help guide 'secrets revealed'; doesn't mean anything to me but might tip somebody in the right direction who knows!

http://www.geocities.com/thestarman3/asm/m...R_in_detail.htm

:sneaky:

Link to comment
Share on other sites


@snowden- the problem when using ntldr and ntdetect.com to boot from stick or setupldr.bin renamed /ntdetect.com is that USB stick is second hard drive as seen and enumerated by them, but setupldr.bin expects files to be on first hard drive. Using GRUB overrides this issue. Unless modified/other/new boot files mentioned are used I don't see a way to fix this issue.

@ilko_t - I see. But if you are running setup booting from a cdrom, how does the setupldr.bin enumerate this? How does it know the cdrom is the 'first hard drive'?

I just have to say this again in case, and to ask: is the setupldr.bin looking for setup files on the first harddrive when running setup via winnt.exe, or via the method of setup that seems to boot straight to the text phase like when starting from cdrom? Because the latter is what I want to happen when booting setup from a usb stick... :wacko:

Link to comment
Share on other sites

... But if you are running setup booting from a cdrom, how does the setupldr.bin enumerate this? ...
As CDROM I think, which is different than USB stick, seen as hard drive/removable storage. If you "fool" SETUP USB stick to appear as CDROM- GRUB gives some options via mapping, but have no idea will it be possible as of now- the issue will be solved.

Another way is if Grub4Dos or other bootloader fully supports ISO boot, then we can simply copy the ISO file and call it. Again no idea how to do it, it may be possible.

I just have to say this again in case, and to ask: is the setupldr.bin looking for setup files on the first harddrive when running setup via winnt.exe, or via the method of setup that seems to boot straight to the text phase like when starting from cdrom? Because the latter is what I want to happen when booting setup from a usb stick... :wacko:
Sorry, I didn't get this, winnt.exe is just preparing the disk for the next stage- TEXT mode, has nothing to do with setupldr.bin in that stage and the order disks are found. Edited by ilko_t
Link to comment
Share on other sites

@snowden- the problem when using ntldr and ntdetect.com to boot from stick or setupldr.bin renamed /ntdetect.com is that USB stick is second hard drive as seen and enumerated by them, but setupldr.bin expects files to be on first hard drive. Using GRUB overrides this issue. Unless modified/other/new boot files mentioned are used I don't see a way to fix this issue.

Copying the whole contents of XP CDROM and patching setupldr.bin will save you no more than 2-3 minutes, the time to create $WIN_NT$.~BT and $WIN_NT$.~LS by WINNT32.EXE, but may lead to other issues or incompatibility. I prefer not to use patched files when possible. Surely any other ideas are welcome, as long as this would save time and give better results.

Another idea, which will save you all the steps above is to create an image of a hard disk prepared with $WIN_NT$.~BT and $WIN_NT$.~LS (check winnt32 switches and /system in particular ) folders and place the image from USB using your favorite imaging program, either from PE or from DOS/LINUX. When working with large files USB sticks are usually much faster.

Using Bart PE and running winnt32.exe has always been an option and gives greater flexibility.

the problem when using ntldr and ntdetect.com to boot from stick or setupldr.bin renamed /ntdetect.com is that USB stick is second hard drive as seen and enumerated by them, but setupldr.bin expects files to be on first hard drive. --> this is the main point

Link to comment
Share on other sites

Here is the edited guide for Windows XP SP2, on 2k/2k3 should work too.

4. Backup your local BOOT.INI and in the XP setup folder \I386 run

winnt32 /makelocalsource /noreboot

after it's finished restore BOOT.INI you backed up.

I should run this command within the existing window xp or from dos command booting from windwo xp setup cd or booting from the usb stick ? thanks for your kind reply

Link to comment
Share on other sites

Here is the edited guide for Windows XP SP2, on 2k/2k3 should work too.

Thank you ilko_t for combining all the experience into one good guide for installing Windows XP from

a bootable USB-stick. I think this is very usefull guide for everybody.

Link to the guide: http://www.msfn.org/board/boot_install_USB...html&st=199

I am very happy that we can now install Windows XP from a bootable USB-stick

and that all problems concerning this subject are solved !

Edited by wimb
Link to comment
Share on other sites

I should run this command within the existing window xp or from dos command booting from windwo xp setup cd or booting from the usb stick ? thanks for your kind reply
All the steps are being done within working XP. You need to run that from command prompt of your local XP setup folder. An easy way to do that is by adding this registry info:

CMDHERE.REG

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt Here]
@="Command &Prompt Here"

[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt Here\command]
@="cmd.exe /k cd %1 "

When you import it you may right-click on the desired forder (I386) and from the context menu select OPEN COMMAND WINDOW HERE.

@wimb- I just hope I did not make typos or missed a thing, as I usually do :rolleyes:

Link to comment
Share on other sites

@snowden

the problem is not actually in the bootsector, as said it is very easy to rename setupldr.bin to NTLDR and load it with a "normal" bootsector. The way (direct with renaming, grub4dos or other bootmanager, custom written bootsector) is irrelevant.

Problem is the way the actual install process "detects" having NOT being booted from CD-ROM.

If you want to experiment a bit, Gray on 911CD forum explained how to hexedit setupldr.bin so that it will use files on \I386 even on hard disk (or stick):

http://www.911cd.net/forums//index.php?sho...3784&st=249

Possibly using this approach (and optionally using the Dietmar's modified NTDETECT.COM) could lead to some result.

Another possible thing one could test (again FAR above my capabilities) would be to use some kind of "upper filters" or something similar to a modified dummydisk.sys driver:

http://www.911cd.net/forums//index.php?sho...181&st=1954

to trick, at least the GUI part of setup to believe files are on a CD-ROM.

Finally there is this (rather apodiptical, if I may) post by Disabled Trucker, that got NO followings:

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

About the use of a PE environment as said my best bet is on a VERY minimal build, the Winbuilder project has gone as low as 15 Mbytes for a really minimal booting environment with CMD.EXE as shell, since all we need to do is to properly run WINNT32.EXE my guess that a not much bigger build would be needed.

I tried to start something out of it, here:

http://www.boot-land.net/forums/index.php?showtopic=644

but as often happens, everyone agrees, and noone actually does anything to contribute. ;)

However the Winbuilder projects have recently entered a more stable level, and a lot of refining work has been made, so I am still ( maybe optimistically) convinced that someone will soon take the challenge and hopefully deliver some results.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Main idea:

satisfy setupldr.bin, ntdetect.com and get rdisk(0):

Map a boot image to a floppy drive.

Swap USB and internal drive.

A hdx is NOT doubled used, this may be a secure approach.

map /boot.img (fd0)
map (hd1) (hd0)
map (hd0) (hd1)

$WIN_NT$.~BT and $WIN_NT$.~LS are splitted:

\$WIN_NT$.~BT part goes to boot image

\$WIN_NT$.~LS goes to USB drive

I used a floppy image from reanimatolog http://bootcd.narod.ru/images_e.htm

fd011520.zip Floppy image 11.52mb (8x1.44mb)

ImDisk Virtual Disk Driver mount this file. http://www.ltr-data.se/index_en.html

Run ImDiks applet from the Control Panel, mount image. Let's use letter G:

Format virtual drive. This creates a ntldr bootsector.

1) XP installation floppies

KB310994 offers XP installation floppy images. http://support.microsoft.com/kb/310994/

Open the six floppy image files at ImDiks and copy files to drive G:

Rename G:\setupldr.bin to ntldr.

hiveOEM.inf goes to G:\txtsetup.sif.

[data]

msdosinitiated="1"

title boot.ima

map --mem /boot.ima (fd0)

map (hd1) (hd0)

map (hd0) (hd1)

map --hook

root (fd0)

chainloader (fd0)+1

rootnoverify (fd0)

map --floppies=1

boot

Setup does boot.

But next a famous BSOD 0x7b Inaccesable boot device does appear.

Can anybody solve this?

New game:

2) Two virtual drives

2003 SP1 setupldr.bin does RAM load a image.

Use 2003 SP1 setupldr.bin and ramdisk.sy_, that's not 2003 SP2 files.

Mount virtual floppy again. Delete all files and add files

ntldr

NTDETECT.COM

winnt.sif

RAMLOAD.IMG

Ntldr is the renamed 2003 SP1 setupldr.bin.
[setupData]

BootDevice = "ramdisk(0)"

BootPath = "\I386\"

;;;OsLoadOptions = "/noguiboot /fastdetect /rdexportascd /rdpath=BOOT.ISO"

OsLoadOptions = "/noguiboot /fastdetect /rdpath=RAMLOAD.IMG /rdimageoffset=0"

[data]

msdosinitiated="1"

G:\RAMLOAD.IMG:

Use ImDisk, create a new virtual image, 10 mb.

Let's use letter H: Format virtual drive.

Copy \$WIN_NT$.~BT\ files to H:\I386\

Copy txtsetup.sif to H:\I386\txtsetup.sif. hiveOEM.inf goes to H:\I386\txtsetup.sif.

XP installation does work. Files goes to a AHCI SATA harddisk.

Boot.ini get rdisk(0). This is NOT rdisk(1).

One drawback:

grub4dos virtual floppy get's drive letter c: Therefore internal harddisk get's d:

Sad, I expected a different behaviour because of floppy mapping.

Does a more experienced grub4dos user have a solution?

Fixing c: at H:\I386\migrate.inf does work too.

However this is not a general soution.

Partition and format at USB XP installation creates a new DiskID.

Fixed c: is not valid anymore.

Random idea:

XP Embedded creates virtual hard disks, including MBR and MountedDevices.

Extract hard disk image: dd if=raminst.sdi of=raminst.img skip=8

More testing time needed.

@snowden

Yes, a working \I386 solution would be nice.

If you provide a working solution, I'll use this happily.

Setupldr.bin support two modes: CD and floppy/harddisk mode.

Selecting mode is unknown. I suspect ntdetect.com hardware findings or different file systems.

IF a BIOS would boot from ISO9660 at USB...

At CD mode folder \I386 is used.

At floppy/harddisk mode folder \$WIN_NT$.~BT, \cmdcons or \minint is used.

But there are more files involved. Setupdd.sys at textmode setup.

Gui mode setup is the next difficulty.

Winnt32 with options syspart and tempdrive copy \$WIN_NT$.~BT and \$WIN_NT$.~LS files to hard disk.

In addition partitin is marked as active.

This can be run from a running PE.

In addition I wonder, what hapens if this is applied to a USB drive?

And windows is installed. Are files deleted at USB drive?

Link to comment
Share on other sites

Thks for your answer first.

i have tried your method but it fails. I think i have made any mistake. When i try to install xp, everything seems to be normal at first. However, the system can not boot to setting up window xp after completetly copying all the temp file to harddisk C drive. Just show an error message in the black screen that c:\windows\system32\hal.dll can not be found.

Furthermore, the speed of copying the temp files to Harddisk drive is very slow. The condition just like smartdrv has not been loaded prior to setting up window xp. Is it possible to make the speed of copying temp file faster?

Actually, i can't understand the step 7, can you further explain it? Many many thanks for your reply.

7. Create a folder BOOTFILES in USB stick root, and copy NTDETECT.COM, NTLDR and your custom BOOT.INI, which will be copied on hard disk later, during the first logon. Set them system, hidden and read-only in advance.

I should run this command within the existing window xp or from dos command booting from windwo xp setup cd or booting from the usb stick ? thanks for your kind reply
All the steps are being done within working XP. You need to run that from command prompt of your local XP setup folder. An easy way to do that is by adding this registry info:

CMDHERE.REG

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt Here]
@="Command &Prompt Here"

[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt Here\command]
@="cmd.exe /k cd %1 "

When you import it you may right-click on the desired forder (I386) and from the context menu select OPEN COMMAND WINDOW HERE.

@wimb- I just hope I did not make typos or missed a thing, as I usually do :rolleyes:

Link to comment
Share on other sites

1) XP installation floppies

KB310994 offers XP installation floppy images. http://support.microsoft.com/kb/310994/

Open the six floppy image files at ImDiks and copy files to drive G:

Not much, but FYI:

http://www.boot-land.net/forums/Recovery-Console-t2254.html

....

Setup does boot.

But next a famous BSOD 0x7b Inaccesable boot device does appear.

Can anybody solve this?

.....

Hmmm, cannot say, you could try using direct mapping of the image (it must be contiguous) instead of --mem mapping, but most probably the BSOD happens when the Windows driver "kicks in" and finds No device or a non supported device.

One drawback:

grub4dos virtual floppy get's drive letter c: Therefore internal harddisk get's d:

Sad, I expected a different behaviour because of floppy mapping.

Does a more experienced grub4dos user have a solution?

Fixing c: at H:\I386\migrate.inf does work too.

However this is not a general soution.

Partition and format at USB XP installation creates a new DiskID.

Fixed c: is not valid anymore.

Supposing that I can be defined "a more experienced grub4dos user", I am willing to try and help, but I am failing to understand the situation in it's entirety, can you please re-describe this second approach?

What I got:

on the root on the stick there is:

grldr

menu.lst as follows:

title boot.ima
map --mem /boot.ima (fd0)
map (hd1) (hd0)
map (hd0) (hd1)
map --hook
root (fd0)
chainloader (fd0)+1
rootnoverify (fd0)
map --floppies=1
boot

a super-floppy image "boot.ima" containing:

ntldr

NTDETECT.COM

winnt.sif

RAMLOAD.IMG

(ntldr above is really SETUPLDR.BIN renamed as ntldr, right?)

the "RAMLOAD.IMG" contains:

a dirtectory \I386 containing all files from \$WIN_NT$.~BT\ + txtsetup.sif + hiveOEM.inf

A typo here?:

Copy txtsetup.sif to H:\I386\txtsetup.sif. hiveOEM.inf goes to H:\I386\txtsetup.sif.

And grub4dos boots in such a manner that SETUP assigns C:\ to the boot.ima file?

Is the above correct?

Random idea:

XP Embedded creates virtual hard disks, including MBR and MountedDevices.

Extract hard disk image: dd if=raminst.sdi of=raminst.img skip=8

More testing time needed.

No need to use XP embedded tools, using VDK.EXE instead of IMDISK it is possible to create and format a full hard disk image (as opposed to single partition image) howto is here (as Trick #3):

http://www.911cd.net/forums//index.php?sho...19056&st=49

If you give me the exact size (in bytes or in 512 sectors) I can prepare a correct MBR and write a few lines of batch to create and format such an image or, alternatively, create such an empty image and send it to you zipped.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

@buseeliu

i have tried your method but it fails. I think i have made any mistake. When i try to install xp, everything seems to be normal at first. However, the system can not boot to setting up window xp after completetly copying all the temp file to harddisk C drive. Just show an error message in the black screen that c:\windows\system32\hal.dll can not be found.
I believe your BOOT.INI file points to the wrong partition on the hard disk. Are installing on first hard disk, first partition? If not you need to amend the BOOT.INI on the USB stick.

If that's not the case then did you leave USB stick plugged in?

Please give as much as possible information for your setup, how many partitions, how many hard drives you have, where do you install it on etc.

Actually, i can't understand the step 7, can you further explain it? Many many thanks for your reply.

7. Create a folder BOOTFILES in USB stick root, and copy NTDETECT.COM, NTLDR and your custom BOOT.INI, which will be copied on hard disk later, during the first logon. Set them system, hidden and read-only in advance.

I really don't get what you don't understand in this step :wacko:
Furthermore, the speed of copying the temp files to Harddisk drive is very slow. The condition just like smartdrv has not been loaded prior to setting up window xp. Is it possible to make the speed of copying temp file faster?
Using winnt.exe or the procedure described? Please try to be as much informative as possible, don't make the other party guessing what you are trying to say. ;)
Link to comment
Share on other sites

ilko_t

I believe your BOOT.INI file points to the wrong partition on the hard disk. Are installing on first hard disk, first partition? If not you need to amend the BOOT.INI on the USB stick.

If that's not the case then did you leave USB stick plugged in?

Please give as much as possible information for your setup, how many partitions, how many hard drives you have, where do you install it on etc..

i just have one IDE 40G Hdd with one partition. I just want to intall the window in Drive C and i haven't unplugged my USB stick

7. Create a folder BOOTFILES in USB stick root, and copy NTDETECT.COM, NTLDR and your custom BOOT.INI, which will be copied on hard disk later, during the first logon. Set them system, hidden and read-only in advance.

copy NTDETECT.COM, NTLDR & CUSTOMISED BOOT.INI during the first logon,

when should i copy these files & from where i should copy them from?

Furthermore, the speed of copying the temp files to Harddisk drive is very slow. The condition just like smartdrv has not been loaded prior to setting up window xp. Is it possible to make the speed of copying temp file faster? Using winnt.exe or the procedure described? Please try to be as much informative as possible, don't make the other party guessing what you are trying to say. ;)

After you have pass through the welcome to installing window screen, they will ask you to select "Install" , "repair" , " Exit", Once you select 'install", then the setup procedure will try to detect your existing Hard drive. Select the drive and format it as ntfs or fat. Then the temporary setup file will begin to copy to the harddisk . This procedure is very slow. Just like smartdrv not yet loaded. The temporary setup file just copy one by one and you can clearly see every filename that is being copied at the bottom of the right hand side . If you are using normal window setup cd to install xp, you can't see every filename since the process of copying file is very fast.

I had encountered this situation before. When i am using command prompt(booted by Win98 floppy disk) to install window xp by running winnt without smartdrv loaded.

Hope the above information is detail enough and you can understand my problem. Thank you so much.

Edited by buseeliu
Link to comment
Share on other sites

@buseeliu

copy NTDETECT.COM, NTLDR & CUSTOMISED BOOT.INI during the first logon,

when should i copy these files & from where i should copy them from?

NTDETECT.COM and NTLDR are the same files as on root of your USB stick, you can copy them from your XP install source i.e. \I386 or \$WIN_NT$.~BT on your USB stick. BOOT.INI code is described right under 7., you need to CREATE it, you don't copy it from anywhere. As I already wrote- prepare the stick in advance and at once, from working XP/2k whatever system you have. Once it's prepared no further steps are needed.

As for the HAL missing error please post here your BOOT.INI file found on root of your USB stick.

As for the slow speed- are you sure your motherboard supports USB2.0? Once drivers in TEXT mode setup are loaded and you are presented the screen to choose REPAIR/INSTALL if motherboard supports USB2.0 you should have it.

P.S. please be careful when quoting, it's hard to understand which part was written by you and which is quoted.

Link to comment
Share on other sites

P.S. please be careful when quoting, it's hard to understand which part was written by you and which is quoted.

Yep, also if you write (without the underscores):

[_quote_]

This is a quoted sentence.

[_/quote_]

you get:

This is a quoted sentence.

but if you write (again without the underscores)

[_quote=jaclaz_]

This is a quoted sentence, and the author is shown between parenthesis.

[_/quote_]

you get:

This is a quoted sentence, and the author is shown between parenthesis.

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