Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

How to boot/install from USB key ?


  • This topic is locked This topic is locked
485 replies to this topic

#326
wimb

wimb

    Senior Member

  • Developer
  • 677 posts
The batch program usb_prep2.cmd for making a bootable USB-stick for Install of Windows XP,
was further improved.

Filling of the USB-stick with files was analysed with WinHex using 1stSector column.
The MakeBS3.cmd was moved such that the Bootsector file SETUPLDR.bs gets a position
close to BOOT.INI in the beginning of the drive, instead of being the last written sector.

$OEM$\CMDLINES.TXT can be used for making UserAccounts and install of Registry Tweaks at T-12
If $OEM$ folder is present in usb_prep2 folder, then it will copied now to the right position
in the temporary drive.

On first logon the Extracted BTS DriverPacks are deleted, which normally takes a long time,
because SystemRestore copies them to System Volume Information folder.
The Disable_SystemRestore.reg Registry Tweak prevents this action, so that first logon is much faster.

Personally I am using only the 5 smallest BTS DriverPacks with Mass Storage text mode enabled.
So I do not integrate the 5 large Sound and Graphics DriverPacks, but use these Packs manually
when Updating Drivers. The extraction and deletion of these 5 large DriverPacks is taking a lot of time.

The file winnt_sif.txt can be used for making your own winnt.sif file to be placed in the xpsource\I386 folder.

If an appropriate USB-stick Format Program like PeToUSB.exe is present in the usb_prep2 folder,
it will be launched automatically at the beginning of the usb_prep2.cmd batch program.

The usb_prep2 folder is given as Attachment.

A Guide for making MultiBoot USB-stick with boot.ini Menu including other boot options like MS-DOS and Linux
is given here http://www.911cd.net...showtopic=20089

Regards,

wimb

Attached Files


Edited by wimb, 30 August 2007 - 03:46 AM.



How to remove advertisement from MSFN

#327
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag
That's a lot better, nice job wimb :thumbup

A small suggestion- when searching for BTS drivers I think would be better to use another marker, not the directory OEM, as it might be some OEM custom folder. Use DPsFnshr.7z in \OEM\bin or some other file, which definitely belongs to BTS pack. I believe if that file exist, presetup.cmd will exist too.


@all- any ideas how to make USB hard drive to look as removable?
My idea- the removable flag should returned as result by disk.sys or usbstor.sys. If it is written somewhere in registry and we use migrate.inf we may override this result and trick TXT Setup to think that USB disk is not fixed, thus giving it proper letter and position.
I have used similar technique to remove unwanted devices from safely remove hardware by setting device capabilities to 80, from default 64. On restart this setting is lost, because the driver returns the flag, but use reg file to change it on startup and it's fine.
In my case I wanted to remove some hard drives from safely remove list-

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\SCSI\Disk&Ven_SATA&Prod_HDS72251&Rev_\5&b721abc&1&010

http://msdn2.microso...y/aa491648.aspx
http://msdn2.microso...y/ms792967.aspx
http://support.microsoft.com/kb/298504

I was thinking would it be possible similar approach to be used. Any detailed information what exactly Hitachi microfilter does, or Dietmar's dummy.sys? We need the opposite result, but not using filter driver, or if it easy to use such at this point why not...

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB


#328
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,036 posts
  • OS:none specified
  • Country: Country Flag

I was thinking would it be possible similar approach to be used. Any detailed information what exactly Hitachi microfilter does, or Dietmar's dummy.sys? We need the opposite result, but not using filter driver, or if it easy to use such at this point why not...


A small correction, there is no such thing as a "Dietmar's dummy.sys".

The file is on CodeProject, it's author is Anton Bassov
http://www.codeproje...ect_hooking.asp
and it comes with source code and an article explaining it.

At the time I "found" it and suggested it to Dietmar:
http://www.911cd.net...o...181&st=1954
as an alternative to the Hitachi Microdrive one (that has no source code), and Dietmar tested and adopted it.

Now we need someone with programming skills and the correct DDK/Compiler etc.

jaclaz

#329
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag

A small correction, there is no such thing as a "Dietmar's dummy.sys"....

Thanks for correction. :blushing:

Now we need someone with programming skills and the correct DDK/Compiler etc.


