Jump to content

How to boot/install from USB key ?


Halfwalker

Recommended Posts

8. Create:

BOOT_REN.CMD

CODE

@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

ren %USBDRIVE%\txtsetup.sif txtsetup.bak

ren %USBDRIVE%\$WIN_NT$.~BT WIN_NT.BT

ren %USBDRIVE%\$WIN_NT$.~LS WIN_NT.LS

exit

In step 8, Undo_Ren.CMD Should change back to undoren.cmd in order to match Step 6

Edited by buseeliu
Link to comment
Share on other sites


@buseeliu

Good find!

It's good to have more eyes checking, typos are so easy to go undetected. :)

See you soon ilko_t, be well. :hello:

jaclaz

my effort is too small actually, just want to help each other within my ability. :rolleyes:

Link to comment
Share on other sites

Another interesting for me thing- I had Bart PE minint folder on the root of the same stick, while testing I have noticed that if txtsetup.sif in root is missing or renamed, Bart PE is launched instead of TEXT mode setup. It might have been already discussed somewhere, but gives a good idea how both may coexist, without having to create second partition for it. I am going to test it further and report results.

@buseeliu- try some random shots to see why your USB stick is so slow:

1. Update your BIOS

2. Check setting in BIOS for USB, make sure USB2.0 is enabled, play a bit with the other settings for USB- legacy support etc.

3. Test the same stick on another motherboard/system, which is known to support faster speeds

4. Test on your motherboard another stick, which is known to be fast

5. Unplug all other USB devices while testing

6. Use one by one the rear USB ports, try do disconnect fron USB ports from motherboard

May be jaclaz can help you with some other ideas, hes knowledge about usb sticks is amazing :thumbup

@jaclaz- Have you had a chance to look what was going wrong with MBRs?

I think the main problem is my usb 2.0 stick is not fast enough , if i copy file to notebook harddisk through, the speed is very fast. Maybe i need to buy another high speed usb stick later. Thks for your advice.

Link to comment
Share on other sites

Step 6

MIGRATE.INF

CODE

[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 :

Actually, i have tried to use notebook harddisk to install window xp by using the above method. but it fails.

If i use the above code in migrate.inf , i can't not install window xp and there is a warning message that my harddisk c:(should be the drive of the stick) has been damaged. cannot continue setup window anymore, press any key to exit.

If i use CDOB's Script, i can continue to setup window even copying temporary file to 3.5" harddisk, however when the PC restarts, there is a warning that ntldr is missing. If i copy ntldr manually to that 3.5" harddisk, i can enter ther screen of installing win xp , however , further warning message is prompt that my setup file is missing. \globalroot\hardiskvolume2\xxxx.

How can fix it? I think using notebook hdd to installing xp is faster than using flash drive. Thks for all of your effort again.

Link to comment
Share on other sites

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

The Renaming of the $WIN_NT$.~BT and $WIN_NT$.~LS folders, and the TXTSETUP.SIF file,

using boot_ren.cmd and undoren.cmd is a very nice solution for the long-wait problem at T-1.

SetupParams executes from winnt.sif at T-9 minute stage,

and is indeed very usefull for the temporary renaming with boot_ren.cmd :)

There are some changes necessary in the MIGRATE.INF file !

Adding the "WriteProtect" registry entry and the [strings] section in MIGRATE.INF are no longer needed,

because we use now Renaming instead of WriteProtection.

If the USB-stick is connected when making the LocalSource on harddisk C: ,

one can simply keep the USB-stick relevant entry for

HKLM,"SYSTEM\MountedDevices","\DosDevices\U:",0x00030001,\

in the MIGRATE.INF file produced in the $WIN_NT$.~BT folder,

note its drive letter and change the drive letter to U: as proposed in post #129 ,

instead of using MkMigratgeInf.cmd.

With MkMigratgeInf.cmd you are missing in MIGRATE.INF the registry entry

HKLM,"SYSTEM\MountedDevices",,0x00000010

Edited by wimb
Link to comment
Share on other sites

Adding the "WriteProtect" registry entry and the [strings] section in MIGRATE.INF are no longer needed,

because we use now Renaming instead of WriteProtection.

