A Multi-device Multi-boot Menu Using Grub 

Multi-boot Vista / XP / Other OS's

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

Finally, Success!! Success!! Success!! I wanted to share my success with you all so you can also created this awesome menu.

I finally created a Grub menu from which I can boot any one of the following items directly from the Grub menu:

Read the guide in this post to get started on Grub from HDD. This will give you a basis on this guide. Otherwise you may feel a little lost.

Let me emphasize that booting directly from CD-ROM is supported by the latest grldr (dated 8/8/2006) directly from the menu. Ed_P and jaclaz, I believe, were playing around with it and Ed_P was successful booting CD from grub floppy. However, this method requires no floppy or floppy image to be loaded first.

Requirements:

Method:

  1. Rename %systemroot%\ntldr to %systemroot%\ntldrxp
  2. Copy your grldr (the latest one) to %systemroot% and rename it to ntldr.
  3. copy menu.lst to %systemroot% or create one if you don't have one in %systemroot%
  4. Edit your menu.lst the way you want using the sample below that allows you to boot various items

Example 1. File Menu.lst

color black/cyan yellow/cyan
timeout 5
default 0

# This finds and loads your Windows XP.
title Microsoft Windows XP SP2 Pro (hd0,0)
find --set-root /ntldrxp
chainloader /ntldrxp
rootnoverify (hd0)

# This finds and loads BartPE on your HARD DRIVE.
title BartPE with XPE 1.0.4 (Find and Load setupldr.bin)
find --set-root /minint/setupldr.bin
chainloader /minint/setupldr.bin

# This boots BartPE from CD-ROM 0.
# You can investigate if find --set-root /I386/SETUPLDR.BIN works for you.
# Pay special attention to case. This is CaSe SeNsItIvE.
# I'm not sure if you need  the line cdrom --add-io-ports=0x03F601F0. Play around yourself.
title Start BartPE from CD-ROM 0
cdrom --add-io-ports=0x03F601F0
cdrom --init
map --hook
chainloader (cd0)/I386/SETUPLDR.BIN
boot

# This is same as above but from CD-ROM 1 (if you have more than 1 drive).
title Start BartPE from CD-ROM 1
cdrom --add-io-ports=0x03F601F0
cdrom --init
map --hook
chainloader (cd1)/I386/SETUPLDR.BIN
boot

# This simply boots a floppy disk from your physical floppy drive.
title Boot Floppy on (fd0)
chainloader (fd0)+1
rootnoverify (fd0)

# This is how you boot a floppy image stored on a FAT/FAT32 partition.
# Replace ghost.img to whatever image you desire to boot.
title Boot Ghost 2003 (ghost.img)
find --set-root /ghost.img
map --mem /ghost.img (fd0)
map --hook
chainloader (fd0)+1

# This is how you boot the Grub floppy from an image instead of the physical floppy.
title Grub4Dos (grub4dos.img)
find --set-root /grub4dos.img
map --mem /grub4dos.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
map --floppies=1
boot

Let me add that my floppy images were created by WinImage. I saved them uncompressed (meaning, they are not *.imz) as *.ima. I renamed them as *.img.

My floppy images are stored on a FAT32 partition - the same partition where my BartPE resides. The advantage of using a FAT32 partition (as opposed to NTFS) is if you boot to DOS, you have access to that partition. I store other DOS commands and utilities (such as edit.com, choice.com) on that partition. It is available for me when I need it.

Edit 2:

You BartPE does not have to be on a FAT/FAT32 partition. It can be NTFS. Even floppy images can reside on NTFS partitions.

Edit 3: Added loading Vista with grub4dos.

documented on: Jun 2 2007, by spacesurfer

A Multi-device Multi-boot Menu Using Grub 

Some small corrections/hints:

1) We are talking here about GRUB4DOS: http://grub4dos.jot.com/WikiHome which is a port of GRUB to Dos/Windows, and has ADDITIONAL features than GRUB

2) GRUB4DOS does support zipped or gzipped images DIRECTLY, so you CAN use compressed images, see my post here for basic examples: http://www.911cd.net/forums//index.php?s=&…st&p=116708

3) as already posted here: http://www.911cd.net/forums//index.php?s=&…st&p=118820 the docs EXPLICITLY say that:

By default, these ports are used for searching cdroms(so they needn't be added): 0x03F601F0, 0x03760170, 0x03860180, 0x6F006B00, 0x77007300. so the part:

cdrom --add-io-ports=0x03F601F0
cdrom --init
map --hook

is NOT needed.

4) Please also note that the majority of motherboards will allow direct BIOS support to CD drive, in this case, you will ALREADY have your CD mapped as "(cd)", not "(cd0)", again read docs:

