Windows 7 Tips: Using Grub4Dos to Install Windows 7 from USB Pendrive

mjbmjb

New Member
Joined
Jun 17, 2010
Requirements:

1. MultibootISO > Install Grub4Dos easily into USB Flash Drive
Get it here: Boot Multiple ISO from USB (MultiBoot USB) | USB Pen Drive Linux
or here: http://www.pendrivelinux.com/downloads/MultiBootISOs/MultiBootISOs-v1.4.8.exe
2. Windows 7 DVD, ISO or Source Files
3. Notepad++ > To edit menu.lst
Get it here:Notepad++ | Download Notepad++ software for free at SourceForge.net
or here: Download Notepad++ 5.6.8 - FileHippo.com



Lets Start

Step 1: Run MultibootISO, install MultibootISO into your pendrive. This will install Grub4dos in pendrive.

Step 2: Copy everything in Windows 7 Installation DVD into pendrive.

Step 3: Look for the file menu.lst in your pendrive, edit it with Notepad++.
Add in the below command line anywhere in the file:

Code:
title Install Windows 7
root (hd0,0)
chainloader (hd0,0)/bootmgr

If you have no idea where to insert the above command line, just insert it at the end of the file.

Done. The pendrive is ready for Boot and Install Windows 7.


Install from Pendrive
Restart the computer. Configure BIOS to boot from Pendrive.
A boot menu will appear. You will be able to see the boot option Install Windows 7.
Use arrow key on keyboard to select Install Windows 7 and press enter.
This will enter Windows Boot Manager, choose Windows Setup [EMS] and the installation will start.


About Menu.lst
Menu.lst is a boot menu of Grub4Dos. After install MultibootISO into pendrive, the pendrive support for booting many OS or programs. There are many entries ready made by default after installing MultibootISO. You may delete any of the entries if you don't need them.

For more info about MultiBootISO, please visit: Boot Multiple ISO from USB (MultiBoot USB) | USB Pen Drive Linux


Advantages of using Grub4Dos
There are many several ways to install Windows 7 from USB Pendrive.
Microsoft has officially released a software which can transfer Windows 7 DVD into pendrive.
WintoFlash is another software will do the same thing.
However, these 2 software will only allow 1 OS at a time.

But, by using Grub4Dos, many other bootable OS or Softwares (ie, Linux, Ubuntu, Ultimate Boot CD, Partition Wizard...) are supported in one single pendrive. To view the list of supported software, you may refer the official site of MultiBootISO. If the bootable software you owned is not listed, doesn't mean it is not supported.


Advantages of Using Pendrive to Install Windows 7
DVD will take 30 minutes to install Windows 7
but, Pendrive will take 15 minutes to install Windows 7. (for USB 2.0 & above)
 
Last edited:
I have actually rewrite the tutorial, however, I can't find the "edit" link to edit the above thread. Perhaps, user is not allow to edit post. So, I just start off just like a new tutorial.

Below explains more detail in the command line and how they works. With this, reader will be more understand how to make a Multi OS(Linux, Ubuntu, Vista, Windows 7) USB Installer. All the OS are within the same partition.

I failed to include Windows XP installer with Grub4Dos until this moment, however, if I found such way, I'll update this tutorial. Or if any of the reader found the way to include XP, do kindly share your knowledge. Thanks.

The latest version of MultiBootISO.exe supports USB External Hard Disk too.

Lets Start

Step 1: Run MultibootISO, install MultibootISO into your USB Storage Device(ie.pendrive, External Hard Disk). This will install Grub4dos in pendrive.

Step 2: Create a folder Windows7 in your USB storage.

Step 3: Copy everything in Windows 7 Installation DVD into the folder >> Windows7 in your USB storage.

Step 4: Look for the file menu.lst in your pendrive/External Hard Disk, edit it with Notepad++.

Step 5: You'll be able to see the first 9 rows as below in menu.lst
Code:
# This Menu Created by Lance http://www.pendrivelinux.com
# Ongoing Suggested Menu Entries and the Suggestor are noted!
default 0
timeout 30
root=(hd0,0)
color NORMAL HIGHLIGHT HELPTEXT HEADING
splashimage=(hd0,0)/splash.xpm.gz
foreground=FFFFFF
background=0066FF

