Jump to content

How to boot/install from USB key ?


Halfwalker

Recommended Posts

Hi, this was easy I think :)

Add the following line in TXTSETUP.SIF :

[HiveInfs.Upgrade]

AddReg = hiveOEM.inf,AddReg

No files were deleted in my tests.

About BOOT.INI- CMDLINES is not executed, I noticed BOOT.INI gets changed 3 times:

1. TEXT Setup adds default entry pointing to the partition it installs on as it sees it, in our case it's rdisk(1), instead of (0) and timeout 1

2. At beginning of GUI Setup same entries, but after PRESETUP.CMD is launched if present, so PRESETUP.CMD won't work for us

3. Before end of GUI Setup, but before CMDLINES is executed if doing clean install. At this stage it (may be only) changes timeout to 30

So if we execute BOOT_REN.CMD at the first logon screen by adding the following lines we should be fine. No need to use CMDLINES anymore, but even if it's used boot files will be rewritten twice if performing an repair. This line is executed in repair mode too.

TXTSETUP.SIF

[sourceDisksFiles]

hiveOEM.inf = 100,,,,,,_x,,3,3

undoUSBWP.reg = 100,,,,,,_x,2,0,0

BOOT_REN.CMD = 100,,,,,,_x,2,0,0

and

WINNT.SIF

[GUIRunOnce]

"%systemdrive%\windows\system32\BOOT_REN.CMD"

May be it's about time to rewrite the guide once we confirm the results :rolleyes:

edit: If one uses BTS mass storage DP method 2 and repair install then include the following line in \$WIN_NT$.~LS\I386\PRESETUP.CMD

DEL /F %systemroot%\system32\setupold.exe
or GUI Setup stops at start, complaining about fake setup being executed. Edited by ilko_t
Link to comment
Share on other sites


TXTSETUP.SIF
[sourceDisksFiles]

hiveOEM.inf = 100,,,,,,_x,,3,3

undoUSBWP.reg = 100,,,,,,_x,2,0,0

BOOT_REN.CMD = 100,,,,,,_x,2,0,0

and

WINNT.SIF

[GUIRunOnce]

"%systemdrive%\windows\system32\BOOT_REN.CMD"

May be it's about time to rewrite the guide once we confirm the results :rolleyes:

edit: If one uses BTS mass storage DP method 2 and repair install then include the following line in \$WIN_NT$.~LS\I386\PRESETUP.CMD

DEL /F %systemroot%\system32\setupold.exe
or GUI Setup stops at start, complaining about fake setup being executed.

Hi ilko,

I can confirm that the Fresh and the Repair Windows XP Setup, when using the new TXTSETUP.SIF file,

both run fine without deleting anything from the bootable USB-stick. :yes:

I have not yet tested the BTS mass storage DP method 2, but will report about that in due time. ;)

Congratulations with the result ! :thumbup

Regards,

wimb

Edited by wimb
Link to comment
Share on other sites

It seems your post at the CD Forum has been removed ...
I can see it, it's the first post in USB booting subforum:

http://www.911cd.net/forums//index.php?showforum=37

I am afraid your post is not present anymore. Some days ago I visited the CD Forum and was able to read your post there, but now the 911 CD part of the CD Forum is almost empty .... :(

Regards, wimb

Link to comment
Share on other sites

Hi ilko,

I can confirm that the Fresh and the Repair Windows XP Setup, when using the new TXTSETUP.SIF file,

both run fine without deleting anything from the bootable USB-stick. :yes:

I have not yet tested the BTS mass storage DP method 2, but will report about that in due time. ;)

Congratulations with the result ! :thumbup

