GUID Partition Table

• Unified Extensible Interface (UEFI) • (MBR) • GUID Partition Table (GPT) OS environment, including network capability network including environment, OS - bit processor mode processor bit - MBR GPT - - bit processor mode processor bit bit/64 - - Flexible pre Flexible design Modular BIOS BIOS 16 space addressable 1 MB 32 GPT a with disk larger from bootto Ability • • • • • • • • Compatibility Support Module (CSM) Support Module Compatibility Advantages Legacy BIOS BIOS limitations Legacy    Unified Extensible Firmware Interface

Computer Center, CS, NCTU 2 AA) 55 Contents Total tables,each16 has codearea Boot Partition Boot signature(0x bytes bytes bytes 2 64 Length 446 0 510 446 128 Offset The Master Boot Record (MBR) is the first 512 bytes of of a bytes 512 first is the (MBR) Record Boot Master The device storage  Master Boot Record (1/2)

Computer Center, CS, NCTU 3 list structure list - bitLBA values - data is stored in a linked a in stored is data - * 512 bytesTiB* 512 = 2 32 MBR stores partition sector information using 32 sector informationusing stores partition MBR bytesper sector 512 2 Arbitrary number of logical partitions within the extended partitionwithintheextended partitions of logicalArbitrarynumber     cannot be defined as a partition as be defined cannot (4 primary partitions) or (3 primary + 1 extended partitions) 1 extended + primary (3 or partitions) primary (4 meta partition The logical collisions many to leads which codes type partition One 2 TiB beyond space any i.e. 2 TiB, is size addressable Maximum • • • • Drawbacks  Master Boot Record (2/2)

Computer Center, CS, NCTU 4 GRUB safely ignores this ignores GRUB safely Conventional Windows/DOS MBR search for one active active onefor search bootloader MBR Windows/DOS Conventional partition primary and Loading operating Loading • executes it executes table partition reads the Bootloader • System initialization with firmware called BIOS called firmware with initialization System MBR, then on the bootloaderBIOS for the The looks 4. 3. 1. 2. BootingProcess

Computer Center, CS, NCTU 5 0305E82C3301 - 9A0C - 41D3 - 4F89 - 3F2504E0 Ex: • Can be used also on BIOS system via a protective MBR via a protective used alsosystem BIOS on Can be Part of the UEFI UEFI specification of thePart have also may but MBR with problems legacy some Solves issues compatibility GUID stands for Globally Unique Identifier Unique Globally GUID for stands     GUID PartitionGUID Table (1/9)

Computer Center, CS, NCTU 6 ZiB bit LBA bit - independent - * 512 bytes* 512 = 8 64 2 GPT uses 64 uses GPT bytes512 sectorper ZiB    header and partition table at the end of the disk the of end the at table partition and header Backup table andpartition header for checksums CRC32 Filesystem ofGUIDs because collision type Nopartition 8 LBA: Logical Block Address BlockLBA: Logical • • • • • Advantages  GUID PartitionGUID Table (2/9)

Computer Center, CS, NCTU 7 1: Secondary Secondary 1: - 34~ - Up to 128 partitions to128 Up  LBA data GPT LBA 0: Legacy MBR Legacy LBA 0: header GPT LBA 1: entries Partition LBA 2~33: Partitions LBA 34~: • • • • • GPT Scheme GPT  GUID PartitionGUID Table (3/9)

Computer Center, CS, NCTU 8 aware OSes: check the protective MBR protectivetheOSes:check aware - A single of 0xEE type partition A single space noempty type, UnknownGPT disks: read cannot OSes For GPT For • • • Legacy MBR (LBA 0) (LBA MBR Legacy  GUID PartitionGUID Table (4/9)

Computer Center, CS, NCTU 9 byte byte LBA) - meaning meaning 92 bytes) 1) - ) 5C 005C 00 00 UNIXes Contents on UUID (in bytes, usually ", 45 46 49 20 50 41 5220 4546 50 54) ", 49 41 zero forpartitions (primary 1) + partition table last LBA little endian (location thisof header copy) (location theof other header copy) EFI EFI PART LBA (secondary partition table first LBA LBA ) of header (0 to header size), with this field zeroed during calculation Size a partitionof entry (usually 128) of partition CRC32 array Reserved; must be zeroes forthe rest of the block (420 bytes for a 512 Current LBA Backup LBA First usable LBA Last usable (also Disk GUID referred as (always 2 in Partition primary copy) entries starting LBA Number of partition entries Signature (" version Revision1.0 (through (For at least GPT versionUEFI 2.3.1), the value is 000100 00 Header size in CRC32 Reserved; must be * bytes 8 bytes 4 bytes 4 bytes 4 bytes 8 bytes 8 bytes 4 bytes 4 bytes 8 bytes 8 bytes 4 bytes 4 bytes 8 bytes Length 16 GPT header (LBA 1) (LBA header GPT 8 0 92 72 80 84 88 40 48 56 16 20 24 32 12  GUID PartitionGUID Table (5/9) Offset

Computer Center, CS, NCTU 10 hd =512 count=1 skip=1 | skip=1 =512 count=1 bs /ada0 dev if=/ d d • GPT header (LBA 1) (LBA header GPT  GUID PartitionGUID Table (6/9)

Computer Center, CS, NCTU 11 only) - codeunits) 16LE - Total Contents UTF /9) endian) 7 - (36 GUID (little (inclusive, usually odd) usually(inclusive, Partition typePartition GUID Unique partition LBA First LastLBA 60 denotes(e.g.readflags bitAttribute name Partition bytes 8 bytes8 bytes8 8 bytes8 72 bytes72 16 bytes16 bytes16 Length 128 0 40 48 56 16 32 Offset Partition entries (LBA 2) (LBA entries Partition  GUID PartitionGUID Table (

Computer Center, CS, NCTU 12 001560B84F0F - 00022D09712B 00022D09712B 00022D09712B 00022D09712B 00022D09712B - - - - - BE0B 8FF8 8FF8 8FF8 8FF8 8FF8 ------11D6 11DC 11D6 11D6 11D6 11D6 ------7F41 6ECF - 6ECF 6ECF 6ECF 6ECF - - - - - 516E7CB8 516E7CBA 83BD6B9D 516E7CB4 516E7CB5 516E7CB6 vinum boot swap ufs - - - - - Partition type GUID type Partition freebsd freebsd freebsd freebsd freebsd  GUID PartitionGUID Table (8/9)

Computer Center, CS, NCTU 13 boot swap zfs - - - hd freebsd freebsd freebsd =512 count=1 skip=2 | skip=2 =512 count=1 bs /ada0 dev if=/ • Partition entries (LBA 2) (LBA entries Partition  GUID PartitionGUID Table (9/9)

Computer Center, CS, NCTU 14