-->
Previous Table of Contents Next


LILO Makefile

The LILO Makefile supplied with the LILO installation files is valid for most installations, although you should carefully check all the entries. LILO uses either Makefile or another file called /etc/lilo/config.defines. If the config.defines file exists, Makefile is ignored. For most purposes, editing the Makefile is sufficient, although if you plan to use LILO a lot, the config.defines file is a better alternative because it isn’t overwritten with new versions of LILO.

There are a number of parameters that should be checked in the Makefile before you go on. Table 4.1 summarizes these parameters and explains what they do.

Table 4.1.LILO Makefile parameters.

Parameter Meaning

IGNORECASE Makes image names not case sensitive. Active by default.
NO1STDIAG Does not generate diagnostic messages when read errors are encountered in the boot loader. Disabled by default.
NOINSTDEF If the install option is omitted from the command line, don’t install a new boot sector. Instead, modify the old one. Disabled by default.
ONE_SHOT Disables the command line timeout if any key is pressed. Disabled by default.
READONLY Prevents overwriting of the default command line sector of the map file. Disabled by default.

Updating LILO

If you want to update an existing version of LILO with a newer one, the process is the same as a first-time installation except that existing configuration files are renamed to .old automatically. For example, chain.b is renamed to chain.old. If the new version of LILO behaves properly, the .old files can be deleted.

Whenever you update the version of LILO, you must update the boot sector to add the new locations and map file format. To update the boot sector, simply run LILO.

Linux and Hard Disk Layouts

To understand how LILO works, it is necessary to understand how a hard disk is laid out. You probably already know that a hard disk is essentially a set of concentric tracks, radiating out from the center of the disk platter. Each track is divided into a number of sectors.

Hard disks are identified by the number of platters (or, more accurately, the number of heads: The number of platters can be greater than the number of heads because one or more surfaces—typically the top and bottom—might not be used for data storage), the number of tracks per inch of disk platter (measured radially), and the number of sectors per track. The capacity of each sector leads to the total capacity of the disk by multiplying the number of sectors per track, the number of tracks, and the number of platters with heads.

Linux is usually integrally tied with DOS, so it is useful to look at the way DOS uses a hard disk. A single-purpose (single DOS operating system, for example) hard disk (and most floppy disks) have a boot sector followed by a data area that includes an administrative block.

The boot sector is the first sector on the hard disk and is read when the system starts to load the operating system. The boot sector essentially contains a bootstrap to direct the machine to the startup routines.

The administrative block is usually part of the data area, although it is commonly not accessible directly by users. The administrative area contains the administrative tables that show file locations in terms of head/track/sector. DOS uses the File Allocation Table (FAT), while UNIX and Linux use the superblock or i-node tables. The administrative table is not usually read until the boot process has been started.

The data area is used to store files (including the operating system startup code). Each file on the hard disk will have an entry in the administrative block that indicates the filename and physical location on the hard disk. Other information is usually also stored in the administrative block (such as owner, permissions, date and time, and so on, depending on the operating system).

When there is lots of space on a hard disk, you will probably want to install more than one partition (probably supporting more than one operating system, such as providing both DOS and Linux on the same disk). You can create up to four “primary” partitions on a DOS disk.


Warning:  
Some operating systems allow more than four partitions, but if you are going to use DOS on the same hard disk, don’t create more than four primary partitions. Extended partitions can be used to provide more than four logical disk drives. An extended partition is a primary partition that is further subdivided.

A partition table is written to the first sector (boot sector) of each hard disk (not each platter) that contains the details of the partition table. This sector is sometimes called the Master Boot Record or MBR. The only difference between a Master Boot Record and a boot sector is that the MBR contains partition information. Hard drives have boot sectors usually called MBRs whereas floppies have boot sectors with no MBR, although the two terms are used interchangeably. A partition table is written to the start of each extended partition, when they exist on a hard disk. Linux boot sectors are created by a program called the map installer.

When several partitions are used on a hard disk, they are referred to by Linux as /dev/hda1, /dev/hda2, and so on. Extended partitions would be numbered /dev/hda5, /dev/hda6, and so on (because only four primary partitions are allowed). The entire hard disk is called /dev/hda. A second hard disk would be /dev/hdb (with partitions /dev/hdb1, /dev/hdb2, and so on). Other letters in the disk names may be used, depending on the type of hard disk and its adapter. For example, a SCSI hard disk may be called /dev/sda1 instead of /dev/had (used for IDE and EIDE drives).


Previous Table of Contents Next