LILO

Also known as: Linux Loader

On this page 7

LILO, short for Linux Loader, is a legacy boot loader for BIOS-based x86 computers that loads the Linux kernel and the initial RAM disk from fixed disk locations recorded in advance. In Linux system initialization, it occupies the first stage after firmware: it runs from the Master Boot Record or a partition boot sector, presents an optional menu and hands control to the kernel.

LILO was the default Linux boot loader through the 1990s and early 2000s. It has since been replaced almost everywhere by GRUB, systemd-boot and other loaders, and upstream development ended in 2015. It remains relevant for maintaining old systems, understanding boot history and some minimal or embedded installations.

How LILO loads the Linux kernel

LILO works without understanding any file system. When the administrator runs the /sbin/lilo map installer, it reads /etc/lilo.conf, finds the physical sectors that hold each kernel and initrd image, and writes those sector addresses into a map file, usually /boot/map. It then installs a small first-stage loader into the MBR or a partition boot record.

At boot, the BIOS loads the 512-byte first stage, which loads the second stage, which in turn reads the map file and fetches the kernel sector by sector through BIOS disk calls. This design keeps the loader tiny and file-system independent, but it means the recorded addresses must remain valid. The famous diagnostic is the letters “LILO” printed one by one; stopping after “LI” or “LIL” reveals which stage failed.

The boot sequence can be broken into the following stages.

StageLocationRole
BIOS POSTFirmwareSelects the boot disk and loads its MBR
First stageMBR or partition boot sectorLoads the second stage from known sectors
Second stage/boot/boot.b areaShows the prompt or menu and reads the map
Map file/boot/mapLists sector addresses of kernels and initrds
Kernel handoffMemoryPasses the command line and starts the kernel
LILO boot stages

The lilo.conf configuration and the map installer

The file /etc/lilo.conf defines global settings and one stanza per bootable image. Global options set the boot device, the timeout and the default entry, while each image= or other= stanza names a kernel or a foreign operating system with its label, root device and kernel command line parameters.

DirectiveMeaningExample value
bootDevice that receives the loader/dev/sda
mapPath of the map file/boot/map
timeoutMenu wait in tenths of a second50
defaultLabel booted automaticallylinux
imagePath to a kernel image/boot/vmlinuz
initrdPath to the initial RAM disk/boot/initrd.img
appendExtra kernel parametersquiet nomodeset
otherChain-loaded partition/dev/sda2
Important lilo.conf directives

The critical operational rule is that editing lilo.conf changes nothing by itself. The administrator must rerun /sbin/lilo after every configuration change and after every kernel or initramfs update, because only that command recalculates the block map. Running lilo -t -v performs a test run that reports problems without writing the boot sector.

LILO compared with GRUB and other loaders

LILO differs from modern loaders mainly because it reads no file systems at boot time. GRUB, systemd-boot, Syslinux and rEFInd locate kernels by path when the machine starts, so they tolerate kernel updates and can be edited interactively, while LILO depends entirely on a map written beforehand.

LoaderFirmware supportFinds kernels byRerun after kernel update
LILOBIOS onlyPrecomputed sector mapYes
GRUB 2BIOS and UEFIFile system driversOnly to regenerate menu
systemd-bootUEFI onlyEFI system partition filesNo
SyslinuxBIOS and UEFIFAT, ext or ISO pathsNo
rEFIndUEFI onlyAutomatic scanningNo
Boot loader comparison

LILO’s strength was simplicity and predictability: a small code base, no interpreter and no scripting layer. Its weakness was fragility, since any change to the physical location of a kernel invalidates the map. GRUB’s ability to recover from a missing configuration through its command shell made it the safer choice for general-purpose distributions.

Limitations and why distributions dropped LILO

LILO has no UEFI support, so it cannot boot modern machines in native mode and works only with legacy BIOS or Compatibility Support Module booting. Early versions were also limited by the 1024-cylinder BIOS barrier, which required kernels near the start of the disk until the lba32 option removed that restriction.

Because it relies on sector addresses, LILO handles complex storage poorly. Software RAID needs special options, logical volumes and encrypted roots demand an unencrypted /boot, and file systems that relocate data, such as Btrfs, can move blocks and break the map. The table below summarizes typical failures.

SymptomLikely causeFix
Stops at “L”Second stage not loaded or disk errorReinstall loader from rescue media
Stops at “LI”Second stage at wrong addressRerun /sbin/lilo after moving files
Stops at “LIL-“Map file damaged or misplacedRebuild map with /sbin/lilo
Old kernel bootslilo not rerun after updateRun lilo and reboot
Kernel panic on rootWrong root= or missing initrdCorrect the stanza and rerun lilo
Common LILO failures
  • Forgetting to rerun lilo after a kernel update is the classic cause of unbootable systems.
  • Overwriting another loader’s MBR removes the previous boot menu; back up the first sector with dd first.
  • Assuming password protection is strong, although the lilo.conf password is weak without physical security.

Where LILO still appears today

LILO survives mainly on legacy servers and appliances installed long ago, in some retro-computing and minimal distributions, and in Slackware history, where it remained the default far longer than elsewhere. Debian removed it from its archive, and most other distributions dropped it during the transition to UEFI.

For any new installation the recommended choice is GRUB 2 for broad compatibility, or systemd-boot on UEFI systems that want a minimal loader. Administrators who inherit a LILO system usually migrate during the next hardware refresh, installing GRUB from a rescue environment and verifying the new menu before removing lilo.conf.

The simple explanation

When a computer switches on, something has to find Linux on the disk and start it. LILO was one of the first programs to do that job. It works like a treasure map written in advance. Before shutdown, a helper program notes the exact spot on the disk where Linux sits.

At startup LILO simply follows the map. That makes it fast and simple. The catch is that the map must be redrawn every time Linux is updated. If nobody redraws it, the computer may not start. Newer tools search the disk themselves, so they replaced LILO.

How it is used in practice

An engineer at a regional utility maintains an industrial control workstation installed in 2006 that still boots with LILO from a BIOS machine. A security patch requires a new kernel. The engineer copies the kernel to /boot/vmlinuz-new, adds a stanza with the label new while keeping the old entry as a fallback, and runs lilo -t -v to test the map.

After the test reports no errors, the engineer runs /sbin/lilo, reboots and selects the new label at the prompt. The system starts cleanly, so the default entry is updated and lilo is run once more. The careful sequence means the plant gets the patched kernel with a guaranteed rollback path, and the workstation is scheduled for migration to GRUB at the next hardware replacement.