Go to the first, previous, next, last section, table of contents.
For Multiboot-compliant kernels, GRUB can load them in a consistent way, but, for some free operating systems, you need to use some OS-specific magic.
GRUB has two distinct boot methods. One of the two is to load an operating system directly, and the other is to chain-load another boot loader which then will load an operating system actually. Generally speaking, the former is desirable, because you don't need to install or maintain other boot loaders and GRUB is flexible enough to load an operating system from an arbitrary disk/partition. However, the latter is sometimes required, since GRUB doesn't support all the existing operating systems natively.
Multiboot (see section `Motivation' in The Multiboot Specification) is the native format supported by GRUB. For the sake of convenience, there are also support for Linux, FreeBSD, NetBSD and OpenBSD. If you want to boot other operating systems, you will have to chain-load them (see section Load another boot loader to boot unsupported operating systems).
Generally, GRUB can boot any Multiboot-compliant OS in the following steps:
Linux, FreeBSD, NetBSD and OpenBSD can be booted in a similar manner. You can load a kernel image by the command @command{kernel} and then run the command @command{boot}. If the kernel requires some parameters, just append the parameters to @command{kernel}, after the file name of the kernel. Also, please refer to section Some caveats on OS-specific issues, for the information on your OS-specific issues.
If you want to boot an unsupported operating system (e.g. Windows 95), chain-load a boot loader for the operating system. Normally, the boot loader is embedded in the boot sector of the partition on which the operating system is installed.
grub> rootnoverify (hd0,0)
grub> makeactive
grub> chainloader +1`+1' indicates that GRUB should read one sector from the start of the partition. The complete description about this syntax can be found in section How to specify block lists.
However, DOS and Windows have some deficiencies, so you might have to use more complicated instructions. See section DOS/Windows, for more information.
Here, we describe some caveats on several operating systems.
Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is nothing special about it. But do not forget that you have to specify a root partition to the kernel.
find /boot/gnumach
or similar can help you
(see section find).
grub> kernel /boot/gnumach root=hd0s1 grub> module /boot/serverboot
It is relatively easy to boot GNU/Linux from GRUB, because it somewhat resembles to boot a Multiboot-compliant OS.
find /vmlinuz
or similar can help you (see section find).
grub> kernel /vmlinuz root=/dev/hda1If you need to specify some kernel parameters, just append them to the command. For example, to set @option{vga} to `ext', do this:
grub> kernel /vmlinuz root=/dev/hda1 vga=extSee the documentation in the Linux source tree for the complete information on the available options.
grub> initrd /initrd
Caution: If you use an initrd and specify the `mem=' option to the kernel, to let it use less than actual memory size, you will also have to specify the same memory size to GRUB. To let GRUB know the size, run the command @command{uppermem} before loading the kernel. See section uppermem, for more information.
GRUB can load the kernel directly, either in ELF or a.out format. But this is not recommended, since FreeBSD's bootstrap interface sometimes changes heavily, so GRUB can't guarantee to pass kernel parameters correctly.
Thus, we'd recommend loading the very flexible loader `/boot/loader' instead. See this example:
grub> root (hd0,a) grub> kernel /boot/loader grub> boot
GRUB can load NetBSD a.out and ELF directly, follow these steps:
grub> kernel --type=netbsd /netbsd-elf
For now, however, GRUB doesn't allow you to pass kernel parameters, so it may be better to chain-load it instead, for more information please see section Load another boot loader to boot unsupported operating systems.
The booting instruction is exactly the same as for NetBSD (see section NetBSD).
GRUB cannot boot DOS or Windows directly, so you must chain-load them (see section Load another boot loader to boot unsupported operating systems). However, their boot loaders have some critical deficiencies, so it may not work to just chain-load them. To overcome the problems, GRUB provides you with two helper functions.
If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one. The workaround used in GRUB is the command @command{map} (see section map), like this:
grub> map (hd0) (hd1) grub> map (hd1) (hd0)
This performs a virtual swap between your first and second hard drive.
Caution: This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won't work.
Another problem arises if you installed more than one set of DOS/Windows onto one disk, because they could be confused if there are more than one primary partitions for DOS/Windows. Certainly you should avoid doing this, but there is a solution if you do want to do so. Use the partition hiding/unhiding technique.
If GRUB hides a DOS (or Windows) partition (see section hide), DOS (or Windows) will ignore the partition. If GRUB unhides a DOS (or Windows) partition (see section unhide), DOS (or Windows) will detect the partition. Thus, if you have installed DOS (or Windows) on the first and the second partition of the first hard disk, and you want to boot the copy on the first partition, do the following:
grub> unhide (hd0,0) grub> hide (hd0,1) grub> rootnoverify (hd0,0) grub> chainloader +1 grub> makeactive grub> boot
It is known that the signature in the boot loader for SCO UnixWare is wrong, so you will have to specify the option @option{--force} to @command{chainloader} (see section chainloader), like this:
grub> rootnoverify (hd1,0) grub> chainloader --force +1 grub> makeactive grub> boot
Go to the first, previous, next, last section, table of contents.