-->
Previous Table of Contents Next


Boot Images

LILO can boot a kernel image from several locations, such as a regular file on the root file system or any other mounted file system, from a block device such as a floppy disk, or from the boot sector of another partition or disk. The type of boot is dictated by entries in a configuration file.

Boot image configuration files can have several variables defined, all of which have been mentioned previously. Valid configuration file variables are alias, label, optional, password, ramdisk, read-only, read-write, restricted, root, and vga.

To boot a kernel image from a file, all that is necessary in the configuration file is the name of the image. For example, the following line boots the image called linux_main:


image=/linux_main

To boot an image from another device, the sectors that must be read on that device have to be specified. There are several methods of providing the sector information. The starting sector must be provided, but you can then either specify a number of sectors to be read (start+length) or the end sector number (start-finish). If only one number is provided (the start sector), only that sector is read.

For example, the contents of this configuration file boot the kernel from the floppy disk, starting at sector 1 and reading the next 512 sectors:


image=/dev/fd0

     range=1+512

More than one configuration can be specified for an image because LILO stores values in an image descriptor file and not in the image itself. For example, a configuration file can contain the following entries:


image=/linux_main

     label=linux-hda1

     root=/dev/hda1

image=/linux_main

     label=linux-hda3

     root=/dev/hda3

image=/linux_main

     label=linux-flop

     root=/dev/fd0

This code has three configurations for the same Linux kernel (linux_main) but has different root devices with three different alternate names. The boot devices for the image are /dev/hda1, /dev/hda3, and /dev/fd0, respectively. Whitespace in the configuration file is ignored, so the indentations are for ease of reading only.

Disk Parameter Table

LILO is usually able to obtain information about the hard disks and floppy disks on the system by reading the kernel. On some systems, though, this isn’t possible (this is especially the case with some SCSI adapters and adapters that do not behave as IDE or SCSI “normal” devices). When LILO can’t obtain the disk parameter information, it generates an error message about “bad geometry.”

The disk parameters can be physically read by LILO from the file /etc/lilo/disktab. When the disktab file exists, it takes precedence over any autodetected values. The disktab file contains the device number (hexadecimal), its BIOS code, and the disk geometry. A sample disktab file could have the following entries:


# /etc/lilo/disktab - LILO disk paramter table

#

# Dev. num  BIOS code Secs/track  Heads/cyl Cyls  Part. Offset

#

   0x800       0x80      32          64      1714      0

   0x801       0x80      32          64      1714    1001

This shows a SCSI disk with two partitions. The first partition /dev/sda1 has a device number 800, and the second partition /dev/sda2 has the device number 801. Both partitions have the BIOS code 80. Both the device number and BIOS code have to be given in hex format, hence the leading “0x.” The disk has 32 sectors per track, 64 heads per cylinder, and 1,714 cylinders. Because both partitions are on the same disk, these parameters will be the same.

The partition offset is an optional field. The first partition starts at offset 0, and the second at offset 1001 (the number of sectors from the start of the disk). The partition offsets need only be explicitly given when the kernel cannot obtain that information. Most hard disks (including removable and optical disks) don’t need the partition offsets, but CD-ROMs sometimes do.


Tip:  
When filling in the /etc/lilo/disktab file, you don’t have to have the details exactly right. Most systems remap the drive parameters to 32 sectors per track and 64 heads, whether those numbers are correct or not. (This is a BIOS action.) The number of cylinders must be at least equal to or higher than the number of actual cylinders to avoid truncation of the disk space that the operating system recognizes.

Some BIOS versions do not allow disks exceeding certain values. This is usually a problem with IDE and SCSI controller cards that are designed for DOS systems with relatively small (<1 GB) disk drives and earlier BIOS versions. Device drivers allow some high-capacity drives to be used, although some systems will have a problem accessing files beyond the 1 GB limit.


Previous Table of Contents Next