β

GUID Partition Table

Diagram illustrating the layout of the GPT scheme. In this example, each logical block is 512 bytes in size, and each partition entry is 128 bytes, and the corresponding partition entries are assumed to be located in LBA 2-33. LBA addresses that are negative indicate position from the end of the volume, with −1 as the last addressable block.

Contents

The widespread MBR partitioning scheme, dating from the early 1980s, imposed limitations that affect the use of modern hardware. One of the main limitations is the usage of 32 bits for storing block addresses and quantity information. For hard disks with 512-byte sectors, the MBR partition table entries allow up to a maximum of 2 TiB (232 × 512 bytes).[1]

Intel therefore developed a new partition table format in the late 1990s as part of what eventually became UEFI. As of 2010[update], GPT forms a subset of the UEFI specification.[2] GPT allocates 64 bits for logical block addresses, therefore allowing a maximum disk size of 264 sectors. For disks with 512-byte sectors, maximum size is 9.4 ZB (9.4 × 1021 bytes) or 8 ZiB (9,444,732,965,739,290,427,392 bytes, coming from 18,446,744,073,709,551,616 (264) sectors × 512 (29) bytes per sector).[1][3]

Like modern MBRs, GPTs use logical block addressing (LBA) in place of the historical cylinder-head-sector (CHS) addressing. The protective MBR is contained in LBA 0, the GPT header is in LBA 1, and the GPT header has a pointer to the partition table, or Partition Entry Array, typically LBA 2. The UEFI specification stipulates that a minimum of 16,384 bytes, regardless of sector size, be allocated for the Partition Entry Array.[4] On a disk having 512-byte sectors, a partition entry array size of 16,384 bytes and the minimum size of 128 bytes for each partition entry, LBA 34 is the first usable sector on the disk.

Hard-disk manufacturers are transitioning to 4,096-byte sectors. The first such drives continued to present 512-byte physical sectors to the OS, so degraded performance could result when the drive's physical 4-KB sector boundaries did not coincide with the 4 KB logical blocks, clusters and virtual memory pages common in many operating systems and file systems. This was a particular problem on writes, when the drive is forced to perform two read-modify-write operations to satisfy a single misaligned 4 KB write operation.[5]

For backward compatibility with most legacy operating systems such as DOS, OS/2, and versions of Windows before Vista, MBR partitions must always start on track boundaries according to the traditional CHS addressing scheme and end on a cylinder boundary. This is also true of partitions with emulated CHS geometries (as reflected by the BIOS and the CHS sectors entries in the MBR partition table) or partitions accessed only via LBA. Extended partitions must start on cylinder boundaries as well. This typically causes the first primary partition to start at LBA 63 on disks accessed via LBA, leaving a gap of 62 sectors with MBR-based disks, sometimes called "MBR gap", "boot track", or "embedding area". That otherwise unused disk space is commonly used by bootloaders such as GRUB for storing their second stages.[6]

For limited backward compatibility, the space of the legacy MBR is still reserved in the GPT specification, but it is now used in a way that prevents MBR-based disk utilities from misrecognizing and possibly overwriting GPT disks. This is referred to as a protective MBR.[3]

A single partition type of EEh, encompassing the entire GPT drive (where "entire" actually means as much of the drive as can be represented in an MBR), is indicated and identifies it as GPT. Operating systems and tools which cannot read GPT disks will generally recognize the disk as containing one partition of unknown type and no empty space, and will typically refuse to modify the disk unless the user explicitly requests and confirms the deletion of this partition. This minimizes accidental erasures.[3] Furthermore, GPT-aware OSes may check the protective MBR and if the enclosed partition type is not of type EEh or if there are multiple partitions defined on the target device, the OS may refuse to manipulate the partition table.[7]

While the MBR and protective MBR layouts were defined around 512 bytes per sector, the actual sector size can be larger on various media such as MO disks or hard disks with Advanced Format.[citation needed]

If the actual size of the disk exceeds the maximum partition size representable using the legacy 32-bit LBA entries in the MBR partition table, the recorded size of this partition is clipped at the maximum, thereby ignoring the rest of disk. This amounts to a maximum reported size of 2 TiB, assuming a disk with 512 bytes per sector (see 512e). It would result in 16 TiB with 4 KiB sectors (4Kn), but since many older operating systems and tools are hard wired for a sector size of 512 bytes or are limited to 32-bit calculations, exceeding the 2 TiB limit could cause compatibility problems.[3]