[SetupParams]
UserExecute = "%systemdrive%\windows\system32\boot_ren.cmd"

Yes, boot_ren.cmd is executed at T-9.

http://unattended.msfn.org/unattended.xp/v...19/#setupparams

The above will execute the quotes command at T-9 during setup.
boot_ren.cmd is processed after first reboot.

Dosn't setup delete files earlier at textmode?

Writeprotect in migrate.inf does prohibit deleting files at textmode.

ilko_t remode HiveOEM.inf, because renaming replace this.

With MkMigratgeInf.cmd you are missing in MIGRATE.INF the registry entry

HKLM,"SYSTEM\MountedDevices",,0x00000010

True, MkMigratgeInf.cmd dosn't create this line, because this line is not required in migrate.inf.

@buseeliu

Name your boot.ini. There maybe false settings.

Which hardware and partitions do you use?

Do you use a SATA hard disk?

Short notice about 2003 setupldr.bin RAM loaded idea.

I made a false assumption in the past.

Booting to recovery console (press F10 at F6 message) list 2003 setupldr.bin drive as C:

Grub4dos loaded image is not listed.

This is contrary to a 2003 setupldr.bin PE image: drive X: is used.

Link to comment
Share on other sites

Dosn't setup delete files earlier at textmode?

Writeprotect in migrate.inf does prohibit deleting files at textmode.

The WriteProtect registry entry in MIGRATE.INF is indeed essential !

Without this rule, I lost a lot of setup files from the $WIN_NT$.~LS folder.

Thank you cdob for making me aware of its function. I am sorry for the mistake, that I have made. :blushing:

Edited by wimb
Link to comment
Share on other sites

@ilko_t

Please try A updated BOOT_REN.CMD

\bootfiles is not used anymore.

Ntldr and ntdetect.com are copied from $WIN_NT$.~LS

Boot.ini is builded at boot time:

Boot.ini maybe not at %SystemDrive%: e.g. c:\boot.ini and d:\windows

If a signature line exist, boot.ini is not updated.

SystemRoot folder and partition number are read from boot.ini.

rdisk is set from 0 to 3.

@echo off

set BootIniDrive=%SystemDrive%
SET TAGFILE=\BOOT.INI
if not exist %BootIniDrive%%TAGFILE% FOR %%h IN (Z Y X W V U T S R Q P O N M L K J I H G F E D C) DO IF EXIST "%%h:%TAGFILE%" Set BootIniDrive=%%h:
set BootIni=%BootIniDrive%%TAGFILE%

echo SystemDrive %SystemDrive%
echo BootIniDrive %BootIniDrive%
echo BootIni %BootIni%

SET USBDRIVE=
SET TAGFILE=\$WIN_NT$.~LS
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:
echo USBDRIVE %USBDRIVE%

for %%a in (ntldr ntdetect.com boot.ini) do attrib -r -s -h %BootIniDrive%\%%a
copy %USBDRIVE%\$WIN_NT$.~LS\I386\ntldr %BootIniDrive%\ /y
copy %USBDRIVE%\$WIN_NT$.~LS\I386\ntdetect.com %BootIniDrive%\ /y

ren %USBDRIVE%\txtsetup.sif txtsetup.bak
ren %USBDRIVE%\$WIN_NT$.~BT WIN_NT.BT
ren %USBDRIVE%\$WIN_NT$.~LS WIN_NT.LS

call :createBootIni

goto :eof


:createBootIni
(echo [boot loader]
echo timeout=10)>%BootIni%.new

for /f "tokens=1-9* skip=2 delims=(=)" %%a IN (%BootIni%) DO (
if %%a.==signature. (del %BootIni%.new & goto :eof)
if %%a.==default. echo %%a=%%b^(%%c^)%%d^(%%e^)%%f^(%%g^)%%h^(%%i^)%%j >>%BootIni%.new
)

echo [operating systems] >>%BootIni%.new

