Lesson 11 | The LILO map installer |
Objective | Use LILO Map Installer to install Boot Loaders |
Use LILO Map Installer to install Boot Loaders in Red Hat
Use the LILO map installer to install first- and second-stage boot loaders.Once you recompile your kernel, you must run the LILO map installer:
/sbin/lilo
. The LILO map installer installs the first- and second-stage boot loaders. It allows you to
- Boot different operating systems
- Select the operating system at boot time
- Pass parameters to the booting kernel
The installer looks through the new kernel and pulls out symbols, versions, and device information.
LILO creates a map file from this information, which LILO will use to correctly boot Linux and other operating systems on your computer.
For this to work, the installer needs to know:
- Which partitions contain boot sectors or root file systems
- How to pass control to bootable partitions
Global keywords and keyword/value Pairs
Global keywords and value pairs used in
/etc/lilo.conf
stanzas include
image=/boot/vmlinuz-2.2.14-1.0:
The kernel image to boot
label=linux:
The label for a kernel image displayed at the LILO prompt
append="aha152x=0x340,11,7,1":
Additional parameters to pass to LILO
root=/dev/hda6:
The location of the root filesystem
other=/dev/hdb1:
The location of an alternate operating system
Blank lines and comments beginning with a pound sign (#) are ignored. All other lines contain keyword/value pairs.
For example, the keyword MAIL_DIR is followed by some white space and the value
/var/spool/mail.
This tells useradd that the initial user e-mail mailbox is created in that directory. Following that are lines that enable you to customize the valid range of automatically assigned user ID numbers or group ID numbers. A comment section that explains that keyword's purpose precedes each keyword. Altering a default value is as simple as editing the value associated with that keyword and then saving the login.defs file. If you want to view the defaults, type the useradd command with the -D option as follows.
# useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREAT_MAIL_SPOOL=yes
Keywords in /etc/lilo.conf stanzas
Keywords in the
/etc/lilo.conf
stanzas include
boot=/dev/hda
The location of the first stage loader.
map=/boot/map
The map file to install.
install=/boot/boot.b
The second stage loader. If this is omitted, the default is /boot/boot.b
.
prompt
Displays the LILO prompt without requiring the user to press the Shift key. If this is set, but the timeout is not set, the prompt will wait indefinitely.
-
timeout=50
The time, in tenths of a second, the computer will wait for the user to intervene at the LILO prompt. If this value is not set, the computer will wait indefinitely.
delay=50
The time, in tenths of a second, the computer will wait before booting the default image. If this value is absent or zero, the computer boots the default image immediately.
message=/etc/lilo.msg
A file containing a message to be displayed at the LILO prompt.
linear
Generates linear sector addresses rather than sector/cylinder/head
addresses for hard drives. This is needed only for some hardware, but should not be changed without first consulting your hardware's documentation.
password=redhat
A password is required to boot the machine. Because the password is kept unencrypted in /etc/lilo.conf
, you should be certain that the file is readable only by root. To do this, type chmod 400 /etc/lilo.conf
.
restricted
A password is required only if parameters are passed at the LILO prompt.
default=linux
Specifies the default image to be booted if none is specified by the user. (If none, use image in first stanza.)
lilo.conf
Here is an example of a lilo.conf file. The delay switch receives a number in tenths of a second. So the delay below is three seconds, not thirty.
boot = /dev/hda
delay = 30
image = /boot/vmlinuz
root = /dev/hda1
label = Red Hat 5.2
image = /boot/vmlinuz
root = /dev/hda2
label = S.U.S.E. 8.0
other = /dev/hda4
table = /dev/hda
label = MS-DOS 6.22
The configration file shows three example stanzas.
The first one boots Red Hat from the first partition on the first disk (hda1). The second stanza boots Suse 8.0 from the next partition.
The last one loads MS-DOS.
Working with the LILO map installer
After editing your LILO configuration file, test them with
/sbin/lilo
-t
.
Assuming LILO does not give you an error message, install your new configuration with
/sbin/lilo -v
.
If you make a mistake, you can restore your previous copy with
/sbin/lilo -u .
The next lesson concludes this module.