sd_format_disk_name(9)
π sd_format_disk_name β the Kernel API Manual glow-up π
okay so bestie, this is a page from the Kernel API Manual, and it's about the little function that literally names your SCSI disks. yes, the sda, sdb... sdaa girlies. she's iconic, she's tiny, she's doing base-26 math in a trench coat. π
β¨ NAME β¨
sd_format_disk_name β format disk name π
β¨ SYNOPSIS β¨
int sd_format_disk_name (char *prefix , int index , char *buf , int
buflen );
that's the whole vibe right there. π«Ά
β¨ ARGUMENTS β¨
prefixβ the name prefix, like, the starter pack of the name. the manpage's example is"sd"for SCSI disks. πindexβ the index of the disk you want to format a name for, i.e. which number in the lineup she is.bufβ the output buffer. this is where the finished name gets dropped. β¨buflenβ the length of the output buffer, bestie. gotta know how much room you have.
β¨ DESCRIPTION β¨
okay so SCSI disk names start at sda. π
the 26th device is sdz, and the 27th is sdaa. the last one with a two-lettered suffix is sdzz, and after that comes sdaaa. the way she just keeps going... main character energy fr fr. π
this is basically 26 base counting with one extra 'nil' entry at the beginning, starting from the second digit on. and it can be determined using a similar method as 26 base conversion, with the index shifted -1 after each digit is computed. no cap, that's the actual algorithm described here. π§
β¨ CONTEXT β¨
"Don't care." π that's it. that's the whole context section. she said not my problem, and honestly? respect. π
β¨ RETURN β¨
0on success πΈ-errnoon failure π
β¨ SEE ALSO β¨
before you go, the kernel file is at ./drivers/scsi/sd.c and she's got a whole friend group β go say hi to:
sd_group_number(9), sd_open(9), sd_release(9), sd_ioctl(9), sd_check_events(9), sd_eh_reset(9), sd_eh_action(9), sd_done(9), sd_read_block_provisioning(9), sd_read_cpr(9), sd_revalidate_disk(9), sd_unlock_native_capacity(9), sd_probe(9), sd_remove(9), init_sd(9), exit_sd(9) π₯
and that's the whole page, bestie! this one's hanging out under ./drivers/scsi, dated October 2026, and yeah β she's still sd_format_disk_name(9) in the Kernel API Manual. periodt. ππ¦
π¦ 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