LILO is a boot loader, which can be used to select either Linux, MS-DOS, or some other operating system at boot time. If you install LILO as the primary boot loader, it will handle the first-stage booting process for all operating systems on your drive. This works well if MS-DOS is the only other operating system that you have installed. However, you might be running OS/2, which has it's own Boot Manager. In this case, you want OS/2's Boot Manager to be the primary boot loader, and use LILO just to boot Linux (as the secondary boot loader).
The Slackware installation procedure allows you to install and configure LILO. However, this method doesn't seem to be smart enough to handle several peculiar situations. It might be easier in some cases to configure LILO by hand.
In order to set up LILO for your system, just edit the file
/etc/lilo.conf
. Below we present an example of a LILO
configuration file, where the Linux root partition is on
/dev/hda2
, and MS-DOS is installed on /dev/hdb1
(on
the second hard drive).
# Tell LILO to install itself as the primary boot loader on /dev/hda.
boot = /dev/hda
# The boot image to install; you probably shouldn't change this
install = /boot/boot.b
# Do some optimization. Doesn't work on all systems.
compact
# The stanza for booting Linux.
image = /vmlinuz # The kernel is in /vmlinuz
label = linux # Give it the name "linux"
root = /dev/hda2 # Use /dev/hda2 as the root filesystem
vga = ask # Prompt for VGA mode
append = "aha152x=0x340,11,7,1" # Add this to the boot options,
# for detecting the SCSI controller
# The stanza for booting MS-DOS
other = /dev/hdb1 # This is the MS-DOS partition
label = msdos # Give it the name "msdos"
table = /dev/hdb # The partition table for the second drive
Once you have edited the /etc/lilo.conf
file, run
/sbin/lilo
as root
. This will install LILO
on your drive. Note that you must rerun /sbin/lilo
anytime that you recompile your kernel (something that you don't
need to worry about just now, but keep it in mind).
Note how we use the append
option in /etc/lilo.conf
to specify boot parameters as we did when booting the Slackware bootdisk.
You can now reboot your system from the hard drive. By default LILO
will boot the operating system listed first in the configuration file,
which in this case is Linux. In order to bring up a boot menu, in
order to select another operating system, hold down shift
or
ctrl
while the system boots; you should see a prompt such as
Boot:
Here, enter either the name of the operating system to boot (given
by the label
line in the configuration file; in this
case, either linux
or msdos
), or press tab
to get a list.
Now let's say that you want to use LILO as the secondary boot loader;
if you want to boot Linux from OS/2's Boot Manager, for example.
In order to boot a Linux partition from OS/2 Boot Manager, unfortunately,
you must create the partition using OS/2's FDISK
(not Linux's),
and format the partition as FAT or HPFS, so that OS/2 knows about it.
(That's IBM for you.)
In order to have LILO boot Linux from OS/2 Boot Manager, you only want
to install
LILO on your Linux root filesystem (in the above example,
/dev/hda2
). In this case, your LILO config file should look
something like:
boot = /dev/hda2
install = /boot/boot.b
compact
image = /vmlinuz
label = linux
root = /dev/hda2
vga = ask
Note the change in the boot
line. After running
/sbin/lilo
you should be able to add the Linux
partition to Boot Manager. This mechanism should work for
boot loaders used by other operating systems as well.
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter