is_pmbr_valid(9)
π is_pmbr_valid(9)
okay so this one lives in the Kernel API Manual bestie, and it's literally called is_pmbr_valid β aka "test Protective MBR for validity" π
β¨ SYNOPSIS β¨
int is_pmbr_valid (legacy_mbr *mbr , sector_t total_sectors );
π«Ά ARGUMENTS π«Ά
mbrβ a pointer to alegacy_mbrstructure. yeah. one of those. πΈtotal_sectorsβ how many sectors the device has. that's the whole vibe, that's the size. β¨
π¦ DESCRIPTION π¦
so what it does: it checks for a valid protective or hybrid master boot record (MBR). and the way the validity of a pMBR works? it depends on all of the following, no shortcuts, no "close enough" π
- the MSDOS signature is sitting in the last two bytes of the MBR π₯
- one partition of type
0xEEis found π
and then, bonus round: a hybrid MBR will also have up to three additional primary partitions, and those point to the same space that's marked out by up to three GPT partitions. iykyk π
it returns 0 upon an invalid MBR, or GPT_MBR_PROTECTIVE or GPT_MBR_HYBRID depending on the device layout. that's the whole mood. β
π SEE ALSO π
kernel file ./block/partitions/efi.c, plus efi_crc32(9), last_lba(9), read_lba(9), alloc_read_gpt_entries(9), alloc_read_gpt_header(9), is_gpt_valid(9), is_pte_valid(9), compare_gpts(9), find_valid_gpt(9), utf16_le_to_7bit(9), and efi_partition(9) β go read them, bestie, they're all right there π
ngl this page is filed under ./block/partitions and dated October 2026 β screenshot it, cite it, whatever, slay π§ π
π¦ 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