next up previous contents
Next: Booting basics Up: Introduction Previous: Introduction

Disk organization

When designing a boot concept, it is important to understand some of the subtleties of how PCs typically organize disks. The most simple case are floppy disks. They consist of a boot sector, some administrative data (FAT or super block, etc.) and the data area. Because that administrative data is irrelevant as far as booting is concerned, it is regarded as part of the data area for simplicity.

The entire disk appears as one device (e.g. /dev/fd0) on Linux.

The MS-DOS boot sector has the following structure:

LILO uses a similar boot sector, but it does not contain the disk parameters part. This is no problem for Minix, Ext2 or similar file systems, because they don't look at the boot sector, but putting a LILO boot sector on an MS-DOS file system would make it inaccessible for MS-DOS.

Hard disks are organized in a more complex way than floppy disks. They contain several data areas called partitions. Up to four so-called primary partitions can exist on an MS-DOS hard disk. If more partitions are needed, one primary partition is used as an extended partition that contains several logical partitions.

The first sector of each hard disk contains a partition table, and an extended partition and each logical partition contains a partition table too.

The entire disk can be accessed as /dev/hda, /dev/hdb, /dev/sda, etc. The primary partitions are /dev/hda1 /dev/hda4.

This hard disk has two primary partitions and an extended partition that contains two logical partitions. They are accessed as /dev/hda5

Note that the partition tables of logical partitions are not accessible as the first blocks of some devices, while the main partition table, all boot sectors and the partition tables of extended partitions are.

Partition tables are stored in partition boot sectors. Normally, only the partition boot sector of the entire disk is used as a boot sector. It is also frequently called the master boot record (MBR).

The LILO boot sector is designed to be usable as a partition boot sector. (I.e. there is room for the partition table.) Therefore, the LILO boot sector can be stored at the following locations:

It can't be stored at any of the following locations:

LILO typically doesn't detect attempts to put its boot sector at an invalid location.



next up previous contents
Next: Booting basics Up: Introduction Previous: Introduction



Ross Biro
Sat May 20 13:51:22 PDT 1995