III. Boot managers
Linux Loader, or shortly LILO, is a versatile Linux boot manager. It does not depend on a specific file system, can boot Linux kernel images from floppy and hard disks. On a machine with multiple operating systems installed, LILO can be used to boot other than Linux operating systems. LILO can be installed into VBS, or alternatively into MBR of any hard disk present on the system. When LILO is installed into MBR of the boot disk, it takes control over the boot process of the machine. In both cases, however, LILO allows to select the partition to boot off the operating system. It depends on the user's preferences which boot manager is a default one. If e.g. Solaris and Linux are configured adequately on a machine, endless cycling through Solaris and Linux boot managers is possible.
Before we enter into the details of LILO configuration, some knowledge on how
media devices are named in Linux is worth mentioning. All devices in Linux, as
in Unix system, are accessed by (device) files. Floppy disks are addressed by
/dev/fd1, which correspond to DOS drive
A: nad B:, respectively. IDE/ATA hard disk drives are addressed as follows:
/dev/hdb- primary slave,
/dev/hdc- secondary master,
/dev/hdd- secondary slave.
Note that drive lettering is the same as in BIOS boot sequence setting. SCSI hard
disk drives are addressed by
so on. Letter 'a' means the first device in the SCSI chain, 'b' the second one
and so on.
Primary partitions on, both IDE/ATA and SCSI, hard disk drives are numbered from
1 to 4, so that e.g. the second primary partition on a secondary master IDE/ATA
drive is addressed by
/dev/hdc2. Extended partitions have no their
addresses, as they are useless. Logical volumes on extended partitions are numbered
from 5 up, so that e.g. the third logical volume on the extended partition on a
primary slave IDE/ATA drive is addressed by
LILO is fully customizable. Its configuration file is
LILO is initially preconfigured during the Linux installation process. With these,
default settings LILO knows nothing about other operating systems installed on
a machine, and can boot only Linux. In this situation it behaves simply as DOS
or Windows 9x, which can't boot anything but themselves.
The syntax of the
/etc/lilo.conf file is simplified. It contains
variables that can have values assigned to, and switches. Some variables
implicitly determine sections. We discuss only those variables and switches
which are necessary to configure LILO to boot Linux and other operating systems.
For more details refer to LILO documentation distributed along Linux,
[Veselosky] or [Skoric].
/etc/lilo.conf may look as follows:
boot=/dev/hda map=/boot/map install=/boot/boot.b compact prompt timeout=50 image=/boot/vmlinuz-2.0.39 label=linux root=/dev/hda3 read-only other=/dev/hda1 label=nt other=/dev/hda2 label=solaris
This example file is taken from the system with one IDE/ATA hard disk drive with NT installed on the first primary partition, Solaris on the second one and Linux on the third one. LILO is installed into MBR and is used as the default boot manager. Used variables and switches have the following meaning.
/dev/hdatells LILO to install into MBR of a primary master IDE/ATA hard disk drive.
/dev/hdb3means third primary partition on a primary slave drive, and
/dev/sda5means the first logical volume on the extended partition on the first SCSI drive.
/boot/vmlinuz-2.0.39. This variable begins a section, and the lines that follow give specific parameters for this particular kernel. You may have up to sixteen image sections, but one should suffice. The first image listed in the file is the default, unless you specify otherwise.
/etc/lilo.conf is modified, we have to apply changes
to take effect. To do that run as root :
Successful configuration of Linux and other operating systems specified in
/etc/lilo.conf is reported by displaying "Added label".
An asterisk indicates the default operating system to boot.
Though LILO realizes relatively advanced tasks, its usage is simplified. It is
not menu driven, instead a prompt "LILO:" for user input is displayed. LILO
then waits the amount of time specified in
/etc/lilo.conf and if
there is no user input, it loads the default operating system. Operating
systems are selected by their labels specified in
To list all available identifiers TAB key may be pressed.
Additional parameters to Linux kernel may be given after the Linux identifier.
When Linux is installed prior other operating system, LILO that was written
into MBR may no longer be available. This happens when e.g. DOS, Windows,
including NT and W2K, or Solaris are installed after Linux. LILO might be
wiped out not only during other operating system installation, but also
by certain disk utilities or anti-virus software. In case we want LILO to
manage the boot process from its very beginning, it needs to be restored.
This is done the same way changes to LILO configuration are applied. So,
Linux must be booted some other way, e.g. by Loadlin or Linux boot floppy,
/sbin/lilo must be run by root.
Keep in mind that this procedure restores Master Boot Code only, not Master Partition Table. That is in case of disaster, when entire MBR is lost, restoring LILO as described above will not fix the problem. In general this means that the data on the hard disk drive is lost. To avoid such problems MBR should be backed up after every modification.
Discussing LILO and its configuration we should mention that it is possible to
remove LILO from MBR safely. Before LILO is installed the original Master Boot
Code is saved for future restoration. This feature may be used when one decides
to uninstall Linux. It is done by running
/sbin/lilo with option
-u. If Linux can not be loaded we may also try DOS fdisk utility
or Ranish PM to rebuild MBR.