Your suggestion is to modify driver to return the opposite result and use it during Text mode right? In this case wouldn't it be difficult to use it at that stage? How do we load lowerfilter drivers via txtsetup.sif?

I did another search in registry for clues, cannot find a single entry which may override the result returned during Text mode. I am still hoping that something is written in registry and programs query that key to get removable status, rather than querying and getting result from usbstor.sys on-the fly. Find that key(s) and use migrate.inf to add it, if possible at all.

BTW source code of Hitachi microfilter driver is included in the download.

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB


#330
wimb

wimb

    Senior Member

  • Developer
  • 677 posts

A small suggestion- when searching for BTS drivers I think would be better to use another marker, not the directory OEM, as it might be some OEM custom folder. Use DPsFnshr.7z in \OEM\bin or some other file, which definitely belongs to BTS pack. I believe if that file exist, presetup.cmd will exist too.


Good idea, I will surely use it in the next version :)

#331
iceangel89

iceangel89

    Advanced Member

  • Member
  • PipPipPip
  • 453 posts
  • OS:Windows 7 x64
  • Country: Country Flag

1. Format the USB stick, I used HP USB Format tool, because XP format was reported as incorrect in GRUB.
2. Install GRUB MBR on the stick, the quickest way I found is by GRUBINST_GUI for WIN
3. Get the latest GRUB4DOS and copy GRLDR to the USB root.

erm i didn't have a problem with windows formated NTFS. so i did not use HP Format Utility (or is it because i am using a internal HDD?)

Create MENU.LST in USB root

color black/cyan yellow/cyan
timeout 15
default 1
title Phase 1 WinXP Text Mode Setup
map --read-only (hd0) (hd1)
map --hook
root (hd1,0)
chainloader /ntldrstp
title Phase 2 WinXP GUI Mode Setup
map (hd1) (hd0)
map --hook
rootnoverify (hd0)
chainloader +1


This way the default entry is GUI mode, TXT mode must be selected manually. With these GUI entries XP can be installed and booted later from another partition on the hard drive, not only from the first.

for me the text mode works but the GUI didn't... the screen flashed and i am back to OS Selection... why is this so? i think is the last line? what does it does? "chainloader +1" and is there a GRUB4DOS documentation/manual?

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

winnt32 /makelocalsource /noreboot

after it's finished restore BOOT.INI

whats this for? why do i need to backup boot.ini? and below? whats it for? edit WINNT.SIF & MIGRATE.INF. its for the Read-Only? but why read only for?

5. Copy two new folders in 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"
...

and also this seem to remove my nLite unattended stuff?

#332
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag
Iceangel89, latest step-by-step guide is here:
http://www.msfn.org/...636#entry659636

Latest batch file, which does 95% of the work is just a couple of posts above yours, think you can find it yourself :)

From your post I see very little usable information, need to know what exactly you are trying to achieve, what's the installation media (why talking about internal drive and NTFS? :w00t: ), what version of Windows, how many partitions on the target hard drive, how many hard drives you have, SATA or ATA, and so on...

Backup of boot.ini WAS needed with the earlier guides, because winnt32.exe whit those parameters (in the early guides) adds an entry in the existing boot.ini so on next restart TXT setup is launched. With the latest batch file this is no longer needed.

To preserve NLite customization simply add /unattend:winnt.sif

winnt32 /makelocalsource /noreboot /unattend:winnt.sif

and don't forget to delete the whole unattended section after that. Applies again ONLY for the step-by-step guide, NO need to do that if using the batch file, which checks if winnt.sif is found, /unattend:winnt.sif is used in order to preserve customizations.

...but why read only for?

You really missed where all troubles come from when installing this way :no:
Probably a little effort like reading at least pages 2 and 3 you will get why and what.

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB


#333
iceangel89

iceangel89

    Advanced Member

  • Member
  • PipPipPip
  • 453 posts
  • OS:Windows 7 x64
  • Country: Country Flag

From your post I see very little usable information, need to know what exactly you are trying to achieve, what's the installation media (why talking about internal drive and NTFS?), what version of Windows, how many partitions on the target hard drive, how many hard drives you have, SATA or ATA, and so on...