Add in the below command line after the above code:

Code:
title Install Windows 7
root (hd0,0)
chainloader (hd0,0)/Windows7/bootmgr

Done. The pendrive is ready to boot and install Windows 7.

If you are confused and don't know how to edit menu.lst, then, open it with Notepad++, delete all the command lines and replace by the following command lines. Save the file and exit.

Code:
timeout 30
root=(hd0,0)
color NORMAL HIGHLIGHT HELPTEXT HEADING
splashimage=(hd0,0)/splash.xpm.gz
foreground=FFFFFF
background=0066FF 
 
title Install Windows 7
root (hd0,0)
chainloader (hd0,0)/bootmgr

The steps mentioned above work with Windows Vista too.

Install from Pendrive
Restart the computer. Configure BIOS to boot from Pendrive/External Hard Disk.
A boot menu will appear. You will be able to see the boot option Install Windows 7.
Use arrow key on keyboard to select Install Windows 7 and press enter.
This will enter Windows Boot Manager, choose Windows Setup [EMS Enable] and the installation will start.

*********************************************************

If you install MultiBootISO(Grub4Dos) in 2nd or 3rd partition of your external hard disk, you need to change all the (hd0,0) in menu.lst to (hd0,1) or (hd0,2).

(hd0,0) means 1st hard disk, 1st partition
(hd0,1) means 1st hard disk, 2nd partition
(hd0,2) means 1st hard disk, 3rd partition

Grub4Dos will treat your Pendrive/USB Hard Disk as 1st hard disk, but you have to define the path to 2nd or 3rd partition.

For example:
Install MultiBootISO(Grub4Dos) in 2nd partition=
Code:
title Install Windows 7
root (hd0,1)
chainloader (hd0,1)/bootmgr
Install MultiBootISO(Grub4Dos) in 3rd partition
Code:
title Install Windows 7
root (hd0,2)
chainloader (hd0,2)/bootmgr

About Menu.lst
Menu.lst is a boot menu of Grub4Dos. After install MultibootISO into pendrive/External Hard Disk, it support for booting many OS or programs. There are many entries ready made by default after installing MultibootISO. You may delete any of the entries if you don't need them.

For more info about MultiBootISO, please visit: Boot Multiple ISO from USB (MultiBoot USB) | USB Pen Drive Linux


Advantages of Using Pendrive to Install Windows 7
DVD will take 30 minutes to install Windows 7
but, Pendrive will take 15 minutes to install Windows 7. (for USB 2.0 & above)


Advantages of using Grub4Dos
There are many several ways to install Windows 7 from USB Pendrive.
Microsoft has officially released a software which can transfer Windows 7 DVD into pendrive.
WintoFlash is another software will do the same thing.
However, these 2 software will only allow 1 OS at a time.

But, by using Grub4Dos, many other bootable OS or Softwares (ie, Linux, Ubuntu, Ultimate Boot CD, Partition Wizard...) are supported in one single pendrive/External Hard Disk. To view the list of supported software, you may refer the official site of MultiBootISO. If the bootable software you owned is not listed, doesn't mean it is not supported.

Besides installing Windows 7, you can make your USB become a Super System Maintenace & Emergency Rescue Tools. (i.e, recover/copy files when Windows cannot startup/lost partition/formated partition, reset or recover system/windows password, testing tools)

Below are some of the highly recommended bootable software for System Maintenance & Emergency Rescue Tools:

1. Partition Wizard - Site - Download
2. Hiren's Boot CD - Site1 - Link Removed - Invalid URL - Link Removed due to 404 Error
3. Ultimate Boot CD - Site - Link Removed due to 404 Error
4. Windows 7 System Repair Disc - How to boot Windows 7 Repair Disc from USB using Grub4Dos
5. AntiVirus Rescue Disk (ie, AVG, Bitdefender, Avira)
 
Hi,

when i want to use
title Install Windows 7
root (hd0,0)
chainloader (hd0,0)/Windows7/bootmgr

