LILO

LILO is the linux loader. When it is good, it is very good, but when it is bad, look out. If it is bad, you will be wishing you had a boot floppy to save your bacon. If you are lucky I will have a page on how to make one.

I now avoid much of the misery that I once suffered by setting up a tiny (like 16M or so) /boot partition at the start of my boot hard disk. This leads us into the whole business of partitioning strategies, but a separate essay on this business is worthwhile.

The way LILO works on your system is governed by the /etc/lilo.conf file. The usual business is to edit lilo.conf and then rerun lilo by invoking /sbin/lilo. You must do this whenever you rebuild a kernel and place it into the /boot directory. As near as I can tell, something pretty much like this happens: The lilo program examines the images you want to boot and determines their actual block numbers and sticks them somewhere so that the lilo loader can find them at boot time. This means that the lilo loader at boot time doesn't have to know beans about your filesystem. It also means that if you forget to run the lilo program, you will be booting your old kernel, or perhaps you won't be booting at all!

Maybe you noticed in the last paragraph that I called one thing the lilo program and another the lilo loader. It will save you a lot of confusion to keep these straight. The program is what you invoke as /sbin/lilo to set things up to boot later. The lilo loader is the thing that goes into the boot record (like the MBR) on disk and actually runs when you boot (sometime after the BIOS and before Linux). They are both called LILO just to keep things interesting.

There is really good documentation on LILO out there. I will try to find a copy of it that will gradually get more and more out of date and keep it here for your convenience. You can probably find it on your system under /usr/doc/lilo-, or in a similar place on your documentation CD if you are running a Red Hat system. Failing this, you can go out on the net and get the very latest version.

LILO has many options and abilities. I have used it to support dual boot systems and select linux or one of those other spreads on startup. You can have it select different kernels (typically an old trusty kernel, and a new buggy kernel).

My lilo.conf looks like this:

boot=/dev/sda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=linux

image=/boot/vmlinuz
	label=linux
	initrd=/boot/initrd-2.2.14-5.0.img
	read-only
	root=/dev/sda5

image=/boot/vmlinuz-2.2.14-5.0
	label=linuxg
	initrd=/boot/initrd-2.2.14-5.0.img
	read-only
	root=/dev/sda5

Have any comments? Questions? Drop me a line!

Adventures in Computing / ttrebisky@as.arizona.edu