Halfwalker

How to boot/install from USB key ?

486 posts in this topic

This might be overcome by limiting the range of valid driveletters for USB-stick e.g. that the valid range is M-Z,

so that the probable range where cardreaders might occur is excluded.

As I see it, 99.99% of users of this method will normally use on their PC's, at one time or another, a PE of some kind, and of those 99.99% will use a SP2 build, so we can make the drive letter X: as fixed, and that will cover in 99% of cases, then provide an easy way for the remaining 1% to change letter manually.

jaclaz

@jaclaz

The USB-stick was given already a fixed DriveLetter, but it was during XP Setup that the Drive Check in undoren.cmd was causing problems with Cardreaders, which have been overcome by limiting the range for the Drive Check such that the probable range where Cardreaders might occur is excluded.

Regards,

wimb

Edited by wimb
0

Share this post


Link to post
Share on other sites

@wimb

I tried the usb_prep3.cmd.

Changes observed as looking at source:

\usb_prep3\$OEM$\useraccounts.cmd

no more autologon

\usb_prep3\boot.ini

multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="2. GUI Mode Setup Windows XP, Continue Setup + Start XP" /FASTDETECT

\usb_prep3\usb_prep3.cmd + some other changes for nLite

set xp_type=Home / Prof - RyanVM

\usb_prep3\undoren.cmd

\usb_prep3\ren_fold.cmd

take into account drive letter E F G H I J K L

Recommendation:

\usb_prep3\makeBS3.cmd: maybe to upgrade from

::<Release 0.03 ALPHA 05/August/2007

to jaclaz's latest version:

::<Release 0.07 ALPHA 01/October/2007

Now the script usb_prep3.cmd got some problems at execution.

Adding BTS DriverPacks if they were used ....

Lets copy everything to the USB drive, may take a while ( about 5 minutes )

Press a key to continue...
N:\txtsetup.sif
N:\NTLDR
Access denied

Add entry in BOOT.INI to launch TXT Mode Setup ....
A needed file is missing
File U:\setupldr.bin is missing
Press a key to continue...

missing file

1) Access denied

N: tempdrive

U: USB key

The acess denied is during copy from n:\ntldr to u:\ntldr which already exists in my key (I upgrade

the key by re-executing the script, so no new reformat on the key done). And u:\ntldr has read-only, hidden,

system attributes on it, hence problem.

2) A needed file is missing

ECHO Add entry in BOOT.INI to launch TXT Mode Setup ....

CALL makeBS3.cmd %usbdrive%\setupldr.bin /a "1. TXT Mode Setup Windows XP (Never unplug USB-stick) "

3)

File U:\setupldr.bin is missing

Error 2) and 3) are mysterious, but after some investigation I found out that my USB key does have a drive letter

but do not have a physical drive number (\\.\physicaldriveN in dsfo/dsfi notation). For example ptedit32 did not see the

disk (nor HDHacker of course, nor dsfo/dsfi/mbrfix). So probably MakeBS3.cmd failed due to this.

This situation arrives sometimes on my machine, apparently due to a lot usage of vdk/ImDisk, mount external USB HDD plug/unplug, QEMU, VMware etc...

I have to reboot to get a clean situation where plugging the key does create a new corresponding physical drive letter.

Other remarks:

1)

We probably need a kind of execution log (maybe simply by just capturing all usb_prep3.cmd output (stdout/stderr) with

"tee" (tee.exe under Win32), e.g. usb_prep3.cmd | tee usb_prep.log), so that by browsing the log problems can be spotted

easily (and for audit/history also). Without the log, some script (like MakeBS3.cmd uses cls command so the output is cleared

in the window command prompt, so even if I have a big screen buffer, I cannot use copy-paste to report/indicate needed messages output).

2) (optional) Maybe the script must check for errors (errolevel), mostly in copy/xcopy commands and stop execution on errors.

My mentioned errors above are fatal for me. With the log in point 1), this is less important. But I agree that user of this script

is a normally a technical person so he/she should be aware of those errors, and the script not being a GUI application cannot handle

all error situations.

3) Probably we need to ensure that all important files copied/modified (mostly in root: boot.ini, ntdetect.com, ntldr, setupldr.bin) could already exists with read-only,