i am trying to make an install of XP from a HDD, USB at first but since i think my external HDD adapter is not good, i plugged the HDD directly into the comp for now, making it internal... NTFS is so that the partition can be bigger (but it works). so install media is internal HDD (any diff to the process? for now it works, internally). Version of windows - XP Pro SP2 (nLited). number of partitions - 1 Main HDD, 3 NTFS partitions, on the "Temporary Internal" HDD, 2 NTFS partitions (1 for this, and another for Misc Storage)

and so it means Read Only is for USB problems which i escaped using an internal HDD? i think...

Thanks

#334
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag
The routine to install XP from USB flash drive does NOT work for now with USB hard drives, last 2 pages are all about that problem.
For your case you better read these threads:

http://www.911cd.net...showtopic=16713
http://www.911cd.net...showtopic=19745

Deletion of $win_nt$... folders is because they are considered as TEMPORARY, and as such SETUP deletes them on few stages when launched from them. This has nothing to do with USB, IDE, SATA...
These temp. folders are used when prepared by WINNT.EXE or WINNT32.EXE hard drive is started. M$ decided that when SETUP is launched from hard disk this must be one-off installation, and implemented it that way. I386 is used for CD drives and setup files detect install media.
Back to the temp. folders- if they are write protected or renamed when SETUP attempts to delete, them they survive ==> you can use the same prepared disk (usb flash drive) for another install. Basically during the posts here we learned how to invoke installation from new for XP SETUP media, how to trick it NOT to delete temp. files and folders, and how to fix the results of strange for SETUP environment (wrong boot.ini etc.).
I hope that clears a bit whats all about in this long thread.

Edited by ilko_t, 19 September 2007 - 10:56 PM.

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB


#335
happyusers

happyusers
  • Member
  • 9 posts
Hello to the community,
I tried the procedure given by ilko_t on april 21st. It is said 100% success for ATA. I have followed the tutorial line by line. The first stage (textsetup) from the stick went ok. But I didnt manage to reboot on HDD. I had a message "NTLDR missing". I tried with stick first through grub or hdd first, always the same message. I tried fiddling with boot.ini modifying hdr parameter but everything was useless. I think that the drive could have booted, it seems that, on another computer (I took it to format it) it could have booted.
I installed Win XP Pro sp2 on a Pavilion (512Mo 250 Go sempron 3400).
Would you have diagnostic or advices ?
Thanks very much.

PS : the DOS method went OK. The hdd booted on Win98 prompt and I ran Winnt. But how long it is : 3 or 4 hours!

#336
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag
@happyusers
You have used the very first guide, a lot has been improved since then, there is also a batch script preparing USB sticks, have you tried the last guide or the batch file? I'd rather use the batch file.

How many partitions you have on the destination hard drive? Were menu.lst and boot.ini amended accordingly?
Is your source on USB stick? Is it seen at bottom when TXT Setup lists hard drives to be installed on?
Is the message about missing NTLDR coming from Grub4Dos?

Edited by ilko_t, 20 September 2007 - 04:22 PM.

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB


#337
happyusers

happyusers
  • Member
  • 9 posts
To make things simple, I had only one partition on the destination drive. I think I have written boot.ini and menu.slt correctly. My sources were on the stick and I have not really seen if it was shown. I have to try again. I had noticed the script but thought tings were more under control if I did it by myself. I shall try it. I dont think the message came from grub because I tried both ways of booting, through grub on stick and directly on the destination drive and it was the same. NTDLR missing.
Is it possible that the drive boot when placed on another computer while not on the target computer?

#338
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,036 posts
  • OS:none specified
  • Country: Country Flag
"NTLDR is missing"
is an error message hardcoded in the bootsector of any partition formatted under 2K/XP/2003.
(if the "standard" english botsector is used)

So the error is generated long before BOOT.INI comes into play.

Forget for the moment anything about this thread and just:
1) Format the stick with the HP utility or petoUSB or any other method you use
2) Copy to the stick NTLDR, NTDETECT.COM and a BOOT.INI with at least two entries
3) Try booting from it

If it does, try again the method, using the latest tutorial and the batch file.

If it does not, post again, I'll try to help you in first booting part.

jaclaz

Edited by jaclaz, 21 September 2007 - 05:14 AM.


#339
happyusers

happyusers
  • Member
  • 9 posts
