Above, we saw the structure of the MBR (sector 0): boot loader code followed by 4 partition table entries of 16 bytes each, followed by an AA55 signature. Partition table entries of type 5 or F or 85 (hex) have a special significance: they describe extended partitions: blobs of space that are further partitioned into logical partitions. (So, an extended partition is only a box, it cannot be used itself, one uses the logical partitions inside.) Only the location of the first sector of an extended partition is important. This first sector contains a partition table with four entries: one a logical partition, one an extended partition, and two unused. In this way one gets a chain of partition table sectors, scattered over the disk, where the first one describes three primary partitions and the extended partition, and each following partition table sector describes one logical partition and the location of the next partition table sector.
It is important to understand this: When people do something stupid while partitioning a disk, they want to know: Is my data still there? And the answer is usually: Yes. But if logical partitions were created then the partition table sectors describing them are written at the beginning of these logical partitions, and data that was there before is lost.
The program sfdisk will show the full chain. E.g.,
It is possible to construct bad partition tables.
Many kernels get into a loop if some extended partition points back
to itself or to an earlier partition in the chain.
It is possible to have two extended partitions in one of these
partition table sectors so that the partition table chain forks.
(This can happen for example with an fdisk that does not recognize
each of 5, F, 85 as an extended partition, and creates a 5 next to an F.)
No standard fdisk type program can handle such situations, and some
handwork is required to repair them.
The Linux kernel will accept a fork at the outermost level.
That is, you can have two chains of logical partitions.
Sometimes this is useful - for example, one can use type 5 and be
seen by DOS, and the other type 85, invisible for DOS, so that
DOS FDISK will not crash because of logical partitions past cylinder 1024.
Usually one needs
Next Previous Contents