just gives me error

File: \boot\BCD\

Status: 0xc000000f

Info: An error occured while attempting to read the boot configuration data.

I really need to have Windows 7 installation in a folder, since my ISO is AIO and more than 4gb big.
 
Wow! That seems like a lot of work just to get a little faster install on Windows 7. My install times with a DVD are about 14-15 minutes, using a USB Flash drive it takes about 7-8 minutes after using the MS Windows USB Installer program to write the ISO to the thumb drive.

Just my two cents on this one.
 
by using MS Windows USB Installer, you can install only 1 program/OS installer in your USB. but using Grub4Dos, you can install lots of bootable software and tools for maintenance purpose in your Pen drive. after booting your pendrive there is a Boot list for you to select which program/software/tools to be run. A very good example, refer here: Boot Multiple ISO from USB (MultiBoot USB) | USB Pen Drive Linux

and besides use less time to install, USB Pen Drive is much easier to take around. DVDs will need a case, but Pen Drive will just need your cloths' pocket for travelling.
 
Last edited:
reply to Znida:

you needn't extract all files in the ISO/DVD. for fresh install, you only need the following three file/directorys:

•bootmgr (file)
•boot (directory)
•sources (directory)

you cannot create a special directory for the windows 7 installation files. The bootmgr won't recognize it.
 
to locohammerhead & Znida:

Cannot create a special folder for Windows 7 installation files.
It must be put at root directory of USB.

the bootmgr will only look for this
\boot\bcd

bootmgr won't look for
\windows7\boot\bcd
 
Here, in this quote, are some of the updated informations to this tutorial.
Recently, in the early of July 2010, Windows 7 Installation boot entry has been added into MultiBootISO.exe. We don't have to do it manually as described below.
All you need to do is:
Step 1: Download MultiBootISO, run and install it into your USB Pendrive/External Hard Disk
Step 2: As for fresh install, you only need to copy the following 3 file/directorys into the root directory of your USB(thanks for climbing for this info):

bootmgr (file)
boot (directory)
sources (directory)


Thats it. Reboot your computer from USB. From the boot menu, choose Operating System Installers > Install Windows Vista/7
This Installation process of Windows 7/Vista will start. Good Luck.
 
mjbmjb i have a question for you, if there is no way to boot windows7 from a folder on the drive, why did u made that tutorial using a custom folder to boot it "chainloader(hd0,0)/windows7/bootmgr", i had this BCD issue a few mins ago but i fix it like u said putting that file and the 2 folders on the root of the drive and ended up deleting the windows7 folder in the drive, but im still trying to find a way to do it using a custom folder, like the one u describe early on this post.
 
Opps, Wrong Typing. I have made a mistake in the tutorial. Thanks for the reminder.
I didn't notice the error. Sorry for that.
I can't edit the post. Or else I'll fixed the error.
 
[langtitle=da]Re: Tips: Using Grub4Dos to Install Windows 7 from USB Pendrive[/langtitle]

[lang=da]Booter fra ekstern harddisk med dette.
Får bootet og skal til å begynde installasjonen, men da får jeg opp dette: "No device drivers were found. Make sure that the installation media contains the correct drivers, and then click OK."

Hva er problemet?

Mvh[/lang]
 
http://www.rmprepusb.com/tutorials/firawiniso <--- SOLVED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Method (for USB Flash drives)

1. Create a new folder on your hard drive called C:\WINFira

2. Download the zip file Tut43_FiraIso.zip from the Beta Downloads - Tutorials page and extract the contents to the C:\WINFira folder

Contents of Tut43_FiraIso.zip:
AutoUnattend.xml
Menu.lst
\FiraDisk folder
au.xml
firadi64.cat
iradi64.sys
firadisk.cat
firadisk.inf
firadisk.sys
LOADISO.CMD
slp.exe
spaces.txt
wenv (not used in this tutorial)
\i386\devcon.exe
\ia64\devcon64.exe
mysetup.cmd (not actually used - see Addendum below)
winpeshl.ini (not actually used - see Addendum below)
\ISO folder
Choose_an_iso
<<<<<<< (your iso files go here)

