The LInux LOader is responsible for loading the Linux kernel into memory, passing it some parameters, and then running it. This is the first step in the boot process.

However, LILO also knows a few tricks more. If you have another partition or disk (device) appropriately formatted to be bootable, LILO can boot that, instead. It thus allows dual booting (or, more accurate, multiple booting, since you can have more than just Linux and Windows). For a Linux partition, you can select which kernel image you want to boot. This is mostly useful after compiling a new kernel. You don't want to lose the ability to boot the old one, just in case something doesn't work. Or you can decide at boot time which parameters to pass to the kernel you're booting (or place it all behind the symbolic label you give to an image).

To "recover" a LILOed disk (in order to re-install some versions of Windows, say), you can use "FDISK /mbr" from MS-DOS. The "/mbr" switch is undocumented, except in the LILO documentation.

LILO is only used on x86 Linux. Sparc architectures have SILO; PPC architectures have yaboot and quik; Alpha has aboot. Other architectures tend to have bootloaders that are specific to the hardware in question, as opposed to a generalised one (every different m68k platform has its own boot loader).
As a handy hint for people who have problems with LILO on mixed SCSI/IDE systems, RTFM. If you can't be bothered doing that, the problem is this:

LILO needs to know the order in which the BIOS numbers the hard drives, as it needs to use BIOS calls in order to read the kernel off disk. The Linux kernel provides no trivial mechanism for doing this, and so LILO assumes that the order that the kernel detects the drives in is the same as the order in which the BIOS numbers the drives. This is not always true. Linux generally puts IDE drives before SCSI ones - some BIOSes do the opposite. The situation is therefore something like the following:

          |BIOS | LILO |
/dev/hda  |0x82 | 0x80 |
/dev/sda  |0x80 | 0x81 |
/dev/sdb  |0x81 | 0x82 |
If the kernel is on sda, LILO will attempt to read off drive 0x81 - unfortunately, when booting, this actually refers to the second SCSI drive rather than the first one. Quack quack oops.

Fortunately, the authors provided a mechanism of avoiding this. In your /etc/lilo.conf, simply add something like the following:

disk=/dev/sda
        bios=0x80
disk=/dev/sdb
        bios=0x81
disk=/dev/hda
        bios=0x82

and rerun LILO. Problem solved.

In 1944, the Commonwealth Forces fighting in Southeast Asia were forced to deal more often with suicidal Japanese defenders holed up in massive bunkers. The only way to deal with these strong points was to hit them from extremely close range with heavy artillery.

Due to the difficult terrain of that part of the world, this solution was not always possible. In order to overcome this problem a program was developed to create a portable rocket weapon capable of defeating these defenses. This became known as LILO.

The weapon was a simple single-barreled rocket launching tube, designed to fire at very close ranges against static targets. It held a 3 Inch Rocket Motor Number 7, onto which two types of warhead could be mounted. The first was a 21lb. High Explosive warhead, and the second was basically the same type, but super-sized, weighing in at 60lbs.

Two men were needed to transport the weapon, one carrying the tube, and another carrying the rocket in a special backpack. Their job was to set up as close as possible to the target, load the rocket into the front of the projector, aim, and then fire, turning the target into chunks of hamburger mixed with concrete.

The weapon was aimed over open sights, with the back legs moved in and out to change elevation. Firing was done using a small 3 volt battery.

The warhead was usually sufficient to penetrate 10 feet of earth, plus a layer of logs. This destroyed most Japanese emplacements at the time.

In order to achieve the results desired, major problems with inaccuracy needed to be overcome. If a firer wanted to ensure a hit on even a large target 50 meters away, he would have to fire an average of 5 rockets. This was still less risky than rolling up artillery.

The first launcher tubes were made of plastic, and were thrown away after firing. Later on this waste was removed, and the barrels were made of magnesium alloy. These weapons were used to good effect on Okinawa, and other allied assaults late in the war.

Troubleshooting LILO

Troubleshooting LILO can be a bit of a nightmare for newbies. Because LILO has to fit in the boot block or master boot record, it was coded to have an extremely small footprint. And part of what was sacrificed to make it so small is descriptive error messages.

A normal boot up with LILO looks like this:
LILO 22.5.9 Loading Linux-2.4.26......

If all is well, you should now see your operating system booting.

The four letters (L I L O ) actually correspond to the four stages the boot loader passes through before chaining the operating system. As it passes each stage, it writes out the corresponding letter. If it fails at a particular point it will not advance to the next stage, so this way you can tell where it's barfing.

