alloc_read_gpt_header(9)
β¨ NAME β¨
alloc_read_gpt_header β this is the lil' function that grabs a GPT header for you and reads it straight off the disk, bestie π (it's living over in the Kernel API Manual, iykyk)
πΈ SYNOPSIS πΈ
gpt_header * alloc_read_gpt_header (struct parsed_partitions *state ,
u64 lba );
Like, that's the whole vibe check right there π
π ARGUMENTS π
stateβ the disk's parsed partitions π«Ά (yes, thestruct parsed_partitions *one)lbaβ the Logical Block Address of the partition table, aka where on the disk we're looking π₯
π¦ DESCRIPTION π¦
okay so: on success you get the GPT header back, and on error you get NULL. No in-between, no maybes π
It allocates and fills a GPT header starting at β¦ (not me, the manpage literally drops the placeholder here π) from state->disk.
β NOTE β
π¨ reminder bestie: remember to free the gpt when you're finished with it. No leaking, that's not the vibe. periodt. π
π SEE ALSO π
Kernel file ./block/partitions/efi.c, and the whole friend group:
efi_crc32(9)last_lba(9)is_pmbr_valid(9)read_lba(9)alloc_read_gpt_entries(9)is_gpt_valid(9)is_pte_valid(9)compare_gpts(9)find_valid_gpt(9)utf16_le_to_7bit(9)efi_partition(9)
mwah π this lil' page came from ./block/partitions and it's dated October 2026 β screenshot it, cite it, put it on your fridge, it's iconic πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms