GUID Partition Table

Summary

The GUID Partition Table (GPT) is a standard for the layout of partition tables of a physical computer storage device, such as a hard disk drive or solid-state drive, using universally unique identifiers (UUIDs), which are also known as globally unique identifiers (GUIDs). Forming a part of the Unified Extensible Firmware Interface (UEFI) standard (Unified EFI Forum-proposed replacement for the PC BIOS), it is nevertheless also used for some BIOSs, because of the limitations of master boot record (MBR) partition tables, which use 32 bits for logical block addressing (LBA) of traditional 512-byte disk sectors.

The layout of a disk with the GUID Partition Table. In this example, each logical block is 512 bytes in size and each entry has 128 bytes. The corresponding partition entries are assumed to be located in LBA 2–33. Negative LBA addresses indicate a position from the end of the volume, with −1 being the last addressable block.

All modern personal computer operating systems support GPT. Some, including macOS and Microsoft Windows on the x86 architecture, support booting from GPT partitions only on systems with EFI firmware, but FreeBSD and most Linux distributions can boot from GPT partitions on systems with either the BIOS or the EFI firmware interface.

History edit

The Master Boot Record (MBR) partitioning scheme, widely used since the early 1980s, imposed limitations for use of modern hardware. The available size for block addresses and related information is limited to 32 bits. For hard disks with 512‑byte sectors, the MBR partition table entries allow a maximum size of 2 TiB (2³² × 512‑bytes) or 2.20 TB (2.20 × 10¹² bytes).[1]

In the late 1990s, Intel developed a new partition table format as part of what eventually became the Unified Extensible Firmware Interface (UEFI). The GUID Partition Table is specified in chapter 5 of the UEFI 2.8 specification.[2] GPT uses 64 bits for logical block addresses, allowing a maximum disk size of 264 sectors. For disks with 512‑byte sectors, the maximum size is 8 ZiB (264 × 512‑bytes) or 9.44 ZB (9.44 × 10²¹ bytes).[1] For disks with 4,096‑byte sectors the maximum size is 64 ZiB (264 × 4,096‑bytes) or 75.6 ZB (75.6 × 10²¹ bytes).

In 2010, hard-disk manufacturers introduced drives with 4,096‑byte sectors (Advanced Format).[3] For compatibility with legacy hardware and software, those drives include an emulation technology (512e) that presents 512‑byte sectors to the entity accessing the hard drive, despite their underlying 4,096‑byte physical sectors.[4] Performance could be degraded on write operations, when the drive is forced to perform two read-modify-write operations to satisfy a single misaligned 4,096‑byte write operation.[4] Since April 2014, enterprise-class drives without emulation technology (4K native) have been available on the market.[5][6]

Readiness of the support for 4 KB logical sectors within operating systems differs among their types, vendors and versions.[7] For example, Microsoft Windows supports 4K native drives since Windows 8 and Windows Server 2012 (both released in 2012) in UEFI.[8]

Features edit

Like MBR, GPT uses logical block addressing (LBA) in place of the historical cylinder-head-sector (CHS) addressing. The protective MBR is stored at LBA 0, and the GPT header is in LBA 1, with a backup GPT header stored at the final LBA. The GPT header has a pointer to the partition table (Partition Entry Array), which is typically at LBA 2. Each entry on the partition table has a size of 128 bytes. The UEFI specification stipulates that a minimum of 16,384 bytes, regardless of sector size, are allocated for the Partition Entry Array.[9] Thus, on a disk with 512-byte sectors, at least 32 sectors are used for the Partition Entry Array, and the first usable block is at LBA 34 or higher, while on a 4,096-byte sectors disk, at least 4 sectors are used for the Partition Entry Array, and the first usable block is at LBA 6 or higher.

MBR variants edit

Protective MBR (LBA 0) edit

