Grub4dos Guide - Embedded Menu


The Grub4dos files grldr and grub.exe contain an embedded menu, which specifies where to search for the configuration file menu.lst during the boot process. The embedded menu uses the following entries -

default 0
timeout 1

title find /menu.lst, /boot/grub/menu.lst, /grub/menu.lst
errorcheck off
configfile /menu.lst
configfile /boot/grub/menu.lst
configfile /grub/menu.lst
find --set-root --ignore-floppies --ignore-cd /menu.lst && configfile /menu.lst
find --set-root --ignore-floppies --ignore-cd /boot/grub/menu.lst && configfile /boot/grub/menu.lst
find --set-root --ignore-floppies --ignore-cd /grub/menu.lst && configfile /grub/menu.lst
errorcheck on
commandline

title commandline
commandline

title reboot
reboot

title halt
halt
Breaking down these commands line by line -

To summarise,

(cd) and (fd) devices are not scanned for either grldr or menu.lst, unless they are the boot device.

If grldr is loaded from a (hd) device via Grub4dos code in the MBR or partition boot sector, then the partition from which it is loaded becomes the root device. This partition is scanned for menu.lst at the root of the partition and in the directories /boot/grub/ and /grub/. If menu.lst is not found in any of these locations then all supported hard disks and partitions are scanned for menu.lst (at root and in /boot/grub/ and /grub/ directories) - (cd) and (fd) devices are not searched. If menu.lst is not found then the device from which grldr was loaded remains the root device. If menu.lst is found then the partition from which it was loaded becomes the root device. menu.lst does not therefore have to be contained in the same partition as grldr.

If grldr is loaded from a (cd) device then (cd) becomes root. (cd) is then scanned for menu.lst (at root and in /boot/grub/ and /grub/ directories). If menu.lst is not present in these location then (hd) devices are scanned (at root and in /boot/grub/ and /grub/ directories) - (fd) devices are not searched. If menu.lst is found on a (hd) device then the partition from which it was loaded becomes the root device.

If grldr is loaded from a (fd) device then (fd) becomes root. (fd) is then scanned for menu.lst (at root and in /boot/grub/ and /grub/ directories). If menu.lst is not present in these location then (hd) devices are scanned (at root and in /boot/grub/ and /grub/ directories) - (cd) devices are not searched. If menu.lst is found on a (hd) device then the partition from which it was loaded becomes the root device.

A note from README_GRUB4DOS.txt if loading grldr via ntldr (the NT loader used by Windows NT/2000/XP) - "...ntldr only loads the startup code of grldr (i.e., the leading 16 sectors of grldr), not the whole grldr file". The embedding settings in the startup code consequently scans for grldr in all supported (hd) type devices. If grldr is present on more than one partition then another instance of grldr could be loaded. If for example grldr (the first 16 sectors) was initially loaded from (hd0,3) but grldr was also present on (hd0,0), then (hd0,0)/grldr would be loaded and (hd0,0) would become root.

If menu.lst is not present on the device from which grldr was loaded but multiple menu.lst files are present on other devices (e.g. on (hd0,0) and (hd1,2)) then the first instance of menu.lst is loaded - in this case (hd0,0).