Is GPT aligned for 4k blocks?
Solution 1:
Yes, you're missing two things:
- The EFI partition table is not required to be 34 blocks long. The Wikipedia article is downright misleading in this respect. Per the actual specification, rather than Wikipedia, the partition table length is determined by the size of the partition table entries and the number of partition table entries. They are both variable, and their values for any individial EFI partitioned disc are stored in the EFI partition table header. 34 blocks is merely what one gets with a 128 byte partition table entry size, a block size of 512 bytes, and a partition table with 128 entries. It's the minimum size of an EFI partition table, that the specification mandates. It's not the size.
-
The first usable block doesn't have to be the first used block. (It's not a "data section", by the way.) Just because on a particular disc block #34 may be the first usable block, it is not required that a partition start there. EFI partitioning tools can align partitions to whatever rules they like. (Indeed, several, such as Apple's Disk Utility, famously do. Rod Smith's
gdisk
has a non-trivial ruleset, too.) The EFI specification doesn't mandate that partitions be aligned to the first or last usable blocks. Indeed, it doesn't even, strictly speaking, mandate that the first usable block immediately follow the primary copy of the partition table.
Solution 2:
JdeBP's response is good, but I'd like to add that in practice, most modern partitioning tools align partitions on 2048-sector (1 MiB) boundaries by default, on both MBR and GPT disks. This keeps partitions aligned properly for Advanced Format drives as well as for other drive types, such as SSDs and some types of RAID arrays that have other alignment requirements. One partial exception to this rule is OS X's Disk Utility, which tends to create an EFI System Partition (ESP) as the first partition that begins on sector 40. Disk Utility creates subsequent partitions that begin on 1 MiB boundaries, though.