Chapter 4. Boot Methods
This chapter describes some techniques for booting your Linux system. Depending on your hardware and whether you want to run any other operating systems, you can configure the system to boot Linux automatically or to provide a choice between several operating systems. Choosing between operating systems is
Once your Linux system is installed, rebooting the system is generally straightforward. But with the wide variety of hardware and software in use, there are many possibilities for configuring your boot process. The most common choices are:
Other boot managers that can load Linux are available, but we don't discuss them here. We also won't talk further about booting from a floppy or CD or via Loadlin, except to say that whatever method you choose for booting, be sure to have a working boot disk available for emergency use. In particular, don't experiment with the files and options in this chapter unless you have a boot disk, because any error could leave you unable to boot from the hard disk. Note, though, that one of the advantages of using GRUB is that if there is a problem booting from the menu, it
4.1. The Boot Process
On an x86-based PC, the first sector of every hard disk is known as the boot sector and contains the partition table for that disk and possibly also code for booting an operating system. The boot sector of the first hard disk is known as the master boot record (MBR), because when you boot the system, the BIOS transfers control to a program that lives on that sector along with the partition table. That code is the boot loader , the code that initiates an operating system. When you add Linux to the system, you need to modify the boot loader, replace it, or boot from a floppy or CD to start Linux.
In Linux, each disk and each partition on the disk is treated as a device. For example, the entire first hard disk is known as
, and the entire second hard disk is
. The first partition of the first hard drive is
, and the second partition is
. The first partition of the second hard drive is
, and so on. If your
Once you've made the decision to install LILO or GRUB, you still need to decide how it should be configured. If you want your system to dual-boot Linux and Windows 95/98/ME, you can install LILO or GRUB on the MBR and set it up to let you select the system to boot. Dual-booting Linux and Windows NT/2000/XP is not quite as straightforward because these systems use the Windows NT loader, which is installed on the MBR and expects to be in charge. The standard solution described in this chapter is to add Linux as an option in the NT loader and install LILO or GRUB in the Linux partition as a secondary boot loader. The result is that the NT loader transfers control to the secondary loader, which then boots Linux. See Dual-Booting Linux and Windows NT/2000/XP.," later in this chapter, for more information. You can also install one of the Linux boot loaders in the MBR and use it to boot Windows. (See the "Linux+WindowsNT" and the "Multiboot with GRUB" mini-HOWTOs if you're interested in doing that.)
When you install the boot loader (either LILO or GRUB) on the MBR, it
The common element in all three
The rest of this chapter describes the various techniques for booting Linux and the options that you can specify to configure both the boot loader and the Linux kernel. Whether you use LILO or GRUB, you can pass options to the loader and specify options for the kernel.