GUID Partition Table

From Hidden Wiki
Jump to navigation Jump to search
File:GUID Partition Table Scheme.svg
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.

GUID Partition Table (GPT) is a standard for the layout of the partition table on a physical storage device used in a desktop or server PC, such as a hard disk drive or solid-state drive, using globally unique identifiers (GUID). Although it forms a part of the Unified Extensible Firmware Interface (UEFI) standard (Unified EFI Forum proposed replacement for the PC BIOS), it is also used on some BIOS systems because of the limitations of master boot record (MBR) partition tables, which use 32 bits for storing logical block addresses (LBA) and size information on a traditionally 512-byte disk sector.

All modern PC operating systems support GPT. Some, including macOS and Microsoft Windows on x86, 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 both legacy BIOS firmware interface and EFI.

History

Template:Main article

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. Template:As of, 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 (coming from 264 sectors × 29 bytes per sector).[1][3]

Features

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]


MBR variants

Template:AnchorProtective MBR (LBA 0)

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 Template:Mono, 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 Template:Mono or if there are multiple partitions defined on the target device, the OS may refuse to manipulate the partition table.[6]

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.Template: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]

Template:AnchorHybrid MBR (LBA 0 + GPT)

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]

Partition table header (LBA 1)

GPT header format
Offset Length Contents
0 (0x00) 8 bytes Signature ("EFI PART", Template:Mono or Template:MonoTemplate:Efn on little-endian machines)
8 (0x08) 4 bytes Revision (for GPT version 1.0 (through at least UEFI version 2.7 (May 2017)), the value is Template:Mono)
12 (0x0C) 4 bytes Header size in little endian (in bytes, usually Template:Mono or 92 bytes)
16 (0x10) 4 bytes CRC32/zlib of header (offset +0 up to header size) 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 (also referred as UUID on UNIXes)
72 (0x48) 8 bytes Starting LBA of array of partition entries (always 2 in primary copy)
80 (0x50) 4 bytes Number of partition entries in array
84 (0x54) 4 bytes Size of a single partition entry (usually Template:Mono or 128)
88 (0x58) 4 bytes CRC32/zlib of partition 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.Template:Citation needed

Template:Clear

Partition entries (LBA 2-33)

GUID partition entry format
Offset Length Contents
0 (0x00) 16 bytes Partition type GUID
16 (0x10) 16 bytes Unique partition GUID
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 header, the Partition Entry Array describes partitions, using a minimum size of 128 bytes for each entry block.[7] 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 Template:Mono. 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 RFC4122[8], no central registry is needed to ensure the uniqueness of the GUID partition type designators.

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 Template:Mono in partition entries of the MBR partition table)[9]
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:[10][11]

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 Chrome OS kernel as:[12]

Chrome OS kernel partition attributes
Bit Content
56 Successful Boot Flag
55-52 Tries Remaining
51-48 Priority (15 = highest, 1 = lowest, 0 = not bootable)

Template:AnchorOperating-system support

Template:See also

UNIX and Unix-like systems

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 Template:Yes Template: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+[13]
IA-32, x86-64 Template:Yes Template:Yes New tools such as gdisk, GNU Parted,[14][15] util-linux v2.23+ fdisk,[16][17] SYSLINUX, GRUB 0.96 + patches and GRUB 2 have been GPT-enabled.
macOS Since 10.4.0 (some features since 10.4.6)[18] IA-32, x86-64, PowerPC Template:Yes Template:Yes Only Intel Macintosh computers can boot from GPT.
MidnightBSD Since 0.4-CURRENT IA-32, x86-64 Template:Yes Template:Partial In a hybrid configuration, both GPT and MBR partition identifiers may be used.
NetBSD Since 6.0[19] x86[20], x86-64[21] Template:Yes Template:Partial Some users describe their installation procedure with EFI[22] but the official announcement of the support has not yet been made. a semi-manual UEFI installation works on NetBSD 8.0 (-current)[23]
Solaris Since Solaris 10 IA-32, x86-64, SPARC Template:Yes Template:Yes [24]
HP-UX Since HP-UX 11.20 IA-64 Template:Yes Template:Yes [25]

Windows: 32-bit versions

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

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

Windows: 64-bit versions