Hi wimb, nice to read that, in a few days I am going to sum up all changes in a single post, I believe everything is sorted out, except the minor issue with the long delay at T-1.
I am afraid your post is not present anymore. Some days ago I visited the CD Forum and was able to read your post there, but now the 911 CD part of the CD Forum is almost empty .... :(

Regards, wimb

I think it's still there, check your browser settings, clear cache etc.

magicalsnap200705191225eu1.th.jpg

Regards,

ilko

Link to comment
Share on other sites

Hi wimb, nice to read that, in a few days I am going to sum up all changes in a single post, I believe everything is sorted out, except the minor issue with the long delay at T-1.

What is the long delay at T-1 issue? I never noticed such a problem.

There is something strange with the CD Forum for me.

After my registration, the CD Forum part of CD Forum is read only for me,

and remains invisible with automatic log on.

Your link is in that case reported as a broken link.

When I logoff, then the CD Forum part is visible with your post, but I am not allowed to reply.

All the other parts of the CD Forum are behaving normally and remain visible after logon !

I cleared my browser history and cache. No change.

Link to comment
Share on other sites

At the end of GUI Setup attempts to delete temp. folders, but since they are write-protected it's kinda stuck at this point until time-out occurs and it stops trying. In my tests it takes about 2 to complete that point, if you unplug the stick for example at T-1 or even earlier it' takes like 1 or 2 seconds. That's why in one of the previous posts I tried to rename the 2 folders on USB stick using a simple script in CMDLINES, but only ~BT folder survived. Either SETUP deletes files earlier, before CMDLINES is executed, or when it's executed folder is in use or somehow protected by SETUP, causing rename not to complete. For these tests I left stick unprotected. For now I will not do any other attempts to avoid this, since delay is not severe.

About 911CD forum- I think you haven't received your activation email, if I remember right they are using manual validation, you are able to logon using your user name, but some parts are behaving strangely. I waited more than a week to receive that email and activate the account. In my first attempt few months back email didn't arrive at all, so I had to re-register.

Link to comment
Share on other sites

It seems a bit ridiculous to have to do all these things just to get windows installation started from a usb stick. Is there no way of just copying the \i386 folder from a cdrom (or even an nlite distribution) to the usb stick, and format (or probably 'hex') the ntldr or something to boot the setupldr.bin into the text-phase of setup that normally initializes when you boot from a cd-rom (ie not having to run the winnt.exe)?

For me, using the winnt.exe to install from the usb stick is only a bit of a nuisance at the moment because I haven't found a way to stop it installing the ~BT folder onto the usb stick itself - even when i used the winnt.exe /t:<drive> command. The ~LS folder copies ok to the partition i designate. If the ~BT folder would only copy along with the ~LS folder (to the partition), everything would be fine! I know I could probably copy it across, but the winnt.exe program would already have tampered with the usb stick configuration anyway. It really would make life a lot easier, but as we all know, nothing is ever straightforward! :)

Link to comment
Share on other sites

edit: If one uses BTS mass storage DP method 2 and repair install then include the following line in \$WIN_NT$.~LS\I386\PRESETUP.CMD
DEL /F %systemroot%\system32\setupold.exe
or GUI Setup stops at start, complaining about fake setup being executed.

Hi ilko,

I can confirm that Windows XP Setup from the bootable USB-stick including the BTS mass storage DP method 2,

is running fine, both in Fresh and in the Repair mode of Windows XP Setup . :)

I saw in the setuplog.txt file that I have indeed also a long wait of 4 minutes at T-1,

when setup is trying to delete all the files of the $WIN_NT$.~LS and the $WIN_NT$.~BT folders.

But nothing is deleted and it takes only some minutes extra time. So it is no problem. :)

For the 911CD forum I received an activation email, so now I will be able to reply on your post regarding

motherboard and BIOS data for booting BartPE at USB 2.0 speed. :)

Regards,

wimb

Edited by wimb
Link to comment
Share on other sites

Could you tidy up this thread, please?

It would be very helpfull for future, but now 'normal user' will not understand anything.

Maybe it's time to make a guide (like Unattended CD/DVD) (?)

Best regards

thomas.night

PS: Sorry for my English, but I am form Poland :)

Link to comment
Share on other sites

It seems a bit ridiculous to have to do all these things just to get windows installation started from a usb stick. Is there no way of just copying the \i386 folder from a cdrom (or even an nlite distribution) to the usb stick, and format (or probably 'hex') the ntldr or something to boot the setupldr.bin into the text-phase of setup that normally initializes when you boot from a cd-rom (ie not having to run the winnt.exe)?

For me, using the winnt.exe to install from the usb stick is only a bit of a nuisance at the moment because I haven't found a way to stop it installing the ~BT folder onto the usb stick itself - even when i used the winnt.exe /t:<drive> command. The ~LS folder copies ok to the partition i designate. If the ~BT folder would only copy along with the ~LS folder (to the partition), everything would be fine! I know I could probably copy it across, but the winnt.exe program would already have tampered with the usb stick configuration anyway. It really would make life a lot easier, but as we all know, nothing is ever straightforward! :)

i have the same problem also. Still finding the solution currently.

Edited by buseeliu
Link to comment
Share on other sites

I have been a few days away and I find that a lot of things have progressed.

Congrats to both ilko_t and wimb! :)

@ilko_t

I had a quick look at your MBR files, as soon as I have time i'll take a closer look and post my findings.

