GUID Partition Table - Partition Table Header (LBA 1)

Partition Table Header (LBA 1)

The partition table header defines the usable blocks on the disk. It also defines the number and size of the partition entries that make up the partition table. On 64-bit Windows Server 2003 machines, 128 partitions can be created. There are 128 partition entries reserved, each 128 bytes long. (The EFI specification requires that a minimum of 16,384 bytes be reserved for the partition table, so if the minimum of 128 bytes is used for the partition table entry, this gives space for 128 partition entries.)

The header contains the disk GUID (Globally Unique Identifier). It records its own size and location (always LBA 1) and the size and location of the secondary GPT header and table (always the last sectors on the disk). Importantly, it also contains a CRC32 checksum for itself and for the partition table, which may be verified by the firmware, bootloader and/or operating system on boot. Because of this, hex editors should not be used to modify the contents of the GPT. Such modification would render the checksum invalid. In this case, the primary GPT may be overwritten with the secondary one by disk recovery software. If both GPTs contain invalid checksums, the disk would be unusable.

GPT header format
Offset Length Contents
+0 8 bytes Signature ("EFI PART", 45h 46h 49h 20h 50h 41h 52h 54h)
+8 4 bytes Revision (for GPT version 1.0 (through at least UEFI version 2.3.1), the value is 00h 00h 01h 00h)
+12 4 bytes Header size in little endian (in bytes, usually 5Ch 00h 00h 00h meaning 92 bytes)
+16 4 bytes CRC32 of header (offset +0 up to header size), with this field zeroed during calculation
+20 4 bytes Reserved; must be zero
+24 8 bytes Current LBA (location of this header copy)
+32 8 bytes Backup LBA (location of the other header copy)
+40 8 bytes First usable LBA for partitions (primary partition table last LBA + 1)
+48 8 bytes Last usable LBA (secondary partition table first LBA - 1)
+56 16 bytes Disk GUID (also referred as UUID on UNIXes)
+72 8 bytes Starting LBA of array of partition entries (always 2 in primary copy)
+80 4 bytes Number of partition entries in array
+84 4 bytes Size of a single partition entry (usually 128)
+88 4 bytes CRC32 of partition array
+92 * Reserved; must be zeroes for the rest of the block (420 bytes for a sector size of 512 bytes; but can be more with larger sector sizes)
LBA size Total

The values for current and backup LBAs of the primary header should be the second sector of the disk (LBA 1) and the last sector of the disk, respectively. The secondary header at the end of the disk identifies its own table of partition entries, which is located directly before that header.

This table must be referenced relative to LBA 1, that is, it should be accessed through LBA 1 rather than erroneously assuming that it directly follows the 512 bytes of the MBR (stored in LBA 0) and thereby could be assumed to become part of LBA 0 on 4Kn disks. While the described arrangement happens to occur on disks with 512 bytes per sector, there may be "gaps" of unused space between them on disks with larger sector sizes. If multi-sector reads are performed, the actual sector size must be included in the calculation when referencing this table.

Read more about this topic:  GUID Partition Table

Famous quotes containing the word table:

    Remember thee?
    Ay, thou poor ghost, whiles memory holds a seat
    In this distracted globe. Remember thee?
    Yea, from the table of my memory
    I’ll wipe away all trivial fond records,
    All saws of books, all forms, all pressures past
    That youth and observation copied there,
    And thy commandment all alone shall live
    Within the book and volume of my brain,
    William Shakespeare (1564–1616)