Note 4: The BIOS might have offered a cdrom interface. It would be (cd). After `cdrom —init' and `map —hook', we might have our (cd0), (cd1), … available. It is likely that one of them could access the same media as the BIOS-offered (cd).

5) Always remember that GRUB has a command line interface, so that you can experiment with commands at boot time, or on-the-fly change some settings in a boot entry, this is VERY advantageous if you have the GRLDR on a portable disk or boot CD

6) Also remember that if you put a copy of GRUB.EXE inside the DOS/WIN98 image and or on an accessible from DOS drive (i.e. FAT formatted) you can boot from the image, do whatever you need to do, then invoke GRUB.EXE and boot another OS WITHOUT RE-BOOTING ! (some limitations apply if you loaded into DOS some TSR or Device Driver that altered memory mapping of the kernel)

7) QUOTE

> USB devices are still not supported yet.

Not really, like ANY other USB booting method, USB IS supported IF the PC boots from the USB Mass Storage Device.

They are not supported if you want to "pass" control from another booted from media to the USB device.

This CANNOT be resolved until something like the very recent development about CD support is added to the code; by the way this latest development was more or less the "native" built-in version of the ATAPI CD ROM driver of the Smart Boot Manager code for booting CD's on motherboards that did not support it: http://btmgr.webframe.org/

Chaining from GRUB/GRUB4DOS the SMBT is a known technique, see this for example: http://www.lrz-muenchen.de/~bernhard/grub-chain-cd.html

Now if someone comes out with an Open Source/Freeware app that can "boot" from USB even if there is no BIOS support for it, one could use a similar method to chainload it from GRUB/GRUB4DOS.

documented on: Aug 8 2006, by jaclaz

A Multi-device Multi-boot Menu Using Grub 

grub4dos is BOTH a hard drive and CD bootloader, but it is much more, it can also boot from a floppy (or USB stick - sorry frodo, I know I am touching a sensible area wink.gif) and pass control to another media, like CD, or HD, or FD.

It can also boot an OS from floppy disk or hard disk IMAGES, directly or through memdisk, the images can be Zip or gzip compressed.

And it can boot an OS from a .ISO image, (not all OS images are suitable), and in some cases the .ISO images can even be compressed, I just got this bot of info from Tinybit, the Grub4dos developer:

First, do a map like this:

map (hd0,0)/cdrom_image.iso (hd1)
map --hook

This requires a physically contiguous cdrom_image.iso on the disk. But if we have enough memory and use the —mem option, the image can be non-contiguous (and even can be gzipped):

map --mem (hd0,0)/cdrom_image.iso.gz (hd1)
map --hook

The second option, mapping the .iso to RAM should be easier, but of course it will need either a lot of memory or a smallish .iso.

Then use (hd1) to access files inside the cdrom image.

i.e. something like:

root (hd1)
chainloader

or:

root (hd1)
chainloader /SETUPLDR.BIN

or:

root (hd1)
chainloader /IO.SYS

The very good thing about it is that the same syntax can be applied to all these devices with slight changes.

jaclaz

documented on: Aug 8 2006, by jaclaz

A Multi-device Multi-boot Menu Using Grub 

title Boot from iso on a harddisk => kub610.iso
   map (hd0,5)/kub610.iso (hd2)
   map --rehook
   chainloader (hd2)+1
   rootnoverify (hd2)
   boot

since 2005-04-06 version 0.4.0pre6: GRLDR can be used with no-emulation-mode bootable CD-ROM.

The New `cdrom' Command Syntax:

  1. Initialize the ATAPI CDROM devices: grub> cdrom —init This will display the number of atapi cdroms found: atapi_dev_count
  2. Stop the ATAPI CDROM devices: grub> cdrom —stop This will set atapi_dev_count to 0.
  3. Add IO ports for searching the atapi cdrom devices. For example: grub> cdrom —add-io-ports=0x03F601F0

After running `cdrom —init' and `map —hook', the cdroms can be accessed through devices (cd0), (cd1), …

documented on: Jan 27 2007, by L_V

A Multi-device Multi-boot Menu Using Grub 

> > how did you make a floppy image with SBM on it?
>
> Use the file you download with the GRUB instructions shown on the link:
>
>   title Boot "El Torito" CD with the help of memdisk/smart boot manager
>   kernel /boot/grub/memdisk.bin
>   initrd /boot/grub/sbootmgr.dsk

I've loaded SBM this way:

title Smart Boot Manager
 find --set-root /IMAGES/SBM.GZ
 map --mem /IMAGES/SBM.GZ (fd0)
 map --hook
 chainloader (fd0)+1
 rootnoverify (fd0)

This is just using the sbm.bin file that's gzipped. It's ~15K in size.