LILO(8)

πŸ“¦ version 24.2, in nixos 26.05, nixpkgs unstable, ubuntu jammy

πŸ’– LILO β€” like, the lilo manual, section 8 (LiLO documentation) πŸ’–

okay bestie, sit down, hydrate, because we're about to install a boot loader together and it's gonna be iconic. πŸŽ€


✨ NAME ✨

lilo β€” install boot loader of LiLO


🌸 SYNOPSIS 🌸

Main function:

 lilo

Auxiliary uses:

 lilo -A        # activate/show active partition
 lilo -E        # edit header or update a bitmap file
 lilo -I        # inquire path name of current kernel
 lilo -M        # write a Master Boot Loader on a device
 lilo -q        # query map and show its content
 lilo -R        # set default command line for next reboot
 lilo -T        # tell more about specified topic
 lilo {-u|-U}   # uninstall LiLO boot loader

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, lilo installs a boot loader that gets activated the next time you boot your system. Periodt. πŸ’…

The default configuration file is /etc/lilo.conf (go read lilo.conf(5) for the tea β˜•) and it holds most of the options. But β€” and this is the fun part β€” lots of them, including the ones that straight-up override the config file, can be passed right on the command line. Main character energy, honestly.


πŸ‘‘ OPTIONS πŸ‘‘

okay here come the flags, buckle up buttercup 🌈

  • -A master-device [N] β€” used with a single argument, it asks about the active partition on the device you gave as master-device; like, e.g. /dev/sda. With N==0: deactivate all partitions on the device. With N in the range [1..n]: activate the partition you named and deactivate all the others. Normally only primary partitions [1..4] are allowed to be activated, but if the 'Extended Master Boot Loader' is present on the Master Boot Record (MBR) of the device (see the -M option), then any partition can be made active. Whether the actual OS inside that partition will boot from a logical partition depends entirely on the characteristics of the OS β€” no promises, bestie. LILO boot records for Linux may be booted from a logical partition though. πŸ’œ
  • -b bootdev β€” sets the boot device where the boot loader gets installed. For example -b /dev/sda sets the Master Boot Record (MBR) on the first disk as the boot device. And -b /dev/sdb5 sets the first logical partition on the second disk as the boot device. 🫢
  • -B bitmap-file β€” defines a bitmap file for the boot-time graphics screen. Preferably one that's already been pre-processed with the -E option, because why do extra work.
  • -c β€” enables map compaction. This merges read requests from adjacent sectors, and it speeds up booting, especially from floppy. ✨
  • -C config-file β€” sets another pathname and filename for the configuration file. The default configuration file is /etc/lilo.conf.
  • -d delay-time β€” sets the delay time in tenths of a second ('20' = 2 sec) before it automatically boots the first image. This gives you time to interrupt the automatic boot process with: Shift, Alt, Ctrl, ScrollLock, or CapsLock. If you interrupt it, the boot: prompt shows up. πŸŽ€
careful babe: this switch gets overridden by the appearance of prompt in the configuration file!
  • -D label β€” use the kernel with the given label as the default kernel to boot, instead of the first one in the list of the configuration file.
  • -E filename.xxx β€” okay so if the extension .xxx is .bmp, then it takes the file to be a bitmap graphic file for use in the bitmap= configuration file directive. It enters an interactive editor to create or update the color/placement information in the LILO header of this bitmap file. (see bmp-colors, bmp-table, and bmp-timer on the manual page for lilo.conf(5).)

If .xxx is .dat then it takes this file to be a configuration file to set bitmap graphic parameters, which get transferred into the LILO header in the bitmap file of the same name.

And listen β€” when a .bmp file gets modified using a graphics editor (e.g. GIMP), the LILO header will be lost. 😭 It can be restored using the dat file, which is used as a text-based backup for the LILO header information. Iconic little safety net.

  • -f disk-tab β€” set another disk geometry parameter file. The default is /etc/disktab.
  • -F β€” override boot sector check for filesystems (e.g., swap, ext4, xfs ...) which might be destroyed by the installation of the LILO boot sector on the first sector of the partition if these filesystems use the first sector as a superblock. 😬

