read_lba(9)
πΈ read_lba(9) β the Kernel API Manual glow-up πΈ
okay bestie, welcome to read_lba(9) from the Kernel API Manual, aka the little function that goes and grabs raw bytes off your disk starting at an LBA you pick. it's giving "backstage pass to the partition table" energy and honestly? we're obsessed. π
β¨ NAME β¨
read_lba β Read bytes from disk, starting at given LBA π«Ά
β¨ SYNOPSIS β¨
size_t read_lba (struct parsed_partitions *state , u64 lba , u8 *buffer
, size_t count );
like, that's the whole vibe. four args, one size_t coming back at you. no cap. β¨
π ARGUMENTS π
stateβ the disk parsed partitions, i.e. the whole situation you're working with πlbaβ the Logical Block Address of the partition table. yes the exact one. main character address energy πbufferβ destination buffer. this is where the bytes are gonna live rent-free π¦countβ bytes to read. how many. be normal about it π
π DESCRIPTION π
so here's the tea: read_lba reads count bytes from state->disk into buffer. that's it, that's the function.
Returns number of bytes read on success, 0 on error. so if you get a 0 back, that's not a slay, that's a <red>nope</red>. π
lowkey important: 0 means error here, not "read zero bytes, everything's chill." the vibe check is not passing if you see a zero, bestie. π
π SEE ALSO π
Kernel file ./block/partitions/efi.c β and the whole friend group:
efi_crc32(9)last_lba(9)is_pmbr_valid(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)efi_partition(9)
like literally the entire GPT squad, all here, all iconic. iykyk π β¨
mwah π β this page lives in ./block/partitions, stamped October 2026, and yes it's still read_lba(9). go read some bytes, bestie, you got this. π§π
π¦ 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