Note: these instructions also apply if you already have a bootable grub4dos disk, just extract the Tut43_FiraISO.zip contents onto it (note that it will overwrite your menu.lst though!) and copy all your ISO files to the USB drive and overwrite your grldr file with the recent one included in the latest version of RMPrepUSB v2.1.623 or later.

3. Now copy your Windows install ISO files to the C:\WinFira\ISO folder - Note: the iso filenames must NOT contain spaces!

You can download some Windows 7 ISOs from here. The Windows 8 Release Preview ISOs can be found here.

4. The sample menu.lst contains 5 (0-4) menu entries. The first menu entry is set to boot a fixed iso name. Just copy the first menu entry to make as many more as you like for all your ISO files. The second menu entry is merely to allow you to reboot to your hard disk after Windows has been installed onto it. The 3rd menu entry allows the user to choose which iso to boot to, by getting the user to type in the name of the iso that they want to use (note: does not work with Win8 ISOs). The last two menu entries are for Win 8 RP. You can delete any menu entries that you do not require.

New: Note that menu number 5 is not included in the download of menu.lst - this is a new menu which prompts the user for a Windows 8 Product Key before Windows Setup is run.

Edit the menu.lst and change the first line (title) and 3rd line (ISO filename) in each menu

5. Now prepare a USB Flash drive using RMPrepUSB (if you already have a bootable USB drive with grub4dos installed you do not need to do this - but you do the newish version of grldr)

