3.4. General PC Formats

Although the PC-style partition tables were introduced by Microsoft(?), their universal adoption in the PC world would make it unfair to put them in the Microsoft section.

3.4.1. PC-style Partition Tables

A PC-style partition table is stored in the very first sector of the disk, dubbed the Master Boot Record (MBR). It shares that sector with first-level boot code. As a result, the table only has four entries. The byte order is little-endian, as dictated by the x86 platform.

The beginning and end of each partition are stored both in three-dimensional coordinates (cylinder-head-sector) and as a logical block number. The actual geometry of the drive (number of cylinders, heads, and sectors) is not stored in the MBR. The three-dimensional format has hit size limits several times now. For some years, hard disks have lied about their geometry and re-mapped it internally, so that the values would fit the fields in the partition table. Today, even that won't do. disktype ignores the geometric fields and uses just the logical sector numbers.

Each partition also carries a one-byte type number. Out of habit they are written in hexadecimal without a special prefix. 83 actually means $83, or 131 in decimal. disktype also displays a name for each partition type, using the same table as Linux fdisk.

For situations where more than four partitions are required, so-called "extended" partitions were created. One partition entry in the MBR is used to point to the extended partition, which contains a linked list of partition map sectors using the same layout as the one in the MBR. Partitions defined inside an extended partition are called "logical" partitions, while the ones defined in the MBR are called "primary". The actual differences are slight and mostly affect booting DOS-based operating systems.

More information on PC-style partition tables can be found at http://www.win.tue.nl/~aeb/partitions/partition_tables.html and http://www.win.tue.nl/~aeb/partitions/partition_types.html.

3.4.2. EFI GPT Partition Table

The Extensible Firmware Interface (EFI) is the designated successor to the PC BIOS firmware. It tries to get rid of as much legacy APIs and structures as possible, including the MBR partition table. The GUID Partition Table (GPT) is stored starting in sector 1 and typically allows for up to 128 partitions. It uses 64-bit LBA addressing, GUIDs to identify partitions and their format, and even allows for a clear-text name. The partition table is protected by a checksum and a backup is stored at the end of the device. Sector 0 is required to contain a MBR partition table with a single "protective" entry that covers the whole disk.

More information on EFI can be found at http://www.uefi.org/ and http://www.intel.com/technology/efi/.