It seems your post at the CD Forum has been removed ...
I can see it, it's the first post in USB booting subforum:

http://www.911cd.net/forums//index.php?showforum=37

I am afraid your post is not present anymore. Some days ago I visited the CD Forum and was able to read your post there, but now the 911 CD part of the CD Forum is almost empty .... :(

Regards, wimb

wimb, he thread you are referring to is this one:

http://www.911cd.net/forums//index.php?sho...c=19731&hl=

(exactly as ilko_t originally referred it to be)

As a general rule, always reference to a thread by it's ID rather that the page where you have seen it listed, posts may be moved around, particularly the 911CD forum has made a new subforum dedicated to USB booting, so posts are being moved from less relevant areas and put in the new one.

@snowden

As said before, there is the alternate method here using winnt.exe:

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

that of course does not create the "the ~BT folder onto the usb stick itself"

and that can easily be fully automated via batch file.

Moreover, as hinted here, it has the advantage of keeping install files on HD:

http://www.msfn.org/board/I386_folder_t98414.html

@buseeliu

I don't get it :unsure:, you join the board and post here just to say:

"Look guys, your method is not good, too difficult, I have no alternate solution, so I cannot help, just wanted to let you know that I am looking for another way?" :blink:

jaclaz

Link to comment
Share on other sites

@snowden

As said before, there is the alternate method here using winnt.exe:

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

that of course does not create the "the ~BT folder onto the usb stick itself"

and that can easily be fully automated via batch file.

jaclaz: not to be ungrateful, but i read this guide already. contrary to what impression you might have of me, i have read every single one of the links you have given me, even the ones that lead to other forums. But thank you, I do know now how to copy the files across to my hard drive first.

But this still doesn't solve the problem; because I am using a usb stick, I might be waiting about 15 minutes before all of the files have copied across to the HD - kind of defeating the whole purpose.

All the other links you have shown me don't seem to point to anything other than using BartPE or pe2usb, again thwarting any efforts to make windows setup any simpler. It seems to me everybody is pointing everyone else to a pile of links that all lead to the same BartPE or pe2usb methods, which in my opinion I would ditch any day for installing windows via the winnt.exe method (as long as I had the option of course)!

It would take me about as long to copy windows install files across from my usb to my HD, as it would to just run winnt.exe from the usb key itself and put up with the ~BT folder being created on it[self]. This doesn't even include the time it takes just to copy the install files onto the usb iteslf within windows (before booting from it). This is the primary reason why I would like windows to 'begin' from the usb key in the same manner a cdrom installation does; i.e. NO 'initial' temporary file-copying procedure.

In light of this, I read the post about changing the setupldr.bin to ntldr,

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

but it seems to lead me bak off to the BartPE/pe2usb methods. Could you please point me to a specific link if you can, because I keep being led astray with all the links everywhere!

Thanks again for your help. :)

Link to comment
Share on other sites

But this still doesn't solve the problem; because I am using a usb stick, I might be waiting about 15 minutes before all of the files have copied across to the HD - kind of defeating the whole purpose.

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?

Nothing has been done for a long time, but do have a look at it, the original thread is here:

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

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.

Most probably there are some other possibilities, for example finding a way (HXdos?) to run WINNT32.EXE instead of WINNT.EXE on a DOS based OS booted from the stick could resolve the problem of the ~BT folder using the /makelocalsource switch pointing to the HD....

...or finding a way to boot from the .ISO image of the CD saved on the stick....

Every idea, suggestion and contribution is welcome, even if it eventually it leads to a dead end, every attempt helps understanding something more about the way install works and hopefully will make new ideas/methods come to mind.

jaclaz

Link to comment
Share on other sites

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

1. Format stick using PEtoUSB or any other utility of your choice, which makes it bootable with 2k/XP boot sector

2. Copy NTDETECT.COM, NTLDR to root and create BOOT.INI

BOOT.INI

[Boot Loader]
Timeout=15
Default=multi(0)disk(0)rdisk(1)partition(1)\WINDOWS
[Operating Systems]
c:\grldr="Start GRUB"
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="GUI Setup" /FASTDETECT

If you are going to install on another partition/disk amend entries to reflect that.

Make sure you can boot from stick and reach the menu.

3. Get the latest GRUB4DOS and copy GRLDR to the USB root. If you have any issues use the last stable version. Create in USB stick root

MENU.LST

color black/cyan yellow/cyan
timeout 15

default 0

title Phase 1 WinXP Text Mode Setup
chainloader (hd0,0)/setupldr.bin

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.