Here I will list the different levels, additional error messages you might see, and where to start looking for how to debug the fault. Let us begin.

  • L : LILO has reached the first stage boot loader (located on master boot record). This basically exists only to load and pass control to the second stage boot loader. If this is all you get, then something has gone amiss when LILO attempts to load the secondary boot loader.
    A common fault that occurs here is the BIOS mapping of the drives does not match LILO's perception of them because the BIOS enumerates drive controllers in a different order than the operating system LILO was run from. This error can be fixed by manually specifying disk= in lilo.conf.

    A single L may be followed by a two digit error code, indicating an additional error condition:

    0x00 Internal Error: This code is generated by the sector read routine of the LILO boot loader whenever an internal inconsistency is detected. This might be caused by corrupt files. Try re-building the map file. Another possible cause for this error are attempts to access cylinders beyond 1024 while using the linear option.

    0x01 Illegal Command: This shouldn't happen, but if it does, it may indicate an attempt to access a disk which is not supported by the BIOS.

    0x02 Address mark not found: This usually indicates a media problem. Try again several times.

    0x03 Write-protected disk: This should only occur on write operations.

    0x04 Sector not found: This typically indicates a geometry mismatch. If you're booting a raw-written disk image, verify whether it was created for disks with the same geometry as the one you're using. If you're booting from a SCSI disk or a large IDE disk, you should check whether LILO has obtained correct geometry data from the kernel or whether the geometry definition corresponds to the real disk geometry. Removing compact may help too. So may adding lba32 or linear.

    0x06 Change line active: This means the disk is locked in write open state. Try booting a second time.

    0x07 Invalid initialization: The BIOS failed to properly initialize the disk controller. Check the BIOS setup parameters. A warm boot might help too. (Boot a rescue disc and rerun LILO.)

    0x08 DMA overrun: This shouldn't happen. Try booting again.

    0x09 DMA attempt across 64k boundary: This shouldn't happen, but may inicate a disk geometry mismatch. If applicable, try omitting the COMPACT option. You may need to specify the disk geometry yourself.

    0x0C Invalid media: This shouldn't happen and might be caused by a media error, such as a bad CD. Try booting again.

    0x10 CRC error: A media error has been detected. This is usally uncorrectable on CDs and indicates the media is flawed or not bootable on your hardware. If you get this error on a hard disk, it usually means you have a bad sector on the boot block (Very Bad). Try booting several times, running the map installer (make bzImage install) a second time, mapping out the bad sectors/tracks and, if all else fails, replace the disk.

    0x11 ECC correction successful: A read error occurred, but was corrected. LILO does not recognize this condition and aborts the load process anyway. A reboot should succeed.

    0x20 Controller error: This shouldn't happen. If you keep getting it there may be a fault in your IO controller.

    0x40 Seek failure: This might be a media problem. Try booting again. If it keeps happening it could be the BIOS incorrectly detecting the disk geometry.

    0x80 Disk timeout: The disk or the drive isn't waking up in time. Either the media is bad or the disk isn't spinning. If you're booting from a floppy, you might not have closed the drive door. Otherwise, trying to boot again might help.

    0xBB BIOS error: This shouldn't happen. Try booting again. If the problem persists, removing the compact option or adding/removing linear or lba32 might help.


  • LI : Second stage boot loader (located on partition 'boot' block). This reads information on the partitions from the MBR and what was written out to disk when LILO was installed.
    If LILO fails here it means it has loaded the second stage boot loader into RAM, but failed at some point in executing it. This usually means it was unable to calculate the correct address to read from (due to bung data from bios or lilo.conf) and jumped into a sea of zeroes or other bad data. Check BIOS settings and geometry definitions in lilo.conf.

  • LIL : The second stage boot loader has been started, but it can't load the descriptor table from the map file. This is typically caused by a media failure or by bad disk parameters in the IPCop PC's BIOS. It can also be caused by a bung boot= directive in lilo.conf.
    Under rare circumstances, you may also see one of the following:
    LIL- indicates the descriptor table is corrupt. This can be caused by bad BIOS parameters, or a bad partition table.
    LIL? indicates the destination address for loading the secondary boot loader was invalid. This can be caused by faulty RAM, or bad BIOS parameters.

  • LILO of course indicates a successful load and initialisation of the boot loader.
This information has been gleaned from the Linux Documentation Project, man pages and my personal experience. Much of it was ripped from the LILO users guide at www-user.tu-chemnitz.de/~mibe/linux/lilo/user.

Log in or register to write something here or to contact authors.