sd_probe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 πŸ‘‘

⚠️ assume sd_probe is not re-entrant (for time being). also think about sd_probe and sd_remove running coincidentally. just... keep that in mind bestie 😭

πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./drivers/scsi/sd.c and all these iconic functions:


and that's the whole page! this gem lives in ./drivers/scsi and it's dated October 2026 β€” slay πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from