Run RMPrepUSB (use v2.1.622 or later)
To wipe and format the USB drive (optional) - set the following options in RMPrepUSB:
1. MAX
2. (any volume name you like!)
3. WinPE v2/v3 (or DOS or FreeDOS or XP)
4. FAT32 or NTFS (or FAT16 but it has a 2GB limit) and also select the Boot as HDD option ('Boot as HDD' adds a small 2nd partition and makes the BIOS to boot it as a hard disk instead of a ZIP or Floppy drive and thus you don't get 'flashing cursor' on boot on some BIOSes - e.g. EeePCs!)
5. Tick Copy OS Files box and set the Copy Folder to C:\WINFIRA
6. Click Prepare Drive to format the drive and copy the files over


NOTE: Whether you already have an existing grub4dos USB drive or have just formatted one as detailed above, you need to install the latest version of grub4dos as follows:

6. Now click on Install grub4dos and choose Yes forMBR and hit Enter to copy across the grldr file. You need the correct grub4dos grldr file as this supports some newer grub4dos commands.

Contents of bootable grub4dos drive should now be:

AutoUnattend.xml
grldr (new 'chenall build' version as used by latest RMPrepUSB)
Menu.lst
\FiraDisk folder
au.xml
firadi64.cat
firadi64.sys
firadisk.cat
firadisk.inf
firadisk.sys
LOADISO.CMD
slp.exe
spaces.txt
wenv
\i386\devcon.exe
\ia64\devcon64.exe
\ISO folder
Choose_an_iso
(your iso files go here)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<< (use short names if possible to avoid typing!)
***Name must have NOT space***

You may have problems using an emulator
+++You Should Test Boot With Real System+++


Winiso_firadiskconsole.JPG

Fig. 43.6.4 IMPORTANT: you should see the blue Windows Command Shell window which installs the FiraDisk driver and then load the ISO file when Windows Setup starts. If you don't see this then it won't work! ---> http://www.rmprepusb.com/_/rsrc/1319967353807/tutorials/firawiniso/Winiso_firadiskconsole.JPG

============================================================================================

Method (for USB Hard Drives)

The auto-detection of \AutoUnattend.xml will not work if you use a hard drive (neither USB nor IDE/SATA) as a hard drive is not a 'removable' disk, we need to patch the ISO files themselves so that they will automatically run the LOADISO.CMD from the boot drive. To do this we need to copy the contents of the ISO file to an empty folder, modify the ISO file contents and then create a new version of the ISO file.

The guide below is for advanced users. I assume you already know how to mount images using ImageX (or DISM or GImageX) or can use similar tools. It is easiest to download and install theWindows 7 WAIK (over 1.3GB!). However, you can use Tutorial #83 to just download ImageX in about 30 seconds!

Please refer to my other tutorials (e.g. for WAIK and Virtual CloneDrive see Tutorial #1) for details on installing and using the WAIK.

1. Using your Windows 'office' system, Mount the ISO that you want to modify using ImDisk or Virtual CloneDrive or any suitable tool and extract all the contents to an empty folder on your hard drive (e.g. C:\TESTISO)

2. If you want to be able to install any edition of Windows (e.g. all Vista/Win 7 SKUs rather than just Professional), then delete the C:\TESTISO\SOURCES\EI.CFG file.

If you have Win8, you will need to change the ei.cfg file contents to:


[Channel]
_Default

[VL]
0

3. Run a WAIK command prompt as Administrator (found in the Start Menu after installing WAIK) and mount the C:\TESTISO\Sources\boot.wim file (use Imagex /info to determine the correct image number that you need to mount, usually this is Index #2 - but not always!). e.g.
IMPORTANT: Make sure you use the correct wim image number - it is not always 2!


imagex /info C:\TESTISO\SOURCES\boot.wim
(check what images you have by looking at the output)
mkdir c:\mount
imagex /mountrw C:\TESTISO\SOURCES\boot.wim 2 c:\mount


4. Now we just need to copy the two files to theC:\mount\windows\system32 folder - winpeshl.ini andmysetup.cmd. Use the ones in the \FiraDisk folder inside thetutorial download. Their contents are shown below just for reference:

Although these two files are located in the \FiraDisk folder inside the Tutorial #43 Tut43_FiraIso.zip download for your convenience, they are not actually used in booting and can be deleted from the\FiraDisk folder after copying them to the mounted ISO folder - if you wish.

5. Commit the changes and unmount the mounted image - e.g.

(close any Explorer windows which point at C:\mount first!)
imagex /unmount /commit c:\mount
imagex /cleanup

6. Create a new ISO file from the WAIK command prompt:

oscdimg.exe -b"C:\Program Files\Windows AIK\Tools\PETools\x86\boot\etfsboot.com" -u1 -d -h -m -lWIN732SP1 C:\TESTISO\ C:\Win732SP1.iso

(-l specifies the volume Label - note that the source path C:\TESTISO\ ends in a back-slash - however some versions of oscdimg may not like the final \ and you may get a 'usage' message - if so then remove the last backslash). The -u1(ISO9660) option ensures that the ISO is readable in both UDF and ISO 9660 (grub4dos readable) format - NOTE: when mounted by grubdos, all filenames will be uppercase - e.g. BOOTMGR not bootmgr. For maximum compatibility (e.g. with WinImage) you can also add -j1 for Joliet format (upper/lower case and long filenames).

6. Now follow the tutorial above but use this new ISO file.

7. (optional)
The Autounattend.xml file in the root of the USB drive is not required and can be deleted.
If you delete the AutoUnattend.xml file, you need also to change the menu.lst slightly and delete the lines that mention AutoUnattend.xml, otherwise the grub4dos menu will give an error as the file will no longer exist.

8. The new ISO should allow you to install any edition of Windows that is contained within the Install.wim file. You can also use the same files on a USB Flash drive if you wish.

Note: MySetup.cmd can run different versions of Setup.exe
X:\Setup.exe will run Setup and offer the Repair Operating System option.
%RAMDRIVE%\Setup.exe and \Sources\Setup.exe will go straight to the 'Install Windows' GUI and will not allow the user to Repair Windows.

If you do not want the Repair option offered, you should comment out the line shown in purple in MySetup.cmd (i.e. place a double colon :: in front of it - or delete the line).
To remove the Repair Y/N question, delete the following lines from the Firadisk\Loadiso.cmd file

if not exist X:\sources\recovery\startrep.exe goto :SKIP_REPAIR
echo.
echo ********* REPAIR WINDOWS? **************
echo.
set /P ASK="Do you want to try to repair Windows (Y/N)? : "
if /I "%ASK%"=="Y" start /w X:\sources\recovery\startrep.exe
 
Back
Top Bottom