GUID Partition Table Unified Extensible Firmware Interface UEFI
GUID Partition Table • Unified Extensible Firmware Interface (UEFI) • Master Boot Record (MBR) • GUID Partition Table (GPT)
Computer Center, CS, NCTU Unified Extensible Firmware Interface q Legacy BIOS limitations • 16 -bit processor mode • 1 MB addressable space q Advantages • • 32 -bit/64 -bit processor mode Ability to boot from larger disk with a GPT Flexible pre-OS environment, including network capability Modular design q Compatibility Support Module (CSM) • BIOS-MBR • BIOS-GPT 2
Computer Center, CS, NCTU Master Boot Record (1/2) q The Master Boot Record (MBR) is the first 512 bytes of a storage device Offset Contents 0 446 bytes Boot code area 446 510 128 3 Length 64 bytes Partition tables, each has 16 bytes 2 bytes Boot signature (0 x. AA 55) Total
Computer Center, CS, NCTU Master Boot Record (2/2) q Drawbacks • (4 primary partitions) or (3 primary + 1 extended partitions) Ø Arbitrary number of logical partitions within the extended partition • The logical partition meta-data is stored in a linked-list structure • One byte partition type codes which leads to many collisions • Maximum addressable size is 2 Ti. B, i. e. any space beyond 2 Ti. B cannot be defined as a partition Ø MBR stores partition sector information using 32 -bit LBA values Ø 512 bytes per sector Ø 232 * 512 bytes = 2 Ti. B 4
Computer Center, CS, NCTU Booting Process 1. System initialization with firmware called BIOS 2. The BIOS looks for the bootloader on the MBR, then executes it 3. Bootloader reads the partition table • Conventional Windows/DOS MBR bootloader search for one active and primary partition • GRUB safely ignores this 4. Loading operating system 5
Computer Center, CS, NCTU 6 GUID Partition Table (1/9) q GUID stands for Globally Unique Identifier • Ex: 3 F 2504 E 0 -4 F 89 -41 D 3 -9 A 0 C-0305 E 82 C 3301 q Part of the UEFI specification q Solves some legacy problems with MBR but also may have compatibility issues q Can be used also on BIOS system via a protective MBR
Computer Center, CS, NCTU GUID Partition Table (2/9) q Advantages • Filesystem-independent • No partition type collision because of GUIDs • 8 Zi. B Ø GPT uses 64 -bit LBA Ø 512 bytes per sector Ø 264 * 512 bytes = 8 Zi. B • Backup header and partition table at the end of the disk • CRC 32 checksums for header and partition table 7
Computer Center, CS, NCTU 8 GUID Partition Table (3/9) q GPT Scheme • LBA 0: Legacy MBR • LBA 1: GPT header • LBA 2~33: Partition entries Ø Up to 128 partitions • LBA 34~: Partitions • LBA -34~-1: Secondary GPT data
Computer Center, CS, NCTU 9 GUID Partition Table (4/9) q Legacy MBR (LBA 0) • A single partition type of 0 x. EE • For OSes cannot read GPT disks: Unknown type, no empty space • For GPT-aware OSes: check the protective MBR
Computer Center, CS, NCTU 10 GUID Partition Table (5/9) q GPT header (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 11 GUID Partition Table (6/9) q GPT header (LBA 1) • dd if=/dev/ada 0 bs=512 count=1 skip=1 | hd
Computer Center, CS, NCTU GUID Partition Table (7/9) q Partition entries (LBA 2) Offset 0 16 Length 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 72 bytes Partition name (36 UTF-16 LE code units) 128 bytes 12 Contents Total
Computer Center, CS, NCTU 13 GUID Partition Table (8/9) 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
Computer Center, CS, NCTU 14 GUID Partition Table (9/9) q Partition entries (LBA 2) • dd if=/dev/ada 0 bs=512 count=1 skip=2 | hd
Computer Center, CS, NCTU 15 References q http: //pansci. tw/archives/8111 q http: //www. rodsbooks. com/gdisk/whatsgpt. html
- Slides: 15