Partition Entries
The GPT uses simple and straightforward entries to describe partitions. The first 16 bytes designate the partition type GUID. For example, the GUID for an EFI System partition is {C12A7328-F81F-11D2-BA4B-00A0C93EC93B}. The second 16 bytes contain a GUID unique to the partition. Starting and ending 64-bit LBAs are also recorded here, and space is allocated for partition names and attributes. As is the nature and purpose of GUIDs, no central registry is needed to ensure the uniqueness of the GUID partition type designators.
Offset | Length | Contents |
---|---|---|
0 | 16 bytes | Partition type GUID |
16 | 16 bytes | Unique partition GUID |
32 | 8 bytes | First LBA (little endian) |
40 | 8 bytes | Last LBA (inclusive, usually odd) |
48 | 8 bytes | Attribute flags (e.g. bit 60 denotes read-only) |
56 | 72 bytes | Partition name (36 UTF-16LE code units) |
128 | Total |
The location of the partition entries array on disk is defined in the GPT header (but it starts at LBA 2 in many cases).
The GPT header contains a field that specifies the size of a partition table entry. The minimum required is 128 bytes, but implementations must allow for other values (see this warning).
Also, the sector size must not be assumed to be hard-wired to 512 bytes per sector in calculations (see Advanced Format), that is, there can be more than four partition entries in a single sector, and (with possible future much larger partition table entries) it is possible to have a sector hold only a fraction of a partition entry. Except for the first two sectors (LBA 0 and LBA 1), the GPT specification just describes the size and organization of a data structure, not in how many sectors it is stored on disk.
Microsoft further subdivides the attribute flags according to this TechNet article: the lower 4 bytes representing partition independent attributes, and the upper 4 bytes are partition type dependent. Microsoft uses the following bits in general:
Bit | Content |
---|---|
0 | System partition (disk partitioning utilities must preserve the partition as is) |
2 | Legacy BIOS bootable (equivalent to active flag (typically bit 7 set) at offset +0h in partition entries of the MBR partition table) |
60 | Read-only |
62 | Hidden |
63 | Do not automount (i.e., do not assign drive letter) |
Read more about this topic: GUID Partition Table