Thank you Jaclaz.
In fact, I got the message (in french "NTLDR manque") when booting on the target drive not on the stick, just after textsetup phase. The stick boot was OK and the first phase of installation too.
According to what you say, that message is probably coded in the boot sector of my drive. Why does that bootloader complain when I boot from drive, I wonder. Is there any diagnostic I can run on the drive to understand what is going wrong?
Perheaps what you suggest for the stick would be applicable on the drive?

#340
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag
@happyusers

We could troubleshoot it, but I see no point to do it since a lot has been changed since that guide. NTLDR is missing most of the times it's not where it's expected to be. More interesting for us is why it was not there. My guesses:
1. USB stick was seen as fixed drive and boot files were (attempted to be) written there. That's why I asked you where was it in the list of available hard drives.
2. Grub4Dos didn't like your BIOS and mapping was wrong, try newer/older version. It happened to me already. Check for BIOS updates too.
For simplicity and compatibility in the latest batch file Grub4Dos is no longer used.
3. Anything else...

The batch file is open and customizable, I had no experience in batch scripts making it (wonder how it even worked :lol: ) but it's so simple so can barely call it script at all, wimb polished it a lot and there is nothing to mess with the other scripts used within (binifix.cmd and makeBS.cmd). So I suppose even if you have no experience with batch files you will see all the steps which it performs, and do them manually if you wish so. If you don't get something just ask.
I did not intend to write another guide, for now I am waiting a response in a few forums to get dummydisk.sys redone in the way we need it, then try to use it during TXT setup, test how it works and finally add comments to the BAT file, which can be used instead of a guide.

Regards,
ilko

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB


#341
happyusers

happyusers
  • Member
  • 9 posts
Hi all,
@jaclaz : I tried the script as you suggested. It is worse, the stick no longer boots. I dont know how to control stages of boot.
I have the message
"System disk invalid
I/O Error"
in french of course, my computer (HP s7705 is french).
I shall try the way you suggest, try to get a normal boot with boot.ini menu on the stick.
I am afraid I shall have to erase once again the wole staff on stick.
Is not there a method to control the content of the boot block on the stick and to repair it? I know it exists for mbr.
That's a pity to format a drive whose content is 99.99% good!

@ilko : I have used the batch usb_prep2. Is it the more recent? I shall try to check what it has done with the stick.
I come back soon.

First edit : I tried mbrwiz on the stick and found that the partition was not active. I toggled it and it seems to boot. We shall see further.
I reach the boot menu. I choose textsetup and have another error message : "Windows could not start the file system32\hal.dll is missing or corrupted".

Edited by happyusers, 21 September 2007 - 05:13 PM.


#342
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag
@happyusers
That's the latest file, yes.
I believe something is wrong with the boot order, or USB stick is seen as fixed.

1. Could you attach these files from the root of papered USB stick with your next post:
BOOT.INI
BackupBS.ori
SETUPLDR.bs

2. What options in BIOS do you choose in order to boot from USB?
2.1 Do you have an option in BIOS boot menu to emulate USB-ZIP, USB-HDD etc. ?
2.2 Do you boot from USB entering a temporary boot menu, e.g. F12 and choose USB something?

3. Did you have any other USB mass storage devices attached? Card readers, digital camera, MP3 players, printer with card reader...?
4. What version of windows are you running while preparing USB stick?
5. Which tool did you use to make stick bootable?

Edited by ilko_t, 21 September 2007 - 09:14 PM.

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB


#343
happyusers

happyusers
  • Member
  • 9 posts
Hi ilko,
My BIOS is phoenix award bios 5.04. I have tries booting both ways, usb stick as first device without menu and through the bios menu (not f12 but Esc). In either case, I get the boot.ini menu and after having choosen textsetup, Win complains that it cannot find hal.dll.
I have no other USB device. Win is Win XP Pro SP2 and I have prepared the stick with HPUSBFW.exe.
Here is the boot.ini file you ask for.

[Boot Loader]
Timeout=10
Default=multi(0)disk(0)rdisk(1)partition(1)\WINDOWS
[Operating Systems]
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="GUI Mode Setup Windows XP" /FASTDETECT

C:\SETUPLDR.bs="TEXT Mode Setup Windows XP"

It seems that I cannot attach any other file than text files that way, the system hangs.

Edit : I tried uploading with another browser, I have a warning "upload failed, you are not permitted to upload this type of file (BOOT.INI BackupBS.ori SETUPLDR.bs). Sorry.