For limited backward compatibility, the space of the legacy Master Boot Record (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.[10]

A single partition of type 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.[10] 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.[11]

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 the 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 coded for a sector size of 512 bytes or are limited to 32-bit calculations, exceeding the 2 TiB limit could cause compatibility problems.[10]

Hybrid MBR (LBA 0 + GPT) edit

In operating systems that support GPT-based boot through BIOS services rather than EFI, the first sector may also still be 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.[10]

Partition table header (LBA 1) edit

GPT header format
Offset Length Contents
0 (0x00) 8 bytes Signature ("EFI PART", 45h 46h 49h 20h 50h 41h 52h 54h or 0x5452415020494645ULL[a] on little-endian machines)
8 (0x08) 4 bytes Revision number of header - 1.0 (00h 00h 01h 00h) for UEFI 2.10
12 (0x0C) 4 bytes Header size in little endian (in bytes, usually 5Ch 00h 00h 00h or 92 bytes)
16 (0x10) 4 bytes CRC32 of header (offset +0 to +0x5b) in little endian, with this field zeroed during calculation
20 (0x14) 4 bytes Reserved; must be zero
24 (0x18) 8 bytes Current LBA (location of this header copy)
32 (0x20) 8 bytes Backup LBA (location of the other header copy)
40 (0x28) 8 bytes First usable LBA for partitions (primary partition table last LBA + 1)
48 (0x30) 8 bytes Last usable LBA (secondary partition table first LBA − 1)
56 (0x38) 16 bytes Disk GUID in mixed endian[11]
72 (0x48) 8 bytes Starting LBA of array of partition entries (usually 2 for compatibility)
80 (0x50) 4 bytes Number of partition entries in array
84 (0x54) 4 bytes Size of a single partition entry (usually 80h or 128)
88 (0x58) 4 bytes CRC32 of partition entries array in little endian
92 (0x5C) * 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)

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 (offsets 80 and 84 in the table).[2]: 119 

Partition entries (LBA 2–33) edit

GUID partition entry format
Offset Length Contents
0 (0x00) 16 bytes Partition type GUID (mixed endian[11])
16 (0x10) 16 bytes Unique partition GUID (mixed endian)
32 (0x20) 8 bytes First LBA (little endian)
40 (0x28) 8 bytes Last LBA (inclusive, usually odd)
48 (0x30) 8 bytes Attribute flags (e.g. bit 60 denotes read-only)
56 (0x38) 72 bytes Partition name (36 UTF-16LE code units)

After the primary header and before the backup header, the Partition Entry Array describes partitions, using a minimum size of 128 bytes for each entry block.[12] 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 and as per RFC 4122, no central registry is needed to ensure the uniqueness of the GUID partition type designators.[13][2]: 2200

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
2 Legacy BIOS bootable (equivalent to active flag (typically bit 7 set) at offset +0h in partition entries of the MBR partition table)[14]
3–47 Reserved for future use
48–63 Defined and used by the individual partition type

Microsoft defines the type-specific attributes for basic data partition as:[15][16]

Basic data partition attributes
Bit Content
60 Read-only
61 Shadow copy (of another partition)
62 Hidden
63 No drive letter (i.e. do not automount)

Google defines the type-specific attributes for ChromeOS kernel as:[17]

ChromeOS kernel partition attributes
Bit Content
56 Successful boot flag
55–52 Tries remaining
51–48 Priority (15: highest, 1: lowest, 0: not bootable)

Operating-system support edit

UNIX and Unix-like systems edit

Details of GPT support on UNIX and Unix-like operating systems
OS family Version or edition Platform Read and write support Boot support Note
FreeBSD Since 7.0 IA-32, x86-64, ARM Yes Yes In a hybrid configuration, both GPT and MBR partition identifiers may be used.
Linux Most of the x86 Linux distributions
Fedora 8+ and Ubuntu 8.04+[18]
IA-32, x86-64, ARM Yes Yes Tools such as gdisk, GNU Parted,[19][20] util-linux v2.23+ fdisk,[21][22] SYSLINUX, GRUB 0.96 + patches and GRUB 2 have been GPT-enabled. Limited to 256 partitions per disk.[23]
macOS Since 10.4.0 (some features since 10.4.6)[24] IA-32, x86-64, PowerPC, Apple silicon Yes Yes Only Intel and Apple silicon Macintosh computers can boot from GPT.
MidnightBSD Since 0.4-CURRENT IA-32, x86-64 Yes Requires CSM In a hybrid configuration, both GPT and MBR partition identifiers may be used.
NetBSD Since 6.0[25] IA-32,[26] x86-64,[27] ARM Yes Yes
OpenBSD Since 5.9 IA-32, x86-64, ARM Yes Yes [28]
Solaris Since Solaris 10 IA-32, x86-64, SPARC Yes Yes [29]
HP-UX Since HP-UX 11.20 IA-64 Yes Yes [30]

Windows: 32-bit versions edit

Windows 7 and earlier do not support UEFI on 32-bit platforms, and therefore do not allow booting from GPT partitions.[31]