In operating systems that support GPT-based boot through BIOS services rather than EFI, the first sector is also still used to store the first stage of the bootloader code, but modified to recognize GPT partitions. The bootloader in the MBR must not assume a sector size of 512 bytes.[3]

After the header, the Partition Entry Array describes partitions, using a minimum size of 128 bytes for each entry block.[8] The starting location of the array on disk, and the size of each entry, are given in the GPT header. The first 16 bytes of each entry designate the partition type's globally unique identifier (GUID). For example, the GUID for an EFI system partition is C12A7328-F81F-11D2-BA4B-00A0C93EC93B. The second 16 bytes are a GUID unique to the partition. Then follow the starting and ending 64 bit LBAs, partition attributes, and the 36 character (max.) Unicode partition name. As is the nature and purpose of GUIDs, no central registry is needed to ensure the uniqueness of the GUID partition type designators.[citation needed]

The 64-bit partition table attributes are shared between 48-bit common attributes for all partition types, and 16-bit type-specific attributes:

Partition attributes

Bit

Content

0

Platform required (required by the computer to function properly, OEM partition for example, disk partitioning utilities must preserve the partition as is)

1

EFI firmware should ignore the content of the partition and not try to read from it

^In a multi-disk setup, non-UEFI bootloader (boot drive) requires MBR-based partitioning, while a system drive can use GUID partitioning.

^The GUIDs in this table are written assuming a little-endianbyte order. For example, the GUID for an EFI System partition is written as C12A7328-F81F-11D2-BA4B-00A0C93EC93B here, which corresponds to the 16 byte sequence 28h 73h 2Ah C1h 1Fh F8h D2h 11h BAh 4Bh 00h A0h C9h 3Eh C9h 3Bh – only the first three blocks are byte-swapped.

^The formation of this GUID does not follow the GUID definition; it is formed by using the ASCII codes for the string "Hah!IdontNeedEFI". Such formation of "GUID" value breaks down the guaranteed uniqueness of GUID.

^ abSome computer manufacturers have their own GUIDs for partitions that are analogous to the EFI System Partition, but that hold boot loaders to launch manufacturer-specific recovery tools.[26]

^ abPreviously, Linux used the same GUID for the data partitions as Windows (Basic data partition: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7). Linux never had a separate unique partition type GUID defined for its data partitions. This created problems when dual-booting Linux and Windows in UEFI-GPT setup. The new GUID (Linux filesystem data: 0FC63DAF-8483-4772-8E79-3D69D8477DE4) was defined jointly by GPT fdisk and GNU Parted developers.[27] It is identified as type code 0x8300 in GPT fdisk. (See definitions in gdisk's parttypes.cc)

^ abThe GUID for /usr on Solaris is used as a generic GUID for ZFS by macOS.

^ abNetBSD and MidnightBSD had used the FreeBSD GUIDs before their unique GUIDs were created.

^The Ceph filesystem uses GUIDs to mark the state of preparation a disk is in.[37]

^Nikkel, Bruce J. (September 2009). "Forensic analysis of GPT disks and GUID partition tables". Digital Investigation. 6 (1-2): 39–47. doi:10.1016/j.diin.2009.07.001. The current popular BIOS and MBR partitioning scheme was originally developed in the early 1980s for the IBM Personal Computer using IBM PC-DOS or MS-DOS. The Basic Input/Output System (BIOS) provides an interface to the hardware and initiates the boot process (IBM, 1983). The MBR, located in sector zero, contains the initial boot code and a four entry partition table (Microsoft, 1983). Intended to solve booting and partitioning limitations with newer hardware, a replacement for both the BIOS and the MBR partition table was developed by Intel in the late 1990s (Intel, 2000). This is now called the Unified EFI (UEFI, 2008 UEFI Forum. Unified extensible firmware interface specification version 2.2 2008.UEFI, 2008) specification, and managed by the UEFI Forum (UEFI, 2009). A subset of this specification includes GPT, intended to replace the DOS/MBR partition tables.

^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 "Mac Developer Library". Developer.Apple.com. Apple. Retrieved 2014-07-13.

Microsoft Technet: How Basic Disks and Volumes Work A bit MS-specific but good figures relate GPT to older MBR format and protective-MBR, shows layouts of complete disks, and how to interpret partition-table hexdumps.