Chapter 1: Introduction to GRUB 1
1 Introduction to GRUB
is the ﬁrst software program that runs when a computer starts. Itis responsible for loading and transferring control to an operating system
software(such as Linux or GNU Mach). The kernel, in turn, initializes the rest of the operatingsystem (e.g. a GNU system).GNU GRUB is a very powerful boot loader, which can load a wide variety of freeoperating systems, as well as proprietary operating systems with chain-loading
. GRUBis designed to address the complexity of booting a personal computer; both the programand this manual are tightly bound to that computer platform, although porting to otherplatforms may be addressed in the future.One of the important features in GRUB is ﬂexibility; GRUB understands ﬁlesystemsand kernel executable formats, so you can load an arbitrary operating system the way youlike, without recording the physical position of your kernel on the disk. Thus you can loadthe kernel just by specifying its ﬁle name and the drive and partition where the kernelresides.When booting with GRUB, you can use either a command-line interface (seeSec-tion 12.1 [Command-line interface], page 22), or a menu interface (seeSection 12.2 [Menuinterface], page 23). Using the command-line interface, you type the drive speciﬁcation andﬁle name of the kernel manually. In the menu interface, you just select an OS using thearrow keys. The menu is based on a conﬁguration ﬁle which you prepare beforehand (seeChapter 5 [Conﬁguration], page 13). While in the menu, you can switch to the command-line mode, and vice-versa. You can even edit menu entries before using them.In the following chapters, you will learn how to specify a drive, a partition, and aﬁle name (seeChapter 2 [Naming convention], page 4) to GRUB, how to install GRUB onyour drive (seeChapter 3 [Installation], page 5), and how to boot your OSes (seeChapter 4
[Booting], page 9), step by step.Besides the GRUB boot loader itself, there is a
1.2 History of GRUB
GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU Hurd with theUniversity of Utah’s Mach 4 microkernel (now known as GNU Mach). Erich and BrianFord designed the Multiboot Speciﬁcation (seesection “Motivation” in
), because they were determined not to add to the large number of mutually-incompatible PC boot methods.Erich then began modifying the FreeBSD boot loader so that it would understandMultiboot. He soon realized that it would be a lot easier to write his own boot loader fromscratch than to keep working on the FreeBSD boot loader, and so GRUB was born.
is the mechanism for loading unsupported operating systems by loading another bootloader. It is typically used for loading DOS or Windows.