GPT: Difference between revisions
[unchecked revision] | [unchecked revision] |
Content deleted Content added
No edit summary |
No edit summary |
||
(11 intermediate revisions by 7 users not shown) | |||
Line 9:
|LBA 1||partition header, can be identified by 8 bytes magic "EFI PART" (45h 46h 49h 20h 50h 41h 52h 54h)
|-
|LBA 2..33||partition table
|-
| colspan="2" | ...data on disk...
Line 20:
=== LBA 0: Protective Master Boot Record ===
This is kept untouched for backward compatibility. The UEFI specification requires that the PMBR partition table contain one partition record, with the other three partition records set to zero. The partition record should be defined as follows:
{| {{wikitable}}
|'''Offset'''||'''Length (bytes)'''||'''Description'''||'''Value'''
|-
|0x0||1||Boot Indicator||Set to 0x00 to indicate a non-bootable partition.
|-
|0x1||3||Starting CHS||Set to 0x000200, corresponding to the Starting LBA field.
|-
|0x4||1||OS Type||Set to 0xEE (GPT Protective)
|-
|0x5||3||Ending CHS||Set to the CHS address of the last logical block on the disk. Set to 0xFFFFFF if the value cannot be represented in this field.
|-
|0x8||4||Starting LBA||Set to 0x00000001 (LBA of GPT Partition Header)
|-
|0xC||4||Ending LBA||Set to the size in logical blocks of the disk, minus one. Set to 0xFFFFFFFF if the size of the disk is too large to be represented in this field.
|}
The PMBR will always exist if the drive contains a GPT, as it is required in order to maintain compatibility with tools expecting an MBR partition table. It's also worth noting that UEFI firmware implementations are also required to parse legacy MBR partition tables in the event that the drive does not contain a GPT.
=== LBA 1: Partition Table Header ===
Line 39 ⟶ 53:
|0xC||4||Header size
|-
|0x10||4||CRC32 checksum of the GPT header (0x0 to 0x5c)
|-
|0x14||4||Reserved
Line 55 ⟶ 69:
|0x48||8||Starting LBA of the GUID Partition Entry array
|-
|0x50||4||Number of
|-
|0x54||4||Size (in bytes) of each entry in the Partition Entry array - must be a value of 128×2ⁿ where n ≥ 0 (in the past, multiples of 8 were acceptable)
Line 63 ⟶ 77:
|0x5C||'''blocksize'''-0x5C||Reserved (should be zeroed)
|}
The Partition Entry array can contain unused entries -- that is, the GUID value is set to zero. For the purposes of the GPT header, these should be counted when considering the Number of Partition Entries field, and should also be taken into account when calculating the CRC32 of the entire array. There should be no more entries in the array, unused or otherwise, than are indicated by this field.
For the checksums in the header, the CCITT32 ANSI CRC method is used, the one with the polynomial 0x04c11db7 (same as in gzip, and different to the Castagnoli CRC32 that hardware accelerated CRC instructions calculate). The header checksum field at 0x10 is zeroed during calculation and the reserved data are not included.
=== LBA 2: Partition Entries ===
Line 79 ⟶ 93:
|0x10||16||Unique Partition GUID
|-
|0x20||8||
|-
|0x28||8||
|-
|0x30||8||Attributes
Line 97 ⟶ 111:
The following utilities can handle GPT:
* [http://www.gnu.org/software/parted/manual/parted.html parted], [http://linux.die.net/man/8/gparted gparted], [http://www.rodsbooks.com/gdisk/ gdisk] on Linux
* [
* [http://technet.microsoft.com/en-us/library/bb490893.aspx diskpart] on Windows (Vista and upwards)
* [http://www.freebsd.org/cgi/man.cgi?query=gpt&manpath=FreeBSD+7.1-RELEASE gpt] on MacOSX and BSDs.
== Boot loaders ==
Line 118 ⟶ 131:
* [http://msdn.microsoft.com/en-us/windows/hardware/gg463524.aspx GPT on MSDN]
* [http://developer.apple.com/library/mac/#technotes/tn2166/_index.html GPT on Apple Developer]
* [http://www.ibm.com/developerworks/linux/library/l-gpt/ GPT on IBM
* [[wikipedia:GUID_Partition_Table|Wikipedia: GUID Partition Table]]
* [[wikipedia:BIOS_Boot_partition|Wikipedia: BIOS Boot partition]]
[[Category:
[[Category:UEFI]]
[[Category:Firmware]]
|