WinToFlash can copy the contents of a Windows Install ISO or CD/DVD to a USB flash drive so that you can boot from the USB drive and install Windows to a target system (e.g. a netbook).
Install XP to hard disk from a USB flash drive in under 5 minutes (for text mode copy phase) using an NTFS USB flash drive! Almost twice as fast as a FAT16 USB stick.
In this Tutorial, I will just deal with Windows XP installations.
If you have already tried WinToFlash but got an 'NTLDR is missing - Press any key to restart' error, or it would not boot correctly, or you find the installation of XP (1st stage copy files in text mode) verrrrry slow, you might like to try this method which greatly speeds up installation and may make it more reliable on a wider range of systems.
WinToFlash formats the USB stick as FAT32. When I tried to install XP from a WinToFlash USB stick on my Asus EeePC 904, the first copy files stage took over 79 minutes to copy the files from the USB drive to the internal hard disk!
Formatted using the WinToFlash FAT16LBA option took almost 8 minutes.
When I reformatted the same USB stick as NTFS however, the same stage took just over 4 minutes!
In all cases the target internal hard disk partition was quick formatted as NTFS.
To avoid BSOD 0x0000007B errors, if possible, change the BIOS hard disk options on the target system to IDE Legacy mode (not SATA - AHCI).
If you have a system that requires AHCI drivers or other Mass Storage Drivers that are not integrated into the XP install folder, you can use nLite to integrate the correct Mass Storage Drivers (.inf files).
The normal Windows XP boot process is explained here.
For WinToFlash however, the boot sequence is as follows:
The Master Boot Record (MBR = first sector on the disk) is read and the start of the active partition is found by looking at the MBR partition table values:
The Partition Boot Record (PBR) in the FAT32 volume of the USB drive produced by the WinToFlash format looks for and loads the file \NTLDR.
NTLDR parses the boot.ini entries and presents the menu to the user. The boot.ini file contains:
The first entry in boot.ini is
BOOTSECT.DAT is an exact copy of the Partition Boot Record of the USB FAT32 partition (e.g. LBA 63), however, it has been patched to load the file $LDR$ instead of NTLDR. Note that the error message that is displayed if $LDR$ is not found is 'NTLDR is missing Press any key to restart' and not '$LDR$ is missing - Press any key to restart'!
$LDR$ is a copy of setupldr.bin which starts the Stage 1 text mode Setup phase.
After preparing your USB flash drive using WinToFlash (if FAT32LBA), you may find that it does not boot on some systems and displays an 'NTLDR is missing' error.
This is believed to be due to the target system having a buggy, incompatible BIOS which does not use the standard 63 sectors per track and 255 heads per cylinder hard disk geometry.
The 'NTLDR is missing error' can be displayed at two stages of booting:
1. It is displayed when the code in the Partition Boot Record (PBR) runs and booting stops
2. If the PBR code works, ntldr will load and if the user chooses '1st' from the boot.ini menu, the bootsect.dat file will be loaded and run. The bootsect.dat file contains the same code as the PBR and so may also fail with the same 'NTLDR is missing error' error message.
To fix these two stages, we can patch bytes E6-E9 with four 0x90 bytes:
Note that when RMPrepUSB is used to format a FAT32 USB drive, these bytes in the PBR are already patched.
Instead of patching the PBR, we can install grub4dos which uses it's own boot loader and so we do not need to run the code in the PBR.
To patch the bytes in the bootsect.dat we can use dd in grub4dos (see menu below for details).
1. First use WinToFlash to make your USB drive. Note that the contents of the USB drive will be lost when you do this.
Now select the source (XP install CD or mounted ISO volume) and target (your USB Flash drive).
Tip: Select FAT16LBA in Advanced mode - it is much faster to install XP than the default setting of FAT32LBA.
Wait until WinToFlash has completed.
You now have a set of XP install files, however if you use these to install XP from a FAT32 Flash USB drive the install could be verrrrrrry slowwwwww...
If you are going to reformat the drive as NTFS (highly recommended as it is much faster!) then you can now skip steps 3 to 6 and jump to step 7.1.
6.1 . (Optional) - This also improves bootabilty on a wider range of systems:
You can now use the USB drive to install Windows XP, however, to speed up the XP installation, we can reformat the USB drive to NTFS as follows:
7.1 Make a new folder on your hard disk and copy all the files (including hidden files) from the USB drive to the empty folder - e.g. C:\XP_TEMP
7.2 Reformat the USB drive using RMPrepUSB using the following settings
2. any volume name
3. XP/BartPE [NTLDR]
4. NTFS + Boot as HDD
5. tick the box and set the folder path that contains the original files) - e.g. C:\XP_TEMP
6. click Prepare Drive
The bootsect.dat file that is in the $WIN_NT$.~BT/ folder is however a FAT32 boot sector and so the USB drive will not work correctly if you choose 1st, text mode setup. To fix this we can boot directly to setupldr.bin as follows:
7.3. Install grub4dos using the Install grub4dos button in RMPrepUSB - make sure to press [Enter] to copy over the grldr file.
Press F4 in RMPrepUSB and delete the whole menu.lst contents (if one exists) and add just these four lines:
Check USB contents:
You may wish to edit the boot.ini to shorten the timeout to 1 or 0 instead of the current 30 seconds (assuming you will always install XP to the first partition of the first hard disk):
1. Insert the USB drive into the target system and switch it on
2. Set the BIOS to boot from the USB drive ...
(No grub4dos USB DRIVE) Select the first menu entry from the boot.ini menu (the second one will be selected by default), and check that Windows Setup starts.
This is the boot.ini menu displayed when ntldr loads.
NTFS: If you have changed to NTFS and installed grub4dos, then select Stage 1 from the grub4dos menu.
The text mode setup phase will begin...
3. After the files have been installed to the target hard disk, the system will automatically reboot.
If it reboots from the internal hard disk (or you have no boot.ini on the USB drive!) you will see this error:
Ensure that you reboot from the USB drive again and choose Stage 2 you will see the same boot.ini menu again (see screenshot above).
4. Choose the 2nd, GUI mode setup entry (there is normally a 30 second timeout) and then continue to install Windows XP.
If you have installed XP to a different partitition or disk, you will need to choose one of the Debug boot options.
Stage 1 error message:
This is usually because you have an automated install. Look at the contents of the \$WIN_NT$.~BT\winnt.sif file. Change the contents to this:
If this fixes the problem, then you can try adding more lines from your original winnt.sif. Possible values can be found here.
Note: if the winnt.sif has an [Unattended] section (even if it is empty!), XP Setup will not prompt for the Recovery Console (R) or prompt for F8 to agree with the EULA or ask what partition you want to select. You will get the 'Setup cannot create the folder \WINDOWS' error if the target hard disk was not automatically formatted or already contains a \WINDOWS folder.
These files are required on the USB drive to boot directly to the XP Recovery Console:
any other files and folders may be present and should not affect booting to the Recovery Console.
You may delete some of the larger files in the /CMDCONS folder (any of the files that are larger than 2MB) - this will leave approx 6MB of files in the CMDCONS folder.
The menu.lst entry is: