-->
Previous | Table of Contents | Next |
by Kamran Husain
LILO (which means LInux LOader) is the boot loader used by Linux to load the operating system kernel. LILO is versatile: It can boot Linux kernels from any type of file system, including floppy disk as well as from other operating systems.
This chapter looks at LILO, the way hard disks are laid out with Linux, the boot process, and the most common boot processes and the interactions of LILO with each. This should help you install and use LILO efficiently and effectively.
There are several versions of LILO available. Most current versions support one of two different directory structures. The more traditional (and older) structure resides in the /etc/lilo directory. The newer structure has files scattered in several directories including /etc, /sbin, and /boot. Because the older /etc/lilo structure is the most common, it is used for examples in this chapter. If you are using the new structure (check for the existence of /etc/lilo), substitute the new pathnames as necessary.
Most systems have LILO already installed and configured. If your system already has LILO installed, you can skip this section unless you want to update your version.
A quick installation procedure is available with most versions of Linux to install a minimum set of files required for LILO. This is described in the file QuickInst.old or QuickInst.new, in some versions of Linux (but not all). The QuickInst routines can be used only for a first-time LILO installation or to replace an existing LILO set. They should not be used for updates as any existing configuration information is overwritten.
Note:
Before LILO can be compiled for use, the kernel has to be configured by executing makeconfig. All kernel header files must be in the directory /usr/include/linux for LILO to compile properly. The LILO installation and compilation process should be run from a Bourne shell (or complete compatible). Problems have been reported with versions of the Korn shell when LILO is compiled, so use /bin/sh or /bin/bash.
A full installation of LILO requires that all the files in the LILO distribution archive (usually called lilo.xxx.tar.gz where xxx is the version number) are extracted into a directory other than /etc/lilo. (This is because the installation will fail if the final destination is the same as the source directory.) After the distribution files are located in a temporary directory, follow these steps:
make -f Makefile.old make -f Makefile.new
make -f Makefile.old install make -f Makefile.new install
If the files do not exist or errors are generated in the process, restart the installation. You should check the Makefile for accurate information. After LILO has been installed properly, you can use it to install a boot process.
Some systems may have difficulty with hard disks that do not allow the disk parameters (heads, sectors per track, and cylinders) to be read. If error messages about bad geometry are generated or the LILO installation fails with disk errors, the disk parameters are a likely source of trouble. This is especially true with SCSI disks and hard disks with a capacity of 1GB or more.
In this case, the disk parameters must be manually entered into the file disktab. This is discussed in more detail in the section Disk Parameter Table later in this chapter. Edit the disktab file as explained to include the disk parameters, then follow these steps to test the new LILO configuration by copying it to a floppy disk and booting from it:
echo image=kernel_name | ./lilo -C - -b /dev/fd0 -v -v -v
If the configuration is correct, LILO reads the floppy for the boot loader, then loads the kernel from the hard disk. If everything boots properly and you can move around the file system, the disk parameters are correct. If you cant access the hard disk file system, the parameters are incorrect and should be re-entered.
Previous | Table of Contents | Next |