Details of GPT support on 32-bit editions of Microsoft Windows[31]
OS version Release date Platform Read or write support Boot support Note
Windows 9x 1995-08-24 IA-32 No[b] No
Windows XP 2001-10-25 IA-32 No No
Windows Server 2003 2003-04-24 IA-32 No No
Windows Server 2003 SP1 2005-03-30 IA-32 Yes No MBR takes precedence in hybrid configuration.
Windows Vista 2006-07-22 IA-32 Yes No MBR takes precedence in hybrid configuration.
Windows Server 2008 2008-02-27 IA-32 Yes No MBR takes precedence in hybrid configuration.
Windows 7 2009-10-22 IA-32 Yes No MBR takes precedence in hybrid configuration.
Windows 8 2012-08-01 IA-32 Yes Requires UEFI[32] MBR takes precedence in hybrid configuration.
Windows 8.1 2013-08-27 IA-32 Yes Requires UEFI[33] MBR takes precedence in hybrid configuration.
Windows 10 2015-07-29 IA-32 Yes Requires UEFI[34] MBR takes precedence in hybrid configuration.

Windows: 64-bit versions edit

Limited to 128 partitions per disk.[31]

Details of GPT support on 64-bit editions of Microsoft Windows[31]
OS version Release date Platform Read and write support Boot support Note
Windows XP 64-Bit Edition for Itanium systems, Version 2002 2001-10-25 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows XP 64-Bit Edition, Version 2003 2003-03-28 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows XP Professional x64 Edition
Windows Server 2003
2005-04-25[35] x64 Yes No MBR takes precedence in hybrid configuration.
Windows Server 2003 2005-04-25 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows Vista 2006-07-22 x64 Yes Requires UEFI[c] MBR takes precedence in hybrid configuration.
Windows Server 2008 2008-02-27 x64 Yes Requires UEFI MBR takes precedence in hybrid configuration.
Windows Server 2008 2008-02-27 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows 7 2009-10-22 x64 Yes Requires UEFI[d] MBR takes precedence in hybrid configuration.
Windows Server 2008 R2 2009-10-22 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows 8
Windows Server 2012
2012-08-01 x64 Yes Requires UEFI[36] MBR takes precedence in hybrid configuration.
Windows 8.1 2013-08-27 x64 Yes Requires UEFI[37] MBR takes precedence in hybrid configuration.
Windows 10 2015-07-29 x64 Yes Requires UEFI[38] MBR takes precedence in hybrid configuration.
Windows Server 2016 2016-10-12 x64 Yes Requires UEFI MBR takes precedence in hybrid configuration.
Windows Server 2019 2018-10-02 x64 Yes Requires UEFI MBR takes precedence in hybrid configuration.
Windows Server 2022 2021-08-18[39] x64 Yes Requires UEFI MBR takes precedence in hybrid configuration.
Windows 11 2021-10-05 x64, ARM64 Yes Yes UEFI is a system requirement for Windows 11.

See also edit

Notes edit

  1. ^ Adding ULL suffix to an integer constant makes it of type unsigned long long int.
  2. ^ Third party implementation exists (GPTTSD)
  3. ^ Only if using its service pack 1 or 2
  4. ^ In a multi-disk setup, non-UEFI bootloader (boot drive) requires MBR-based partitioning, while a system drive can use GUID partitioning.