for /f "tokens=1-10* skip=4 delims=(=) " %%a IN (%BootIni%) DO (
if %%a.==multi. (
echo %%a^(%%b^)%%c^(%%d^)%%e^(0^)%%g^(%%h^)%%i=%%j rdisk^(0^) %%k >>%BootIni%.new
echo %%a^(%%b^)%%c^(%%d^)%%e^(1^)%%g^(%%h^)%%i=%%j rdisk^(1^) %%k >>%BootIni%.new
echo %%a^(%%b^)%%c^(%%d^)%%e^(2^)%%g^(%%h^)%%i=%%j rdisk^(2^) %%k >>%BootIni%.new
echo %%a^(%%b^)%%c^(%%d^)%%e^(3^)%%g^(%%h^)%%i=%%j rdisk^(3^) %%k >>%BootIni%.new
)
)

(echo.
echo [debug]
echo SystemDrive %SystemDrive%
echo BootIniDrive %BootIniDrive%
echo BootIni %BootIni%
echo USBDRIVE %USBDRIVE%
)>>%BootIni%.new

type %BootIni%.new

copy "%BootIni%" "%BootIni%.%date%.txt" /y
copy "%BootIni%.new" "%BootIni%" /y

goto :eof

Edited: Rename missed in BOOT_REN.CMD

Added: rename txtsetup.sif, $WIN_NT$.~BT and $WIN_NT$.~LS

Edited by cdob
Link to comment
Share on other sites

Hi everyone :)

Short and unexpected holidays are always nice and welcome :)

...In step 8, Undo_Ren.CMD Should change back to undoren.cmd in order to match Step 6

Thanks for finding, fixed now.

Actually, i have tried to use notebook harddisk to install window xp by using the above method. but it fails...
Have you read the red note at the end of the last guide? I think you fall in that case. Make sure your USB hard disk is NOT listed first, play a bit with the other IDE devices as described in the previous posts.
@ilko_t

Please try A updated BOOT_REN.CMD...

I have tested it under working XP and it works, however attrib must be used in order to access the existing BOOT.INI, in GUI mode setup I think it's already hidden/system.

Next few days I will be testing your and jaclaz's scripts and will report results.

ilko

Link to comment
Share on other sites

Have you read the red note at the end of the last guide? I think you fall in that case. Make sure your USB hard disk is NOT listed first, play a bit with the other IDE devices as described in the previous posts.

I will try to use flash drive instead of notebook harddisk , i have use some software to test the reading/writing speed between the notebook harddisk & pqi flash drive, i find out that the reading performance is better for using pqi flash drive.

Link to comment
Share on other sites

I have tested it under working XP and it works, however attrib must be used in order to access the existing BOOT.INI, in GUI mode setup I think it's already hidden/system.

Next few days I will be testing your and jaclaz's scripts and will report results.

Happy you are back to "work"! :)

In my "bootsector renaming" script there is a re-usable (clever? :unsure: ) routine that checks the attribute status of BOOT.INI, whatever it is, does the needed changes and re-applies the same attributes.

jaclaz

Link to comment
Share on other sites

About multi boot:

Setupldr.bin seek folder minint first, $WIN_NT$.~BT next.

Hexedit \$WIN_NT$.~BT\setupldr.bin. Change minint to miniOf.

menu.lst

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

chainloader /minint/setupldr.bin

For a MultiBoot USB-stick combining BartPE ( minint folder ) and the Windows XP LocalSource,

I found the following solution to make BartPE boot from the minint folder, instead of launching Windows XP setup.

BartPE minint folder was installed on USB-stick using peinst.cmd.

Booting via ntldr and boot.ini using peboot.bin bootsector and peldr bootloader in root-dir of USB-stick.

peldr seeks txtsetup.sif first in root directory, in minint folder next.

Hexedit peldr using TinyHexer. Change in peldr the first occurrence of txtsetup.sif in notsetup.sif

Now BartPE will boot from minint folder and will not use WinXP txtsetup.sif from root directory.

It is also interesting to add to the GRUB4DOS menu.lst on the MultiBoot USB-stick,

Puppy Linux (NTFS Read/Write support) and DSL Linux (Knoppix with NTFS Read only support) ,

according to the procedure described by diddy in:

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

DSL Linux is booting very fast in 1.5 minute, :)

whereas BartPE is taking 15 minutes (My BIOS supports booting with USB 1.0 speed only).

It is clear that KNOPPIX is able to use the USB 2.0 speed already in a very early stage of the booting process !!

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