Install boot loader of lilo
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
lilo installs a boot loader that will be activated the next time you boot your system. The default configuration file /etc/lilo.conf (see manpage lilo.conf\|(5)) will contain most options, but many, including those which override the configuration file, may be specified on the command line.
Used with a single argument, inquire of active partition on device master-device; e.g. /dev/sda. With N==0: deactivate all partitions on the device. With N in the range [1..n]: activate the specified partition and deactivate all others. Normally, only primary partitions [1..4] may be activated, but if the 'Extended Master Boot Loader' is present on the Master Boot Record (\s-1MBR\s0) of the device (see the -M option), any partition may be made active. Whether the actual \s-1OS\s0 in the partition will boot from a logical partition depends on the characteristics of the \s-1OS\s0. \s-1LILO\s0 boot records for Linux may be booted from a logical partition.
Set the boot device where the boot loader will be installed. For example \*(L"-b /dev/sda\*(R" set the Master Boot Record (\s-1MBR\s0) on the first disk as boot device. \*(L"-b /dev/sdb5\*(R" set the first logical partition on the second disk as boot device.
Define a bitmap file for the boot-time graphics screen, preferably one already pre-processed with the -E option.
Enable map compaction. This will merge read requests from adjacent sectors. Speeds up the booting especially from floppy.
Set another pathname and filename for the configuration file. The default configuration file is /etc/lilo.conf.
Set the delay time in tenths of a second ('20' = 2 sec) before automatically booting the first image. This give you time to interrupt the automatic boot process with: Shift, Alt, Ctrl, ScrollLock, or CapsLock. If interrupted, the boot: prompt will be displayed. This switch will be overridden by the appearance of prompt in the configuration file!
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.
If the extension .xxx is .bmp, then take the file to be a bitmap graphic file for use in the bitmap= configuration file directive. Enter an interactive editor to create or update the color/placement information in the \s-1LILO\s0 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 take this file to be a configuration file to set bitmap graphic parameters, which are transferred into the \s-1LILO\s0 header in the bitmap file of the same name. When a .bmp file is modified using a graphics editor (e.g. \s-1GIMP\s0), the \s-1LILO\s0 header will be lost. It can be restored using the dat file, which is used as a text-based backup for the \s-1LILO\s0 header information.
Set another disk geometry parameter file. The default is /etc/disktab.
Override boot sector check for filesystems (e.g., swap, ext4, xfs ...) which might be destroyed by the installation of the \s-1LILO\s0 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.
Generate 'cylinder/head/sector' (\s-1CHS\s0 geometric) disk addresses. Limited to cylinders up to 1023. Forces compatibility with very old versions of \s-1LILO\s0 (obsolete switch).
Override fatal halt if a \s-1RAID\s0 array does not have all disks active.
label is taken to be the name of an image specified in the configuration file. This command will print the path name of the corresponding kernel file, keytable file, initial ramdisk file, root specification, or \*(L"append=\*(R" string (\*(L"i\*(R", \*(L"k\*(R", \*(L"r\*(R", \*(L"R\*(R", or \*(L"a\*(R" option). The \*(L"D\*(R" option ignores the label parameter and prints the default \*(L"image=\*(R" label, or the first \*(L"image=\*(R" label is selected if no default image is set.
Generate 24-bit linear sector addresses instead of cylinder/head/sector addresses.
Generate 32-bit Logical Block Addresses (\s-1LBA\s0) instead of cylinder/head/sector (\s-1CHS\s0) addresses, allowing access to all partitions on disks with more than 1024 cylinders. (This is the default geometry).
Use another map file instead of the default file /boot/map.
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 generate one and write it to the \s-1MBR\s0. 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 (\s-1MBR\s0 = sector 0) of a disk affects the operation of the -A option.
Require interactive entry of all passwords set as "" in the configuration file.
Fix or ignore 'corrupt' partition tables, e.g. partition tables with linear and cylinder/head/sector addresses that do not correspond. Always try ignore first, as fix will re-write the partition table, possibly destroying all partitions on the disk. 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 \s-1LILO\s0 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).
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.
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.
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.
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 \s-1NNNN\s0 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.
Normally lilo will not overwrite an existing boot sector save file. This options 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).
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.
Print out system information, some of it extracted from system bios. This is more convenient than booting the \s-1LILO\s0 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
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.
The same as '-u', but do not check the time-stamp.
Increase verbosity. Giving one to five -v options will make lilo more verbose. The number (range 1..5) set verbosity level.
Print version number.
Used as -w or -w- to suppress warning messages. Used as '-w+' to override 'nowarn' in the configuration file and show warning messages.
For \s-1RAID\s0 installations only. The option may be any of the keywords: none, auto, mbr, mbr-only, or a comma separated list of additional boot devices (no spaces allowed in the list). \s-1RAID\s0 installations write the boot record to the \s-1RAID\s0 partition. Conditional writing of MBRs may occur to aid in making the \s-1RAID\s0 set bootable in a recovery situation, but all default actions may be overridden. Action similar to previous versions is achieved using the '-x mbr-only' switch.
Reserved for \s-1LILO\s0 internal use. May produce different output for different \s-1LILO\s0 versions. The line beginning \*(L"CFLAGS=\*(R" will contain the compiler options used to generate this version of \s-1LILO\s0.
When used with the '-M' switch, clears the Volume-ID. Usually used in the following sequence to generate a new Volume-ID: lilo -z -M /dev/sda lilo -M /dev/sda
Tells the boot installer whether special precautions need to be taken because the \s-1BIOS\s0 fails to pass the correct device code in \s-1DL\s0 (-Z0). Or may specify that the \s-1BIOS\s0 always gets \s-1DL\s0 right (-Z1). Corresponds to, and overrides, the configuration file option 'bios-passes-dl='.
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
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 \s-1LILO\s0, and are removed from the command line before it is passed to the kernel, unless otherwise noted.
Locks the command line, as though 'lock' had been defined in /etc/lilo.conf.
Set the maximum memory in the system in bytes, kilobytes, megabytes or gigabytes. This option is not removed from the command line, and is always passed to the kernel.
Suppresses the \s-1BIOS\s0 data check. This option is reserved for use with non-IBM-compliant \s-1BIOS\s0's which hang with the lines: Loading............... BIOS data check
Allows overriding the default video mode upon kernel startup.
The boot process takes place in two stages. The first stage loader is a single sector, and is loaded by the \s-1BIOS\s0 or by the loader in the \s-1MBR\s0. 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 \s-1BIOS\s0 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 \s-1BIOS\s0, or by \s-1LILO\s0 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 \s-1LILO\s0 was not re-run after some system change, or there is a geometry mismatch between what \s-1LILO\s0 used (lilo -v3 to display) and what is actually being used by the \s-1BIOS\s0 (one of the lilo diagnostic disks, available in the source distribution, may be needed to diagnose this problem).
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 \*(L"Descriptor Table\*(R" - the list of kernels/others to boot - it will print the letter \*(L"O\*(R", to form the full word \*(L"\s-1LILO\s0\*(R", in uppercase.
All second stage loader error messages are English text and try to pinpoint, more or less successfully, the point of failure.
Configuration file options 'backup' and 'force-backup' should specify a backup directory or backup file pathname template on all \s-1RAID\s0 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.
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 \s-1BSD\s0 license found in the \s-1COPYING\s0 file.
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>.