Grub4dos utilises two different methods for booting operating systems - both of which can be used via command line or configuration file entries. Both methods involve using the chainloader command, one to boot the device, the other to boot the operating system kernel or bootloader file(s). By chainloading the device Grub4dos can be used to boot unsupported partition types, as long as the operating system uses the MBR and/or partition boot sector as part of the bootstrap process. For chainloading devices refer to the following sections -
Directly chainloading OS files has an advantage over chainloading the device, as a partition or floppy (or partition/floppy image) with a corrupted boot sector can still be booted (as long as the filesystem remains correct).
NOTE - all of the following examples are configuration file entries, however they can easily be amended to run from the command line interface. To run from the command line omit the title command entry. After entering the last command you will also need to run the boot command (this is not needed in configuration file entries). The following menu.lst entry for example -
Should be entered as chainloader (hd0)+1 [enter], rootnoverify (hd0) [enter], boot [enter] from the command line.
The Master Boot Record (or MBR) is always the first sector of a hard disk (sector 1). It contains the disks primary partition table, identifying which partition is marked as active (the active partition is the device boot partition). It is possible to boot a hard disk MBR by using the chainloader command. To boot the MBR of the first hard disk we would use the following command -
Where (hd0) is the whole of the first disk, (hd1) would be used to boot the MBR of the second hard disk, etc. The "+" symbol is used to specify a blocklist - in this case +1 is the first sector of the device (hd0). A block list is used for specifying a file that doesn't appear in the filesystem, like a chainloader.
During the installation of a Windows operating system a bootsector is written to the first sector of the partition on which it is installed (more than one sector might be used if the partition type is NTFS). Typically the partition boot sector (PBS) will identify which file to load as part of the bootstrap process - when booting Windows XP for example the PBS will load the Windows NT loader ntldr. The filename "ntldr" is hardcoded into the PBS and can be viewed via a hex editor. GRUB and other Linux loaders can also be written to the PBS. To boot the partition boot sector for the first partition on the first hard disk use the command -
Refer to previous section "Master Boot Record (MBR)" above for more information on the "+1" (blocklist) notation.
To boot from the first floppy disk drive (fd0) use command -
To map the disk image win98.ima on device (hd0,0) as a virtual floppy disk drive (fd0), then boot the virtual device -
Refer to Map section here for a more detailed explanation of the above commands.
Alternatively the memdisk kernel (part of the Syslinux package) can be used to boot disk images. The following example uses memdisk to boot the disk image win98.ima (on device (hd0,0)) -
To boot from CD/DVD drive -
If the (cd) device is not detected, or the above command does not work, then try -
If the CD still fails to boot and you are returned to the menu (or command line), the cdrom driver will still be running. To stop the cdrom enter the commands, map --unhook [enter], cdrom --stop [enter].
To boot a CD that Grub4dos is unable to boot, try using BCDL (Bootable CD Loader) - available here (or here). The program is downloaded as a floppy disk image, which can be booted using the map command, e.g. -
Alternatively, use a gzip'ed compressed image, e.g. -
NOTE - the newer version of BCDL (version 2.01a) worked during testing despite being an alpha release. The older (stable) version 1.50z, did not.
To directly chainload the NT loader file ntldr (installed on the first partition of the first hard disk) use the command -
Assuming only one Windows NT OS is installed the following command could also be used (if more than one Windows NT OS is installed the first one found will be loaded) -
NOTE - NT based systems must be installed on the first hard disk - attempting to boot from the second hard disk will fail. It is possible to boot from Windows on device (hd1) by remapping the drive to (hd0) – see here.
To boot into the Windows NT/2000/XP Recovery Console, use either of the following entries -
The process for booting Vista based systems is similar to booting older NT based systems and the OS files should be contained on the first hard disk (or remapped disk). To boot Vista either chainload the MBR/partition boot sector, or directly chainload the Vista loader file bootmgr. To chainload bootmgr on the first partition of the first hard disk (device (hd0,0)) -
Some notes from README_GRUB4DOS.txt -
To boot Linux systems we need to use the kernel and initrd commands – with paths to the relevant files. E.g. to boot Puppy Linux (kernel file vmlinuz and initrd file initrd.gz) on a USB flash drive (recognised as second hard disk with one partition by the BIOS) use command -
Due to the immense variety of Linux based Operating Systems it is not possible to list the required Grub4dos entries. You will need to identify the relevant command for the distro, then manually enter the configuration file entry.
To boot MS DOS (or DOS based OS's such as Windows 9x/ME) you can either chainload the partition boot sector of the relevant partition or directly chainload the file io.sys. E.g. if DOS files are located in the second partition on the first hard disk -
Similarly, FreeDOS can be booted by either chainloading the partition boot sector of the relevant partition, or directly chainloading the file kernel.sys -