Edited by happyusers, 22 September 2007 - 01:51 AM.


#344
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,036 posts
  • OS:none specified
  • Country: Country Flag
@happyusers
Try putting all files in a .zip archive.

jaclaz

#345
happyusers

happyusers
  • Member
  • 9 posts
Thank you Jaclaz. Here are the files.
I was out for sunday, my experiments were delayed, no news.
PS : I cannot upload with Firefox, I have to run IE.

Attached Files



#346
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag

...I get the boot.ini menu and after having choosen textsetup, Win complains that it cannot find hal.dll...

I am puzzled, bootsectors seems fine, however Jaclaz should confirm that.
The only reason I can see is that your USB stick is NOT getting C:\ or first HDD during boot. It could be seen as superfloppy or something, but not hard drive. This way NTLDR passes boot routine to wrong path, producing this "HAL.DLL is missing...." or "NTLDR is missing" with the old guide. .
Probably that's why the other method failed too.

You may try to update your BIOS from HP site, and test with USB Legacy Mode Support option in Advanced Menu.

We may try a few tests to confirm that.
Once the stick is prepared change BOOT.INI on it to :

[Boot Loader]
Timeout=10
Default=multi(0)disk(0)rdisk(1)partition(1)\WINDOWS
[Operating Systems]
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="GUI Mode  Setup Windows XP" /FASTDETECT
A:\SETUPLDR.bs="TEXT Mode Setup Windows XP 1"
C:\SETUPLDR.bs="TEXT Mode Setup Windows XP 2"
D:\SETUPLDR.bs="TEXT Mode Setup Windows XP 3"
E:\SETUPLDR.bs="TEXT Mode Setup Windows XP 4"

and see which option (1-4) will start Text Mode Setup.
If it doesn't start we may try Grub4Dos will report a marker file is, wich will be placed on USB stick, but thats for later.

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB


#347
happyusers

happyusers
  • Member
  • 9 posts
Hi Ilko and thank you for checking the files.
Concerning Bios version, my computer is quite recent (1 week) so I'am afraid I cannot find a newer Bios.
I think I noticed an option in advanced bios menu relative to USB Legacy mode but I have not investigated, I dont know well what it is. do you think it's worth toggling it?
For the test, I shall do it at night as soon as I am home.
Regards
Edit : I modified boot.ini as Ilko suggested. At first, I choose to boot from D: and Windows told it lacked some file. I then choose C: and Windows installation began. I dont know exactly what solved the point but it works. I have to come back to the previous situation in order to confirm the diagnostic.

Edited by happyusers, 25 September 2007 - 01:07 AM.


#348
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag

Edit : I modified boot.ini as Ilko suggested. At first, I choose to boot from D: and Windows told it lacked some file. I then choose C: and Windows installation began. I dont know exactly what solved the point but it works. I have to come back to the previous situation in order to confirm the diagnostic.

You must have changed something else, originally BOOT.INI was pointing to C:\SETUPLDR.bs too. Good that it worked though :)

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB


#349
happyusers

happyusers
  • Member
  • 9 posts
I think the status of an USB device depends on its state at boot time : I had another experiment booting XP on the same computer from an USB hdd. The drive is recognized by the Bios only if the drive is switched off and on before switching the computer on. In any other case, the bus seems to be reset, the light of the drive turns off one second and the drive does not appear among bootable devices in the bios boot menu.
Perhaps its more or less analogous for USB stick and it happened to work once out of many times just because it was in the appropriate state to be recognized as bootable device.
Regards

#350
ilko_t

ilko_t

    MSFN Addict

  • Super Moderator
  • 1,705 posts
  • OS:none specified
  • Country: Country Flag
Hi,
I believe all your troubles are with BIOS, once you get it solved you will have no problems with the guide or the batch file.
Your system is new, many systems are shipped with old BIOSes, give it a try on HP web site for a new BIOS, it may help.
Have you tried with other USB stick?

My old motherboard Abit AN7 was playing funny with USB boot- if on shutdown USB stick is not present it loses boot order, on next boot with USB stick plugged it boots from hard drive, have to reboot and change boot order back to USB stick first. Had to keep stick plugged all the time in order to keep boot order.

regards,
ilko

Install Windows from USB, boot Linux, multiboot and a lot more with WinSetupFromUSB





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users



How to remove advertisement from MSFN