One thing to remember about LILO is that it has two aspects: the boot loader and the lilo command. The lilo command configures and installs the boot loader and updates it as necessary. The boot loader is the code that executes at system boot time and boots Linux or another operating system.
The lilo command reads the LILO configuration file, /etc/lilo.conf, to get the information it needs to install LILO. Among other things, it builds a map file containing the locations of all disk sectors needed for booting.
Note that any time you change /etc/lilo.conf or rebuild or move a kernel image, you need to rerun lilo to rebuild the map file and update LILO.
The configuration file starts with a section of global options, described in the next section. Global options are those that apply to every system boot, regardless of what operating system you are booting. Here is an example of a global section (a hash sign, #, begins a comment):
boot=/dev/hda # The boot device is /dev/hda map=/boot/map # Save the map file as /boot/map install=/boot/boot.b # The file to install as the new boot sector prompt # Always display the boot prompt timeout=30 # Set a 3-second (30 tenths of a second) timeout
Following the global section, there is one section of options for each Linux kernel and for each non-Linux operating system that you want LILO to be able to boot. Each of these sections is referred to as an image section because each boots a different kernel image (shorthand for a binary file containing a kernel) or another operating system. Each Linux image section begins with an image= line.
image=/boot/vmlinuz # Linux image file label=linux # Label that appears at the boot prompt root=/dev/hda2 # Location of the root filesystem vga=ask # Always prompt the user for VGA mode read-only # Mount read-only to run fsck for a filesystem check
The equivalent section for a non-Linux operating system begins with other= instead of image=. For example:
other=/dev/hda1 # Location of the partition label=win98 table=/dev/hda # Location of the partition table
Put LILO configuration options that apply to all images into the global section of /etc/lilo.conf, and options that apply to a particular image into the section for that image. If an option is specified in both the global section and an image section, the setting in the image section overrides the global setting for that image.
Here is an example of a complete /etc/lilo.conf file for a system that has the Linux partition on /dev/hda2:
## Global section boot=/dev/hda2 map=/boot/map delay=30 timeout=50 prompt vga=ask ## Image section: For regular Linux image=/boot/vmlinuz label=linux root=/dev/hda2 install=/boot/boot.b map=/boot/map read-only ## Image section: For testing a new Linux kernel image=/testvmlinuz label=testlinux root=/dev/hda2 install=/boot/boot.b map=/boot/map read-only optional # Omit image if not available when map is built ## Image section: For booting DOS other=/dev/hda1 label=dos loader=/boot/chain.b table=/dev/hda # The current partition table ## Image section: For booting Windows 98 other=/dev/hda1 label=win98 loader=/boot/chain.b table=/dev/hda
In addition to the options listed here, the kernel options append, read-only, read-write, root, and vga (described later in Section 4.2.1.3) also can be set as global options.
disk=/dev/sda bios=0x80 # First disk is usually 0x80, second is usually 0x81 sectors=... heads=...
Note that this option is not the same as the disk geometry parameters you can specify with the hd boot command-line option. With disk, the information is given to LILO; with hd, it is passed to the kernel. Note also that if either heads or sectors is specified, they must both be specified. The parameters that can be specified with disk are listed briefly here; they are described in detail in the LILO User's Guide.
partition=/dev/sda1 start=2048
[4]If your BIOS is dated after 1998, it should include EDD packet call interface support.
port[,bps[parity[bits]]]
For example, to initialize COM1 with the default parameters:
serial=0,2400n8
The parameters are:
The following options are specified in the image section for a particular boot image. The image can be a Linux kernel or a non-Linux operating system.
image=/dev/fd0 range=1+512 # take 512 sectors, starting with sector 1
The following kernel options can be specified in /etc/lilo.conf as well as on the boot command line:
append="mem=128M"
You need to run the lilo command to install the LILO boot loader and to update it whenever the kernel changes or to reflect changes to /etc/lilo.conf.
The path to the lilo command is usually /sbin/lilo. The syntax of the command is:
lilo [options]
Some of the options correspond to /etc/lilo.conf keywords:
Configuration keyword |
Command option |
---|---|
boot=bootdev |
-b bootdev |
compact |
-c |
delay=tsecs |
-d tsecs |
default=label |
-D label |
disktab=file |
-f file |
install=bootsector |
-i bootsector |
lba32 |
-L |
linear |
-l |
map=mapfile |
-m mapfile |
fix-table |
-P fix |
ignore-table |
-P ignore |
backup=file |
-s file |
force-backup=file |
-S file |
verbose=level |
-v |
These options should be put in the configuration file whenever possible; putting them on the lilo command line instead of in /etc/lilo.conf is now deprecated. The next section describes those options that can be given only on the lilo command line; the others were described earlier.
The following list describes lilo command options that are available only on the command line. Multiple options are given separately; for example:
% lilo -q -v
% lilo -I linux /boot/vmlinuz-2.0.34-0.6
% lilo -q linux * test
% mount /dev/hda2 /mnt % lilo -r /mnt
Copyright © 2003 O'Reilly & Associates. All rights reserved.