Details of GPT support on 64-bit editions of Microsoft Windows[26]
OS version Release date Platform Read and write support Boot support Note
Windows XP Professional x64 Edition
Windows Server 2003
2005-04-25[28] x64 Template:Yes Template:No MBR takes precedence in hybrid MBR configuration
Windows Server 2003 2005-04-25 IA-64 Template:Yes Template:Yes MBR takes precedence in hybrid MBR configuration
Windows Vista 2006-07-22 x64 Template:Yes Template:PartialTemplate:Efn MBR takes precedence in hybrid configuration
Windows Server 2008 2008-02-27 x64 Template:Yes Template:Partial MBR takes precedence in hybrid configuration
Windows Server 2008 2008-02-27 IA-64 Template:Yes Template:Yes MBR takes precedence in hybrid configuration
Windows 7 2009-10-22 x64 Template:Yes Template:PartialTemplate:Efn MBR takes precedence in hybrid configuration.
Windows Server 2008 R2 2009-10-22 IA-64 Template:Yes Template:Yes MBR takes precedence in hybrid configuration
Windows 8
Windows Server 2012
2012-08-01 x64 Template:Yes Template:Partial[27] MBR takes precedence in hybrid configuration.
Windows 8.1 2013-08-27 x64 Template:Yes Template:Partial[27] MBR takes precedence in hybrid configuration
Windows 10 2015-07-29 x64 Template:Yes Template:Partial[27] MBR takes precedence in hybrid configuration
Windows Server 2016 2016-10-12 x64 Template:Yes Template:Partial[27] MBR takes precedence in hybrid configuration

Partition type GUIDs

Operating system Partition type Globally unique identifier (GUID)Template:Efn
(None) Unused entry Template:Mono
MBR partition scheme Template:Mono
EFI System partition Template:Mono
BIOS boot partitionTemplate:Efn Template:Mono
Intel Fast Flash (iFFS) partition (for Intel Rapid Start technology)[29][30] Template:Mono
Sony boot partitionTemplate:Efn Template:Mono
Lenovo boot partitionTemplate:Efn Template:Mono
Windows Microsoft Reserved Partition (MSR) Template:Mono
Basic data partitionTemplate:Efn Template:Mono
Logical Disk Manager (LDM) metadata partition Template:Mono
Logical Disk Manager data partition Template:Mono
Windows Recovery Environment Template:Mono
IBM General Parallel File System (GPFS) partition Template:Mono
Storage Spaces partition Template:Mono
HP-UX Data partition Template:Mono
Service Partition Template:Mono
Linux Linux filesystem dataTemplate:Efn Template:Mono
RAID partition Template:Mono
Root partition (x86)[31] Template:Mono
Root partition (x86-64)[31] Template:Mono
Root partition (32-bit ARM)[31] Template:Mono
Root partition (64-bit ARM/AArch64)[31] Template:Mono
Data partition[32] Template:Mono
Template:Mono
Swap partition Template:Mono
Logical Volume Manager (LVM) partition Template:Mono
Template:Mono partition[31] Template:Mono
Template:Mono (server data) partition[31] Template:Mono
Plain dm-crypt partition[33][34][35] Template:Mono
LUKS partition[33][34][35][36] Template:Mono
Reserved Template:Mono
FreeBSD Boot partition Template:Mono
Data partition Template:Mono
Swap partition Template:Mono
Unix File System (UFS) partition Template:Mono
Vinum volume manager partition Template:Mono
ZFS partition Template:Mono
macOS
Darwin
Hierarchical File System Plus (HFS+) partition Template:Mono
Apple APFS Template:Mono
Apple UFS container Template:Mono
ZFSTemplate:Efn Template:Mono
Apple RAID partition Template:Mono
Apple RAID partition, offline Template:Mono
Apple Boot partition (Recovery HD) Template:Mono
Apple Label Template:Mono
Apple TV Recovery partition Template:Mono
Apple Core Storage (i.e. Lion FileVault) partition Template:Mono
SoftRAID_Status Template:Mono
SoftRAID_Scratch Template:Mono
SoftRAID_Volume Template:Mono
SoftRAID_Cache Template:Mono
Solaris
illumos
Boot partition Template:Mono
Root partition Template:Mono
Swap partition Template:Mono
Backup partition Template:Mono
Template:Mono partitionTemplate:Efn Template:Mono
Template:Mono partition Template:Mono
Template:Mono partition Template:Mono
Alternate sector Template:Mono
Reserved partition Template:Mono
Template:Mono
Template:Mono
Template:Mono
Template:Mono
NetBSD[37]Template:Efn Swap partition Template:Mono
FFS partition Template:Mono
LFS partition Template:Mono
RAID partition Template:Mono
Concatenated partition Template:Mono
Encrypted partition Template:Mono
Chrome OS[38] Chrome OS kernel Template:Mono
Chrome OS rootfs Template:Mono
Chrome OS future use Template:Mono
Container Linux by CoreOS[39] /usr partition (coreos-usr) Template:Mono
Resizable rootfs (coreos-resize) Template:Mono
OEM customizations (coreos-reserved) Template:Mono
Root filesystem on RAID (coreos-root-raid) Template:Mono
Haiku[40] Haiku BFS Template:Mono
MidnightBSD[41]Template:Efn Boot partition Template:Mono
Data partition Template:Mono
Swap partition Template:Mono
Unix File System (UFS) partition Template:Mono
Vinum volume manager partition Template:Mono
ZFS partition Template:Mono
CephTemplate:Efn Journal Template:Mono
dm-crypt journal Template:Mono
OSD Template:Mono
dm-crypt OSD Template:Mono
Disk in creation Template:Mono
dm-crypt disk in creation Template:Mono
Block Template:Mono
Block DB Template:Mono
Block write-ahead log Template:Mono
Lockbox for dm-crypt keys Template:Mono
Multipath OSD Template:Mono
Multipath journal Template:Mono
Multipath block Template:Mono
Multipath block Template:Mono
Multipath block DB Template:Mono
Multipath block write-ahead log Template:Mono
dm-crypt block Template:Mono
dm-crypt block DB Template:Mono
dm-crypt block write-ahead log Template:Mono
dm-crypt LUKS journal Template:Mono
dm-crypt LUKS block Template:Mono
dm-crypt LUKS block DB Template:Mono
dm-crypt LUKS block write-ahead log Template:Mono
dm-crypt LUKS OSD Template:Mono
OpenBSD Data partition Template:Mono
QNX Power-safe (QNX6) file system[42] Template:Mono
Plan 9 Plan 9 partition Template:Mono
VMware ESX vmkcore (coredump partition) Template:Mono
VMFS filesystem partition Template:Mono
VMware Reserved Template:Mono
Android-IA[43][44][45][46] Bootloader Template:Mono
Bootloader2 Template:Mono
Boot Template:Mono
Recovery Template:Mono
Misc Template:Mono
Metadata Template:Mono
System Template:Mono
Cache Template:Mono
Data Template:Mono
Persistent Template:Mono
Vendor Template:Mono
Config Template:Mono
Factory Template:Mono
Factory (alt)[47] Template:Mono
Fastboot / Tertiary[48][49] Template:Mono
OEM Template:Mono
Android 6.0+ ARM Android Meta Template:Mono
Android EXT Template:Mono
Open Network Install Environment (ONIE) Boot Template:Mono
Config Template:Mono
PowerPC PReP boot Template:Mono
freedesktop.org OSes (Linux, etc.) Shared boot loader configuration[50] Template:Mono
Atari TOS Basic data partition (GEM, BGM, F32) Template:Mono

