GUID Partition Table Unified Extensible Firmware Interface UEFI
GUID Partition Table • Unified Extensible Firmware Interface (UEFI) • GUID Partition Table (GPT)
Computer Center, CS, NCTU Unified Extensible Firmware Interface q BIOS limitations • 16 -bit processor mode • 1 MB addressable space q UEFI advantages • UEFI v 2. 3. 1 in April 2011 • Disk device compatibility (GUID Partition Table) • Processor compatibility (x 86, x 64, ARM) 2
Computer Center, CS, NCTU GUID Partition Table – (1) q Limitation of MBR partition table • Partition record Ø active(1)、first CHS(3)、type(1)、last CHS(3)、start LBA(4)、size(4) • Maximum capacity Ø (232 -1) x 512 bytes ~ 241 bytes = 2 TBytes q GPT • Maximum capacity: 8 ZBytes (273 bytes) • Used on some BIOS system 3
Computer Center, CS, NCTU GUID Partition Table – (2) q GPT • LBA 0: Legacy MBR • LBA 1: GPT Header • LBA 2~33: Partition Entries Ø 128 partitions • LBA 34~: Partitions • LBA -34 ~ -1: Secondary GPT data q Misaligned block • SSD (1 K LBA) • WD (4 K sector) 4
Computer Center, CS, NCTU 5 GUID Partition Table – (3) q Legacy MBR (LBA 0) • A single partition of type 0 x. EE, and of whole disk size (max 2 T) • For OSes which cannot read GPT: unknown partition, no space • For GPT-aware OSes: check the “protective MBR”
Computer Center, CS, NCTU 6 GUID Partition Table – (4) q Partition header table (LBA 1) Offset Length Contents 0 8 bytes Signature ("EFI PART", 45 46 49 20 50 41 52 54) Revision (For GPT version 1. 0 (through at least UEFI version 2. 3. 1), the value is 8 4 bytes 00 00 01 00) 12 4 bytes Header size in little endian (in bytes, usually 5 C 00 00 00 meaning 92 bytes) 16 4 bytes CRC 32 of header (0 to header size), with this field zeroed during calculation 20 4 bytes Reserved; must be zero 24 8 bytes Current LBA (location of this header copy) 32 8 bytes Backup LBA (location of the other header copy) 40 8 bytes First usable LBA for partitions (primary partition table last LBA + 1) 48 8 bytes Last usable LBA (secondary partition table first LBA - 1) 56 16 bytes Disk GUID (also referred as UUID on UNIXes) 72 8 bytes Partition entries starting LBA (always 2 in primary copy) 80 4 bytes Number of partition entries 84 4 bytes Size of a partition entry (usually 128) 88 4 bytes CRC 32 of partition array 92 * Reserved; must be zeroes for the rest of the block (420 bytes for a 512 -byte LBA)
Computer Center, CS, NCTU 7 GUID Partition Table – (5) q Partition header table (LBA 1) # dd if=/dev/ada 0 bs=512 count=1 skip=1 | hd 0000 45 46 49 20 50 41 52 54 00 00 01 00 5 c 00 00 00 |EFI PART. . . . . | 00000010 e 6 f 0 27 96 00 00 01 00 00 |. . '. . . | 00000020 2 f 60 38 3 a 00 00 22 00 00 |/`8: . . ". . . . | 00000030 0 e 60 38 3 a 00 00 7 f a 3 90 90 46 b 4 de 11 |. `8: . . . . F. . . | 00000040 8 e b 8 00 21 85 12 22 74 02 00 00 |. . . !. . "t. . . . | 00000050 80 00 00 00 e 0 9 d 1 a 52 00 00 |. . . R. . | 00000060 00 00 00 00 |. . . . | * 00000200
Computer Center, CS, NCTU GUID Partition Table – (6) q Partition entries (LBA 2~33) • 128 bytes for each partition entry Offset 0 16 Contents 16 bytes Partition type GUID 16 bytes Unique partition GUID 32 8 bytes First LBA (little-endian) 40 8 bytes Last LBA (inclusive, usually odd) 48 8 bytes Attribute flags (e. g. bit 60 denotes read-only) 56 128 8 Length 72 bytes Partition name (36 UTF-16 LE code units) Total
Computer Center, CS, NCTU 9 GUID Partition Table – (7) q Partition type GUID freebsd-boot 83 BD 6 B 9 D-7 F 41 -11 DC-BE 0 B-001560 B 84 F 0 F freebsd 516 E 7 CB 4 -6 ECF-11 D 6 -8 FF 8 -00022 D 09712 B freebsd-swap 516 E 7 CB 5 -6 ECF-11 D 6 -8 FF 8 -00022 D 09712 B freebsd-ufs 516 E 7 CB 6 -6 ECF-11 D 6 -8 FF 8 -00022 D 09712 B freebsd-vinum 516 E 7 CB 8 -6 ECF-11 D 6 -8 FF 8 -00022 D 09712 B freebsd-zfs 516 E 7 CBA-6 ECF-11 D 6 -8 FF 8 -00022 D 09712 B
- Slides: 9