Sample liloconf File

A lilo.conf file starts with a global section that contains options that apply to the entire LILO process. Some of these entries relate to the installation of LILO by /sbin/lilo, and are only indirectly related to the boot process.

Note The program /sbin/lilo is not the boot loader. The LILO boot loader is a simple loader stored in a boot sector. /sbin/lilo is the program that installs and updates the LILO boot loader.

Comments in the lilo.conf file start with a sharp sign (#). The first active line of the global section in the sample file identifies the device that contains the boot sector. The option boot=/dev/hda3 says that LILO is stored in the boot sector of the third partition of the first IDE disk drive. This tells us two things: where LILO is installed and where it isn't installed. LILO is not installed in the MBR of this system; it is installed in hda3, which must be the active partition.

The configuration option map=/boot/map defines the location of the map file, which contains the physical locations of the operating system kernels in a form that can be read by the LILO boot loader. (GRUB does not require a map file because it can read Linux filesystems directly.) /boot/ map is the default value for the map option, so, in this case, it does not really need to be explicitly defined in the sample configuration file.

The install=/boot/boot.b line defines the file that /sbin/lilo installs in the boot sector. (boot.b is the LILO boot loader.) In this case, the line is not actually required because /boot/boot.b is the default value for install.

The prompt option causes the boot prompt to be displayed. If the prompt option is not included in the lilo.conf file, the user must press a Shift, Ctrl, or Alt key; or set the Caps Lock or Scroll Lock key to get the boot prompt. The message displayed at the boot prompt is contained in the file identified by the message option. In the example, message points to a file named /boot/ message that contains a full-screen display. If the message option is not used, the default boot prompt boot: is used.

The timeout entry defines how long the system should wait for user input before booting the default operating system. The time is defined in tenths of seconds. Therefore, timeout=50 tells the system to wait five seconds.

Warning Don't use prompt without timeout. If the timeout option is not specified with the prompt option, the system will not automatically reboot. It will hang at the boot prompt, waiting for user input, and will never time out. This could be a big problem for an unattended server.

If the timeout is reached, the default kernel is booted. The default option identifies the default kernel. In Listing 1.2, the operating system that has the label "linux"is the one that will be started by default. To boot Microsoft Windows as the default operating system, simply change the default option to default=dos. The remainder of this configuration file provides the information that LILO needs to find and boot either Linux or Windows.

The image statement specifies the location of the Linux kernel, which is /boot/vmlinuz-2.4.7-10 in this example. The image option allows you to put the Linux kernel anywhere and name it anything. The ability to change the name of the kernel comes in very handy when you want to do a kernel upgrade, which is discussed in Chapter 13, "Troubleshooting."

There are several "per-image" options used in the configuration file, some of which are specific to kernel images. The label=linux option defines the label that is entered at the boot prompt to load this image. Every image defined in the sample file has an associated label entry; if the operator wants to boot an image, they must enter its label.

The next option, read-only, is also kernel-specific. It applies to the root filesystem described previously. The read-only option tells LILO that the root filesystem should be mounted read-only.

This protects the root filesystem during the boot and ensures that the filesystem check (fsck) runs reliably. Later in the startup process, the root will be re-mounted as read/write after fsck completes. See the discussion of rc.sysinit later in this chapter.

The root=/dev/hda3 option is also kernel-specific. It defines the location of the root filesystem for the kernel. The lilo.conf file should have a root option associated with the kernel image. If it is not defined here, the root filesystem must be defined separately with the rdev command. However, don't do that; define the root in the LILO configuration.

The last three lines in the sample file define the other operating system that LILO is able to boot. The other OS is located in partition 1 of the first IDE drive, other=/dev/hda1. As the label=dos entry indicates, it is Microsoft Windows. The optional command tells /sbin/lilo, which is called the mapper, that when it builds the map file, it should consider this operating system optional. That means that /sbin/lilo should complete building the map file, even if this operating system is not found.

Whenever you modify the LILO configuration, invoke /sbin/lilo to install the new configuration. Until /sbin/lilo is run and maps the new configuration options, they have no effect. The grub.conf file, on the other hand, does not require any special processing. Changes to the GRUB configuration take effect immediately.

Only Linux and one other operating system appear in the sample file, which is the most common case for desktop clients. However, LILO can act as the boot manager for up to 16 different operating systems. It is possible to see several other and image options in a lilo.conf file. Multiple image options are used when testing different Linux kernels. The most common reason for multiple other options is a training system in which users boot different OSs to learn about them. In an average operational environment, only one operating system is installed on a server, and no more than two operating systems are installed on a client.

Was this article helpful?

0 0

Post a comment