sd_probe(9)
β¨ sd_probe(9) β¨
okay so bestie, this is from the Kernel API Manual and it's literally all about sd_probe β the function that gets called during driver initialization and whenever a new scsi device gets attached to the system. and like, it's called once for each scsi device (not just disks!) that's present. iykyk π
πΈ SYNOPSIS πΈ
int sd_probe (struct scsi_device *sdp );
π ARGUMENTS π
sdpβ pointer to device object. that's it, that's the whole vibe π«Ά
π DESCRIPTION π
so here's the tea: it returns 0 if it's successful (or if it's just not interested in this scsi device at all β like a scanner, for example). and it returns 1 when there's an error. periodt. π
π₯ NOTE π₯
okay so this function is invoked from the scsi mid-level, no cap. what it does is set up the mapping between a given <host,channel,id,lun> (which you'll find in sdp) and the new device name (like /dev/sda). more precisely, it's the block device major and minor number that gets chosen right here. iconic behavior honestly π
β οΈ assumesd_probeis not re-entrant (for time being). also think aboutsd_probeandsd_removerunning coincidentally. just... keep that in mind bestie π
π¦ SEE ALSO π¦
kernel file ./drivers/scsi/sd.c and all these iconic functions:
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_format_disk_name(9)sd_remove(9)init_sd(9)exit_sd(9)
and that's the whole page! this gem lives in ./drivers/scsi and it's dated October 2026 β 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