hidden, system and hence to handle them correctly (reset all the attributes first).

4) Maybe offer the option to delete the temporary image tempimage.img (after the dialog to accept unmount the temporary drive).

Summary:

- I will re-experiment after reboot to get physical drive number associated with USB key

- I will temporarily reset ntldr read-only, hidden, system attribute on my key.

- I will re-experiment the script and report here.

Edited by lilas
0

Share this post


Link to post
Share on other sites

OK, after resetting ntldr attribute on my USB key, and after unmount all drives (vdk, ImDisk...) and unplug all drives, and replug USB key,

I got associated physical drive letter.

Then the script executes smoothly without errors and my key is prepared.

So it remains to test in on real hardware, but normally success will be there. Report later.

Edit: I tried this time with hi-speed 8GB key formatted FAT32, but curiously this time the file copy by setup is very slow, much slower

than with 4GB key formatted FAT16 ! So I interrupt the process and rebuild the 8GB formatted with FAT16. Report later.

Edited by lilas
0

Share this post


Link to post
Share on other sites

 Prepares Windows XP LocalSource for Copy to USB-stick

First Format USB-stick with:
PeToUSB.exe OR HP USB Disk Storage Format Tool Version 2.0.6
Settings PeToUSB: Enable Disk Format with LBA (FAT16X)

For AUTOSTART: COPY PeToUSB.exe in your usb_prep folder
OR COPY HPUSBFW.EXE from C:\Program Files\DriveKey folder

@lilas

First Format USB-stick is essential for the procedure to succeed !

It seems that all your problems came from not first Formatting the stick.

A log file as you suggests is a good idea for improving the program.

Changing MakeBS.cmd to version 0.07 is OK, but version 0.03 does not give a problem.

Edited by wimb
0

Share this post


Link to post
Share on other sites

Some quick report:

- 8GB key cannot be formatted FAT16.

- Even after reformat with FAT32, 8GB hi-speed key is very slow during setup file copy (5 min to have only 10% copy complete).

- Using low-speed FAT16 4GB key freshly formatted, setup file copy is lightening fast (20 s to get 10% complete, total duration (100% complete) = 5 min) !

No problem in the 3 steps (text mode, GUI mode, logon/start XP). And on third reboot, I did see now the icon user, so a force logon must be done (excellent),

which will update boot.ini on the installed HDD and update the USB key (directory rename etc...).

- \$WIN_NT$.~LS\$OEM$\useraccounts.cmd is modified to add some personalized commands (install extra programs), instead of chaining several .cmd

in cmdfiles.txt. Curiously if I put my commands BEFORE the original lines (user account creation) it works better. Putting them AFTER causing some problems

like gdiplus missing etc... It appears that it is related to user account creation.

- By the way I chain the test with Vista installation from USB key: no problem so far.

The key has to be bootable, with Vista bootmanager (bootsect /nt60 or using diskpart or using grub4dos to invoke bootmgr).

The USB key content is a copy of the Vista DVD (almost 4GB).

Again, congratulations to all the team, I am satified with current function.

@jaclaz

ktp is my other nick on other forum :-).

Edited by lilas
0

Share this post


Link to post
Share on other sites

Some statistics:

XP installation duration: 45 min on my system

On my same system, Vista Installation steps:

Copying Windows files 2 min

Expanding files 16 min

Installing features 0 min

Installing updates 1 min

Completing installation 0 min

Total: 19 min (+15 min on first startup (completing installation)). Apparently the gain over XP is by using the WIM format (install.wim about 2.5 GB), so

less files copied, and file expansion is faster.

Edited by lilas
0

Share this post


Link to post
Share on other sites

Some "semi-random" ideas and suggestions:

@Wimb

if you check my binifix.cmd there is a small routine that checks the ATTRIB status of a file, sets it to writable, visible, non-system in order to allow modifying or overwriting, then resets attributes as before.

You can use it to overcome the reported ACCESS DENIED problem.

@lilas (aka ktp :hello: )

An interesting test would be if you could partition (temporarily) the 8Gb key to a smaller size in order to format the partition as FAT16 and see if the speed difference is due to the filesystem rather than to the controller.

