last_lba(9)
okay bestie, welcome to last_lba(9) from the Kernel API Manual π«Άβ¨ sheβs a tiny helper with main-character energy, and hereβs the whole vibe.
πΈ NAME πΈ
last_lba β return number of last logical block of device π
β¨ SYNOPSIS β¨
u64 last_lba (struct gendisk *disk );
π ARGUMENTS π
diskβ block device. thatβs the one, bestie π«Ά
π DESCRIPTION π
Returns last LBA value on success, 0 on error. no cap π
This is stored (by sd and ide-geometry) in the part[0] entry for this disk, and is the number of physical sectors available on the disk. literally the whole point π
β¨
π¦ SEE ALSO π¦
Kernel file ./block/partitions/efi.c β plus the whole squad:
efi_crc32(9)is_pmbr_valid(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)efi_partition(9)
source/version line is ./block/partitions, dated October 2026, and this whole thing is the last_lba(9) page. byeee, go read your GPTs ππ
π¦ 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