is_gpt_valid(9)
π NAME π
okay so we're deep in the Kernel API Manual, and today's main character is is_gpt_valid(9) β it tests one GPT header and PTEs for validity. that's the whole assignment, bestie: one GPT header + PTEs, validity check, slay. β¨
β¨ SYNOPSIS β¨
int is_gpt_valid (struct parsed_partitions *state , u64 lba , gpt_header
**gpt , gpt_entry **ptes );
π ARGUMENTS π
stateβ the disk's parsed partitions, aka thestruct parsed_partitions *statesituation. π«Άlbaβ logical block address of the GPT header to test. yep, that exact header. πgptβ GPT header ptr, filled on return. so it'sgpt_header **gpt, and it gets filled when the function comes back. πptesβ PTEs ptr, filled on return. that'sgpt_entry **ptes, also filled on return. π
π¦ DESCRIPTION π¦
returns 1 if valid, 0 on error. no cap. π₯
If valid, it returns pointers to newly allocated GPT header and PTEs. that's the win condition, and it's giving "here are your fresh pointers, bestie." π
heads up:1means valid,0means error β don't flip it, iykyk. π
π SEE ALSO π
Kernel file ./block/partitions/efi.c is right there in the group chat, and these besties are also linked:
efi_crc32(9)last_lba(9)is_pmbr_valid(9)read_lba(9)alloc_read_gpt_entries(9)alloc_read_gpt_header(9)is_pte_valid(9)compare_gpts(9)find_valid_gpt(9)utf16_le_to_7bit(9)efi_partition(9)
cute sign-off: this page came from ./block/partitions β October 2026 edition β and yes, it ate. π
β¨π
π¦ 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