See this (now getting old) comparison between different USB Flash drives (read different stick controllers) and their access and transfer speed:

http://www.hardwaresecrets.com/article/321

jaclaz

0

Share this post


Link to post
Share on other sites

Using Apacer HT203 1 GB USB-stick and computer with ASUS M2A-VM HDMI motherboard I observed:

Windows XP Setup Ready in 30 minutes, composed of:

2 min - TXT Mode Setup, Loading Boot Drivers + User Interaction

12 min - TXT Mode Setup, Copy of Windows XP files

16 min - GUI Mode Setup Windows XP

wimb

Edited by wimb
0

Share this post


Link to post
Share on other sites
Some "semi-random" ideas and suggestions:

@Wimb

if you check my binifix.cmd there is a small routine that checks the ATTRIB status of a file, sets it to writable, visible, non-system in order to allow modifying or overwriting, then resets attributes as before.

You can use it to overcome the reported ACCESS DENIED problem.

@jaclaz

Thanks for your Info.

At the moment usb_prep3.cmd is not meant to be used for updating an USB-stick,

but may be your routine will be helpfull in future for changing ATTRIB status of e.g. existing ntldr file.

wimb

Edited by wimb
0

Share this post


Link to post
Share on other sites

Found in jaclaz"s binifix.cmd:

ECHO ERROR
ECHO DefaultEntry is %DefaultEntry%
ECHO.
ECHO The rdisk value is ALREADY 0
ECHO You don't want me to set it as -1, don't you?
PAUSE

:yes::thumbup

Excellent error catching! On real hardware rdisk(-1) would have bad consequences! :-)

Edited by lilas
0

Share this post


Link to post
Share on other sites
....Note that the logon is important to rename and change the ini entry to z-1. Since in my installation after GUI setup I do not see any logon, I

access directly to the desktop (maybe with a default user ?). So after checking that boot.ini and folders are not changed/renames, I do a manual

close session and then logon as administrator. And then I did verify that c:\boot.ini is well changed (z-1), and the two folders on the USB key

are renamed back correctly....

Is this problem still persisting?

Do you need to logon as administrator in order to execute binifix.cmd and undoren.cmd? What rights first logged user had?

If yes then we will need to use RunOnceEx.

http://unattended.msfn.org/unattended.xp/view/web/31/

NEW RELEASE is Available as usb_prep3.zip file in Attachment....

:thumbup

....

Other remarks:

1)

We probably need a kind of execution log (maybe simply by just capturing all usb_prep3.cmd output (stdout/stderr) with

"tee" (tee.exe under Win32), e.g. usb_prep3.cmd | tee usb_prep.log), so that by browsing the log problems can be spotted

easily (and for audit/history also). Without the log, some script (like MakeBS3.cmd uses cls command so the output is cleared

in the window command prompt, so even if I have a big screen buffer, I cannot use copy-paste to report/indicate needed messages output).

.....

4) Maybe offer the option to delete the temporary image tempimage.img (after the dialog to accept unmount the temporary drive)....

good ideas :)

OK, after resetting ntldr attribute on my USB key, and after unmount all drives (vdk, ImDisk...) and unplug all drives, and replug USB key,

I got associated physical drive letter.

Then the script executes smoothly without errors and my key is prepared.

So it remains to test in on real hardware, but normally success will be there. Report later.

Edit: I tried this time with hi-speed 8GB key formatted FAT32, but curiously this time the file copy by setup is very slow, much slower

than with 4GB key formatted FAT16 ! So I interrupt the process and rebuild the 8GB formatted with FAT16. Report later.

I am having similar troubles when ImDsk has mounted drive for too long, unmounting and creating a new one it fixes troubles.

Another thing- boot files position on stick is critical in most cases, a fresh format should be performed prior to using usb_prep.cmd. The script copies those files first.

Some quick report:

- 8GB key cannot be formatted FAT16.

- Even after reformat with FAT32, 8GB hi-speed key is very slow during setup file copy (5 min to have only 10% copy complete).

- Using low-speed FAT16 4GB key freshly formatted, setup file copy is lightening fast (20 s to get 10% complete, total duration (100% complete) = 5 min) !

I believe it's the stick which is slow, many of the copied files are too small and in that case slow sticks perform really bad.