5. Copy two new folders onto the USB stick root - $WIN_NT$.~BT and $WIN_NT$.~LS

6. In \$WIN_NT$.~BT modify

WINNT.SIF

[data]
msdosinitiated="1"
floppyless="1"
AutoPartition="0"
UseSignatures="no"
InstallDir="\WINDOWS"
winntupgrade="no"
win9xupgrade="no"

[GuiRunOnce]
"regedit /s %systemdrive%\windows\system32\undoUSBWP.reg"
"%systemdrive%\windows\system32\BOOTFLS.CMD"

and

MIGRATE.INF

[Version]
Signature = "$Windows NT$"

[Addreg]
HKLM,"SYSTEM\MountedDevices",,0x00000010
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

If you wish to preserve your USB storage drive letter use CDOB's script to create MIGRATE.INF, don't forget to add the above entries :

MkMigratgeInf.cmd

@echo off
REM MkMigratgeInf.cmd v0.01
REM created by cdob

setlocal EnableExtensions

set Drive=%~d1
if %Drive%.==. set Drive=%~d0

set FileName=%~2
if %FileName%.==. set FileName=MIGRATE.INF.TXT

set MigrateDrive=U:
if not %~d3.==. set MigrateDrive=%~d3

set Value=
FOR /F "skip=2 tokens=1-2*" %%a IN ('reg query HKLM\System\MountedDevices /v \DosDevices\%Drive%') DO set Value=%%c

if %Value%.==. (echo drive settings %Drive% not found & goto :EOF)

set MigrateStr=%Value:~0,2%
set count=2
:begin_parse
call :exec set MidStr=%%Value:~%count%,2%%
if %MidStr%.==. goto :exit_parse
set MigrateStr=%MigrateStr%,%MidStr%
set /a count+=2
goto begin_parse
:exit_parse

(echo [Version]
echo Signature = "$Windows NT$"
echo.
echo [Addreg]
echo HKLM,"SYSTEM\MountedDevices","\DosDevices\%MigrateDrive%",0x00030001,\
echo %MigrateStr%)>%FileName%

goto :EOF

:exec
%*
goto :EOF

7. Create a folder BOOTFILES in USB stick root, and copy NTDETECT.COM, NTLDR and create there 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.

BOOT.INI

[boot loader] 
timeout=15
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="XP Professional 0 1" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP Professional 0 2" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="XP Professional 0 3" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="XP Professional 1 1" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(1)partition(2)\WINDOWS="XP Professional 1 2" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(1)partition(3)\WINDOWS="XP Professional 1 3" /noexecute=optin /fastdetect

8. Create:

undoUSBWP.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies]
"WriteProtect"="0"

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

and

BOOTFLS.CMD

@echo off
SET TAGFILE=\BOOTFILES
FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO IF EXIST "%%h:%TAGFILE%" SET USBDRIVE=%%h:
xcopy %USBDRIVE%\bootfiles\*.* %SYSTEMDRIVE%\ /y /h /r /k
exit

and place them in $WIN_NT$.~LS\i386

9. Copy TXTSETUP.SIF and SETUPLDR.BIN from \$WIN_NT$.~BT to root of USB stick and add the following lines to

TXTSETUP.SIF

[SourceDisksFiles].....
.....
hiveOEM.inf = 100,,,,,,_x,,3,3
undoUSBWP.reg = 100,,,,,,_x,2,0,0
BOOTFLS.CMD = 100,,,,,,_x,2,0,0
....
....
[HiveInfs.Fresh]
AddReg = hiveOEM.inf,AddReg

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

--------

Install XP and leave stick plugged in until after the first logon screen.

Notes:

1. If you use an answer file when launching WINNT32.EXE make sure you delete the whole [unattend] section in WINNT.SIF, otherwise you won't be able to use System Restore and SETUP will not prompt on which partition to install.

2. If you use BTS mass storage DP method 2 and repair install then include the following line in \$WIN_NT$.~LS\I386\PRESETUP.CMD

DEL /F %systemroot%\system32\setupold.exe

or GUI Setup stops at start, complaining about fake setup being executed.

3. If during TEXT MODE your usb stick is listed first when SETUP searches for disks , above SATA/SCSI disks, disable in BIOS IDE channels including the ones with CDROM/DVD attached or disconnect them, this should fix the order. Do not continue install if stick is listed first, this will corrupt files and MBR on it.

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

All credits for the most important part- how to write- protect the USB flash go to cdob :thumbup

Many thanks to jaclaz, wimb and porear :)

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.

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