See also

Template:Div col

Template:Div col end

Notes

Template:Notelist

References

1 }}
     | references-column-width 
     | references-column-count references-column-count-{{#if:1|35em}} }}
   | {{#if: 
     | references-column-width }} }}" style="{{#if: 35em
   | {{#iferror: {{#ifexpr: 35em > 1 }}
     | Template:Column-width
     | Template:Column-count }}
   | {{#if: 
     | Template:Column-width }} }} list-style-type: {{#switch: 
   | upper-alpha
   | upper-roman
   | lower-alpha
   | lower-greek
   | lower-roman = {{{group}}}
   | #default = decimal}};">
  1. 1.0 1.1 Template:Cite news
  2. Template:Cite journal
  3. 3.0 3.1 3.2 3.3 3.4 Template:Cite news
  4. Template:Cite web
  5. Template:Cite web
  6. Template:Cite web
  7. 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 Template:Cite web
  8. Template:Cite web
  9. Template:Cite web
  10. https://technet.microsoft.com/en-us/library/cc753455.aspx#Anchor_1
  11. https://msdn.microsoft.com/en-us/library/aa381635.aspx
  12. Template:Cite web
  13. Template:Cite web
  14. Template:Cite web
  15. Template:Cite web
  16. Template:Cite web
  17. Template:Cite web
  18. Template:Cite web
  19. Template:Cite web.
  20. Template:Cite web.
  21. Template:Cite web.
  22. Template:Cite web.
  23. Template:Cite web.
  24. Template:Cite web
  25. Template:Cite web
  26. 26.0 26.1 26.2 Template:Cite web
  27. 27.0 27.1 27.2 27.3 27.4 27.5 27.6 Windows 8 32-bit supports booting from UEFI-based PC using GPT-based disks.
  28. Microsoft raises the speed limit with the availability of 64-bit editions of Windows Server 2003 and Windows XP Professional Template:Webarchive
  29. ftp://download.gigabyte.ru/manual/mb_manual_intel-ui_e.pdf
  30. Template:Cite web
  31. 31.0 31.1 31.2 31.3 31.4 31.5 The Discoverable Partitions Specification
  32. Template:Cite web
  33. 33.0 33.1 Template:Cite web
  34. 34.0 34.1 Template:Cite web
  35. 35.0 35.1 Template:Cite web
  36. Template:Cite web
  37. Template:Cite web
  38. Template:Cite web
  39. Template:Cite web
  40. src/add-ons/kernel/partitioning_systems/gpt/gpt_known_guids.h
  41. http://www.midnightbsd.org/cgi-bin/cvsweb.cgi/src/sys/sys/gpt.h.diff?r1=1.4;r2=1.5 src/sys/sys/gpt.h
  42. QNX Power-safe filesystem
  43. Template:Cite web
  44. Template:Cite web
  45. Template:Cite web
  46. Template:Cite web
  47. Template:Cite web
  48. Template:Cite web
  49. Template:Cite web
  50. Template:Cite web

External links