Prerequisites
What you should know before reading:
The partition table is located on the very first block of the disk drive. The drive (using an IDE drive in this example) is found at /dev/hda. hda is the whole disk. If yours is a 4GB disk, then you will have 4GB worth of disk blocks accessable from /dev/hda. That very first block is special. It is called the Master Boot Record. It contains a program (no larger than 446 bytes!) that determines how your system will boot. The last 64 bytes of this block hold the partition table. Each entry (16 bytes) yields about 8 pieces of information. That's all it takes to describe a partition. Obviously there is a limit of four partitions using this scheme.
The information tells where each partition starts and ends. It is the responsibility of the program that sets these (fdisk, in at least two of the operating systems), to make sure they don't overlap. Once they are in place, the disk driver pays close attention to these limits and does not go beyond them. Thus, each partition can remain independent of the others.
The usual need to go beyond the original design has given rise to the extended partition. In this, one of the partitions is designated as extended. It is still assigned to a particular section of the drive, but now its contents can be further carved up--another partition table is set up to describe these logical partitions.
The partitions in the original scheme are called primary. They will be numbered as hda1, hda2, hda3, and hda4. If one of them is used for an extended partition, then it's not available as primary. Because there can only be one extended partition, it is customary to use hda4 for it. The logical partitions are numbered starting with hda5. The program disk druid is known for its habit of setting up hda1 and then jumping directly to hda5 and higher for the rest. If you run fdisk or disk druid you can use the display function to examine the structure of your disk partitions. Also, the structure is shown when Linux starts up. Look in dmesg (or watch the bootup) for a message like this:
Partition check:
hda: hda1 hda2 < hda5 hda6 >
/dev/hda is used only for accessing the MBR and managing partition information.
/dev/hda1 and up can be used for an operating system, an additional drive,
Linux swap, etc.
LILO can be used to start any of the operatings systems located in
a legitimate place. "Legitimate" is a concept determined by each
particular operating system. To wit, MS-DOS
won't start from an extended partition, but
Linux will.
mount can mount the file oriented partitions as /, as /home,
as /mnt/dos, etc.
Some partitions aren't file systems, such as the swap partition.
Each partition has a boot block as its first block, as mentioned before. Do not confuse these with the MBR. The MBR is the first block of /dev/hda. The boot blocks are the first block of /dev/hda1, /dev/hda2, and so on. This distinction is important when considering how to configure LILO.
There is much more to be said but it is getting away from lilo and is a subject probably just as large. If there is enough interest I will create some pages for that.
For now, I will say only the following in regard to lilo:
If you mistakenly trash the MBR, or the boot sectors of various partitions, you can recover them provided you understand what's going on and have made the proper boot diskettes!
The lilo.conf line boot=/dev/xxx is what determines where LILO gets written to.