GPT

From OSDev.wiki
Revision as of 23:10, 26 March 2020 by osdev>Computerfido (Added Partition Table Header structure)
Jump to navigation Jump to search

GPT stands for GUID Partition Table. It is made to replace MBR partitioning.

Layout

LBA 0 Protective Master Boot Record (PMBR). Holds a partition pointing to GPT to avoid accidental overwrite by old programs.
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 entires
...data on disk...
LBA -33..-2 mirror of partition table
LBA -1 mirror of partition header on last addressable sector

Partition Table Header

Offset Length (bytes) Description
0x0 8 Signature, can be identified by 8 bytes magic "EFI PART" (45h 46h 49h 20h 50h 41h 52h 54h)
0x8 4 GPT Revision
0xC 4 Header size
0x10 4 CRC32 checksum of the GPT header
0x14 4 Reserved
0x18 8 The LBA containing this header
0x20 8 The LBA of the alternate GPT header
0x28 8 The first usable block that can be contained in a GPT entry
0x30 8 The last usable block that can be contained in a GPT entry
0x38 16 GUID of the disk
0x48 8 Starting LBA of the GUID Parition Entry array
0x50 4 Number of Parition Entries
0x54 4 Size (in bytes) of each entry in the Parition Entry array - must be a multiple of 8
0x58 4 CRC32 of the Partition Entry array.
0x5C blocksize-0x5C Reserved (should be zeroed)

Utilities

The following utilities can handle GPT:

Boot loaders

EFI firmware is capable of booting from a specific GPT partition, EFI System Partition which is basically a FAT32 partition. It should contain a slightly modified PE-executable, like ELILO. On old machines with legacy BIOS only you can use GRUB, or you can write a custom boot code.

See Also

Articles

External Links