Very nice program to test your sticks speed, AFAIK backing up data is not required, but you never know...

http://www.hugesystems.com/supportspace/bench32.exe

Test on many different USB sticks, thread is in bulgarian, but pictures give very clear idea:

http://www.hardwarebg.com/forum/showthread.php?t=92033

- By the way I chain the test with Vista installation from USB key: no problem so far.

The key has to be bootable, with Vista bootmanager (bootsect /nt60 or using diskpart or using grub4dos to invoke bootmgr).

The USB key content is a copy of the Vista DVD (almost 4GB).

At also should work if you use XP/2k bootsector (PEtoUSB, HP format tool...) and just rename BOOTMGR to NTLDR. Jaclaz's makeBS.cmd is also very handy if want to use multiboot with ntldr/boot.ini.

Question: is it really z-1 or hard coded to zero (since z=1?). What happens if I install to another partition then the first partition? also maybe on another disk

than the first disk, e.g. HDD2 (USB key, HDD1, HDD2) ? Could you confirm that these cases are covered ?

Jaclaz answered already this, just wanted to add a few things:

1. Mixed SATA/IDE devices may break order and how USB disk is seen by TXT Setup- disable or unplug the unnecessary device. Details here:

http://www.msfn.org/board/boot_install_USB...345#entry655345

2. If planning to install in disk/partition other than 0-1 then boot.ini on stick should be amended accordingly.

BTW in my old tests- 341MB source with BTS mass storage and LAN completed in 16 mins. first boot- first working desktop, Barton 2400М @ 2000, 1GB RAM and 400GB SATA disk, motherboard did not support USB2 boot, otherwise a few minutes could have been saved. USB stick- Buffalo FireStix 2GB type R RUF2-R2G-S, it's really fast stick.

To do:

1. Use NTFS compressed temp drive, this should save space, 1GB sometimes could be too much and not possible.

2. Ask to detele tempimage.img when script has completed

3. If needed use RunOnceEx instead of GuiRunOnce to execute binifix.cmd and undoren.cmd. Possibly merge these 2 scripts.

4. USB hard drives- reverse dummydisk.sys logic

5. May be add Vista support too? Shouldn't take much effort.

Regards,

ilko

0

Share this post


Link to post
Share on other sites
ilko_t

Is this problem still persisting?

The problem is solved now, since with usb_prep3.cmd no more automatic logon. You have to manually logon. I used administrator, but maybe UserXP should be OK too.

ilko_t

1. Use NTFS compressed temp drive, this should save space, 1GB sometimes could be too much and not possible.

Yes, maybe mksparse to use at least (quicker).

ilko_t

5. May be add Vista support too? Shouldn't take much effort.

Possible, but the stick must be > 4GB due to the size of Vista DVD (almost 4 GB) and XP CD (could be bigger than 750 MB due to custom addons, service packs, slipstream etc..)

0

Share this post


Link to post
Share on other sites
ilko_t

I am having similar troubles when ImDsk has mounted drive for too long, unmounting and creating a new one it fixes troubles.

Personally ImDisk does not cause any problem, it does not create new physical hard drive (no partition).

The problem was with vdk. Even if you close the drive (vdk close 0 e.g.) the associated physical drive remains listed and is seen

by other utilities (vmware, drive snapshot) but they cannot access them (drive not ready). The only clean way is to uninstall vdk

(vdk remove). By this way, all the physical drive descriptors are removed.

0

Share this post


Link to post
Share on other sites
BTW in my old tests- 341MB source with BTS mass storage and LAN completed in 16 mins. first boot- first working desktop, Barton 2400М @ 2000, 1GB RAM and 400GB SATA disk, motherboard did not support USB2 boot, otherwise a few minutes could have been saved. USB stick- Buffalo FireStix 2GB type R RUF2-R2G-S, it's really fast stick.

16 min - That is very FAST INDEED for Windows XP Install from USB-stick,

most probably due to the very fast Buffalo FireStix USB-stick.

@lilas

Interesting that Install of Vista from USB-stick can be supported in a rather simple way.

@lilas and @ilko_t

Thanks for all the interesting references concerning speed measurements on USB-sticks.

wimb

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