read_lba(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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:

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