References edit

  1. ^ a b "FAQ: Drive Partition Limits" (PDF). www.uefi.org. 2010. Retrieved 12 December 2020.
  2. ^ a b c "Unified Extensible Firmware Interface (UEFI) Specification" (PDF). www.uefi.org. 29 August 2022. p. 110. Retrieved 23 June 2023.
  3. ^ Swinburne, Richard (1 April 2010). "The Facts: 4K Advanced Format Hard Disks". www.bit-tech.net. Retrieved 12 December 2020.
  4. ^ a b Smith, Ryan (18 December 2009). "Western Digital's Advanced Format: The 4K Sector Transition Begins". www.anandtech.com. Archived from the original on 28 December 2020. Retrieved 12 December 2020.
  5. ^ "Enterprise Capacity 3.5 HDD Data Sheet" (PDF). Seagate Technology. April 23, 2014. p. 2. Archived (PDF) from the original on 2014-08-12. Retrieved August 10, 2014.
  6. ^ "WD Re Datacenter Distribution Specification Sheet" (PDF). Western Digital. January 21, 2016. p. 2. Archived (PDF) from the original on 2015-09-06. Retrieved February 14, 2016.
  7. ^ "Advanced format (4K) disk compatibility update (Windows)". November 28, 2012. Archived from the original on 2013-01-11. Retrieved January 3, 2013.
  8. ^ "Microsoft support policy for 4K sector hard drives in Windows". Microsoft. Archived from the original on 2011-08-19. Retrieved October 24, 2013.
  9. ^ "UEFI specification". UEFI.org.
  10. ^ a b c d Smith, Roderick (3 July 2012). "Make the most of large drives with GPT and Linux". IBM. Retrieved 14 December 2020.
  11. ^ a b c "Technical Note TN2166: Secrets of the GPT". Apple Developer. Apple. 2006-11-06. Retrieved 2014-04-16.
  12. ^ 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.
  13. ^ Leach, P.; Mealling, M.; Salz, R. (July 2005). A Universally Unique IDentifier (UUID) URN Namespace. Internet Engineering Task Force. doi:10.17487/RFC4122. RFC 4122. Retrieved 18 December 2020.
  14. ^ Elliott, Rob (4 January 2010). "e09127r3 EDD-4 Hybrid MBR Boot Code Annex" (PDF). www.t13.org. Archived from the original (PDF) on 20 August 2020. Retrieved 16 December 2020.
  15. ^ "GPT | Microsoft Docs". 31 August 2016.
  16. ^ "CREATE_PARTITION_PARAMETERS (vds.h) - Win32 apps | Microsoft Docs". 9 February 2023.
  17. ^ "Disk Format". Chromium.org. Retrieved 2022-02-09.
  18. ^ "Ubuntu on MacBook". Community Documentation. Ubuntu.
  19. ^ "GNU Parted FAQ".
  20. ^ "mklabel". Parted Manual. GNU.
  21. ^ "fdisk: add GPT support". kernel.org. 2013-09-27. Retrieved 2013-10-18.
  22. ^ Bueso, Davidlohr (2013-09-28). "fdisk updates and GPT support". Retrieved 2013-10-18.
  23. ^ "DISK_MAX_PARTS define". Archived from the original on 2020-03-26. Retrieved 2020-03-26.
  24. ^ "Myths and Facts About Intel Macs". rEFIt. Source forge.
  25. ^ "Significant changes from NetBSD 5.0 to 6.0"..
  26. ^ "Significant changes from NetBSD 5.0 to 6.0 (NetBSD/i386)"..
  27. ^ "Significant changes from NetBSD 5.0 to 6.0 (NetBSD/amd64)"..
  28. ^ "OpenBSD 5.9"..
  29. ^ "Booting from a ZFS Root File System". Oracle. Archived from the original on 2011-12-10.
  30. ^ "idisk(1M)". Hewlett-Packard.
  31. ^ a b c d "Windows and GPT FAQ". msdn.microsoft.com. 1 June 2017. Retrieved 14 December 2020.
  32. ^ Windows 8 32-bit supports booting from UEFI-based PC (x86-32 only) using GPT-based disks.
  33. ^ Windows 8.1 32-bit supports booting from UEFI-based PC (x86-32 only) using GPT-based disks.
  34. ^ Windows 10 32-bit supports booting from UEFI-based PC (x86-32 only) using GPT-based disks.
  35. ^ Microsoft raises the speed limit with the availability of 64-bit editions of Windows Server 2003 and Windows XP Professional Archived 2010-11-10 at the Wayback Machine
  36. ^ Windows 8 64-bit supports booting from UEFI-based PC (x86-64 only) using GPT-based disks.
  37. ^ Windows 8.1 64-bit supports booting from UEFI-based PC (x86-64 only) using GPT-based disks.
  38. ^ Windows 10 64-bit supports booting from UEFI-based PC (x86-64 only) using GPT-based disks.
  39. ^ Microsoft's 'Weirdest Release': Windows Server 2022 Quietly Becomes Generally Available

External links edit

  • Microsoft TechNet: Disk Sectors on GPT Disks (archived page)
  • Microsoft Windows Deployment: Converting MBR to GPT without dats loss
  • Microsoft TechNet: Troubleshooting Disks and File Systems
  • Microsoft TechNet: Using GPT Drives
  • Microsoft: FAQs on Using GPT disks in Windows
  • 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.
  • Apple Developer Connection: Secrets of the GPT
  • Make the most of large drives with GPT and Linux
  • Convert Windows Vista SP1+ or 7 x86_64 boot from BIOS-MBR mode to UEFI-GPT mode without Reinstall
  • Support for GPT (Partition scheme) and HDD greater than 2.19 TB in Microsoft Windows XP
  • Setting up a RAID volume in Linux with >2TB disks