Compare with -P ignore, which bypasses certain partition table checks.

  • -g β€” generate 'cylinder/head/sector' (CHS geometric) disk addresses. Limited to cylinders up to 1023. Forces compatibility with very old versions of LILO (obsolete switch β€” we're talking vintage, bestie). πŸ•°οΈ
  • -H β€” override fatal halt if a RAID array does not have all disks active.
  • -I label [D|a|i|k|r|R] β€” label is taken to be the name of an image specified in the configuration file. This command prints the path name of the corresponding kernel file, keytable file, initial ramdisk file, root specification, or append= string ("i", "k", "r", "R", or "a" option). The "D" option ignores the label parameter and prints the default image= label, or the first image= label is selected if no default image is set. 🧚
  • -l β€” generate 24-bit linear sector addresses instead of cylinder/head/sector addresses.
  • -L β€” generate 32-bit Logical Block Addresses (LBA) instead of cylinder/head/sector (CHS) addresses, allowing access to all partitions on disks with more than 1024 cylinders. (This is the default geometry, so slay, you probably already have it.)
  • -m map-file β€” use another map file instead of the default file /boot/map.
  • -M master-device {mbr|ext} β€” install a Master Boot Record on the device specified as master-device, selecting the Standard or Extended Master Boot Loader per option. The primary partition table on master-device is undisturbed. 🫢 If no valid Volume-ID (serial number) is present, then it generates one and writes it to the MBR. If mbr is set, the Standard Master Boot Loader will search partitions 1-4 for an active flag, and boot the flagged partition. Only one active flag is allowed. If ext is set, the search for an active partition will include logical partitions as well. The presence of the Extended Master Boot Loader on the Master Boot Record (MBR = sector 0) of a disk affects the operation of the -A option.
  • -p β€” require interactive entry of all passwords set as "" in the configuration file.
  • -P {fix|ignore|<global-option>} β€” fix or ignore 'corrupt' partition tables, e.g. partition tables with linear and cylinder/head/sector addresses that do not correspond.
⚠️ bestie, listen to me: always try ignore first, because fix will re-write the partition table, possibly destroying all partitions on the disk. That's not a drill. πŸ’€

ignore is also used to bypass the partition table check for partition types within the partition table which might not allow the installation of a LILO boot sector. Compare with the -F flag, which overrides the check of the actual boot sector.

<global-option> allows the passing of any global option which may appear in the global section (top) of the configuration file (/etc/lilo.conf). For instance -P nowarn will pass the nowarn option, just as though nowarn appeared in the configuration file (same as the -w switch). Similarly -P timeout=50 will add or override the timeout= line in the configuration file. Note that the general -P switch actually duplicates a number of command line option switches. However, it is not strictly the same as some switches which cause an override of other options; e.g. -g (-P geometric), -L (-P lba32).

  • -q β€” list the currently mapped files. lilo maintains a file, by default /boot/map, containing each name and location of the kernel(s) to boot. This option will list the names therein. Use with -v for more detailed information about the installed boot loader. πŸ”
  • -r root-directory β€” before doing anything else, do a 'chroot' to the indicated directory. The new root directory must contain a /dev directory and may need a /boot directory. It may also need an /etc/lilo.conf file.
  • -R command-line β€” this option sets the default command for the boot loader for the next time it executes. After execution the boot loader will erase this line because it is a once-only command. It is typically used in reboot scripts, just before calling 'shutdown -r'. Used without any arguments, it will cancel a lock-ed or fallback command line.

This Command line starts with image identifier (as shown during map file update), then space, then kernel parameters. The kernel parameters are appended to kernel command line constructed routinely. In either case, it there were parameters or not, such one-time command will be treated by loaders code, as if it is set at 'boot:' prompt. This could lead to 'password:' prompt at boot time. Be warned! Refer to lilo.conf(5) for details. 😳

  • -s save-file β€” when lilo writes a new boot sector, it preserves the former contents of the boot sector in a file, named by default /boot/boot.NNNN, where NNNN is the hexadecimal representation of the major and minor device numbers of the drive/partition.

This option defines the backup save file in one of three ways: a save directory (default is '/boot') using the default filename 'boot.NNNN' in the defined directory; a pathname template to which '.NNNN' is appended (default would be '/boot/boot'); or the full pathname of the file, which must include the correct '.NNNN' suffix. When used with the -u option, the full file pathname must be set. 🌸

  • -S save-file β€” normally lilo will not overwrite an existing boot sector save file. This option says that overwriting is to be forced. As with -s, the setting may be of a save directory, pathname template, or full pathname (which includes the '.NNNN' suffix).
  • -t β€” test only. Do not really write a new boot sector or map file. Use together with -v to find out what lilo is about to do. Rehearsal vibes. 🎭
  • -T option β€” print out system information, some of it extracted from system bios. This is more convenient than booting the LILO diagnostic floppy on problem systems. option may be any one of the following:
 help          print a list of available diagnostics
 ChRul         list the partition types subject to
                 Change-Rules
 EBDA          list Extended BIOS Data Area information
 geom=<drive>  list drive geometry for bios drive;
                 e.g. geom=0x80
 geom          list drive geometry for all drives
 table=<drive> list the primary partition table;
                 e.g. table=/dev/sda
 video         list graphic modes available to boot
                 loader
  • -u [device-name] β€” uninstall lilo by copying the saved boot sector back. The -s and -C switches may be used with this option. The device-name is optional. A time-stamp is checked. ⏰
  • -U [device-name] β€” the same as -u, but do not check the time-stamp.
  • -v [number] β€” okay so this is the "tell me EVERYTHING" button πŸ’…. Give it one to five -v options and lilo gets more and more chatty. The number itself sets the verbosity level, and its range is 1..5.
  • -V β€” just prints the version number. That's it, that's the whole job ✨.
  • -w[+|-] β€” the warning-volume knob πŸ”‡. Plain -w or -w- suppresses warning messages. But -w+ does the opposite: it overrides nowarn in the configuration file and shows you those warnings anyway. Bestie said "not today, silence" and then changed her mind 🫢.
  • -x option β€” for RAID installations ONLY, bestie, don't be using this on your lil' laptop πŸ’€. The option can be any of these keywords: none, auto, mbr, mbr-only, or a comma separated list of additional boot devices (and like, no spaces allowed in that list, fr fr).

RAID installations write the boot record to the RAID partition. Conditional writing of MBRs may occur to aid in making the RAID set bootable in a recovery situation, but all default actions may be overridden. Want the action similar to previous versions? That's the -x mbr-only switch, slay.

  • -X β€” reserved for LILO internal use πŸ™ˆ. May produce different output for different LILO versions. The line beginning CFLAGS= will contain the compiler options used to generate this version of LILO. Iykyk.
  • -z β€” when used with the -M switch, it clears the Volume-ID. Usually you use it in this exact sequence to generate a shiny new Volume-ID ✨:
lilo -z -M /dev/sda
lilo -M /dev/sda
  • -Z option β€” tells the boot installer whether special precautions need to be taken because the BIOS fails to pass the correct device code in DL (-Z0). Or it may specify that the BIOS always gets DL right (-Z1). This corresponds to, and overrides, the configuration file option bios-passes-dl=. Periodt.

πŸŽ€ CONFIG OPTIONS πŸŽ€

So like, all those command line options from up there? They correspond to the key words in the config file, and here's the matching so you never get them mixed up πŸ’–. The above command line options correspond to the key words in the config file indicated below.

  • -b bootdev β†’ boot=bootdev
  • -B file.bmp β†’ bitmap=file.bmp
  • -c β†’ compact
  • -d dsec β†’ delay=dsec
  • -D label β†’ default=label
  • -f file β†’ disktab=file
  • -g β†’ geometric
  • -l β†’ linear
  • -L β†’ lba32
  • -m mapfile β†’ map=mapfile
  • -P fix β†’ fix-table
  • -P ignore β†’ ignore-table
  • -s file β†’ backup=file
  • -S file β†’ force-backup=file
  • -v [N] β†’ verbose=N
  • -w β†’ nowarn
  • -x option β†’ raid-extra-boot=option
  • -Z option β†’ bios-passes-dl=option

🌈 BOOT OPTIONS 🌈

The options described here may be specified at boot time on the command line when a kernel image is booted πŸ‘‘. These options are processed by LILO, and are removed from the command line before it is passed to the kernel, unless otherwise noted.

  • lock β€” locks the command line, as though lock had been defined in /etc/lilo.conf. No take-backs πŸ”’.
  • mem=###[,K,M,G] β€” sets the maximum memory in the system in bytes, kilobytes, megabytes or gigabytes. And heads up: this option is not removed from the command line, it is always passed to the kernel πŸ“¨.
  • nobd β€” suppresses the BIOS data check. This option is reserved for use with non-IBM-compliant BIOS's which hang with the lines:
Loading...............
BIOS data check

rip to those BIOSes, honestly πŸ’€

  • vga=[ASK,EXT,EXTENDED,NORMAL,###,0x###] β€” allows overriding the default video mode upon kernel startup. Vibe check your display mode, bestie πŸ¦‹.

😭 BOOT ERRORS 😭

Okay this part is the dramatic one, so listen up. The boot process takes place in two stages 🧚. The first stage loader is a single sector, and is loaded by the BIOS or by the loader in the MBR. It loads the multi-sector second stage loader, but is very space limited. When the first stage loader gets control, it types the letter L; when it is ready to transfer control to the second stage loader it types the letter I. If any error occurs, like a disk read error, it will put out a hexadecimal error code and then re-try the operation.

All hex error codes are BIOS return values, except for the lilo-generated codes: 40, 99 and 9A. A partial list of error codes follows:

  • 00 β€” no error
  • 01 β€” invalid disk command
  • 02 β€” address mark not found
  • 03 β€” disk write-protected
  • 04 β€” sector not found
  • 06 β€” floppy disk removed
  • 08 β€” DMA overrun
  • 0A β€” bad sector flag
  • 0B β€” bad track flag
  • 20 β€” controller failure
  • 40 β€” seek failure (BIOS)
  • 40 β€” cylinder>1023 (LILO)
  • 99 β€” invalid second stage index sector (LILO)
  • 9A β€” no second stage loader signature (LILO)
  • AA β€” drive not ready
  • FF β€” sense operation failed

Error code 40 is generated by the BIOS, or by LILO during the conversion of a linear (24-bit) disk address to a geometric (C:H:S) address. On older systems which do not support lba32 (32-bit) addressing, this error may also be generated. Errors 99 and 9A usually mean the map file (-m or map=) is not readable, likely because LILO was not re-run after some system change, or there is a geometry mismatch between what LILO used (lilo -v3 to display) and what is actually being used by the BIOS (one of the lilo diagnostic disks, available in the source distribution, may be needed to diagnose this problem). not the geometry mismatch arc 😭

When the second stage loader has received control from the first stage, it prints the letter L, and when it has initialized itself, including verifying the "Descriptor Table" β€” the list of kernels/others to boot β€” it will print the letter O, to form the full word "LILO", in uppercase πŸ”₯. Iconic, honestly. Main character energy from a bootloader.

All second stage loader error messages are English text and try to pinpoint, more or less successfully, the point of failure πŸ™ˆ.


πŸ’€ BUGS πŸ’€

Configuration file options backup and force-backup should specify a backup directory or backup file pathname template on all RAID installations. Use of an explicit filename may not allow multiple backup files to be created correctly. It is best to use the default mechanism, as it works correctly in all cases.

bestie please just use the default, it's the only one that always works, no cap 🫢

Copyright (C) 1992-1998 Werner Almesberger
Copyright (C) 1999-2007 John Coffman
Copyright (C) 2009-2014 Joachim Wiedorn

Redistribution and use in source and binary forms, with or without modification, are permitted under the terms of the BSD license found in the COPYING file. Slay, legally speaking ✨.


🌸 AUTHOR 🌸

lilo was written by:

Werner Almesberger (version 0 to 21),
John Coffman (version 21.2 to 22.8),
Joachim Wiedorn (since version 23.0).

This manual page was written by Werner Almesberger and Joachim Wiedorn <joodevel at joonet.de>.


πŸ¦‹ SEE ALSO πŸ¦‹

lilo.conf(5), liloconfig(8), lilo-uuid-diskid(8), mkrescue(8), fdisk(8), mkinitrd(8)


and that's a wrap on the LILO(8) page, bestie πŸ’– This lil' masterpiece is from version 24.2, dated 2015-11-22 β€” vintage, lowkey iconic, and still ate. Go forth and boot responsibly πŸ‘‘βœ¨πŸŽ€

πŸ“¦ where this page comes from