scsi_scan_target(9)
π scsi_scan_target(9) β from the Kernel API Manual, bestie
Okay so picture this: you're deep in <pink>drivers/scsi</pink> land and you need to go find a target id and everything chillin' on it. That's this function. It's the little gremlin that goes snooping. Let's get into it π
β¨ NAME β¨
scsi_scan_target β go scan a target id, and honestly possibly all the LUNs sitting on that target too π
β¨ SYNOPSIS β¨
void scsi_scan_target (struct device *parent , unsigned int channel ,
unsigned int id , u64 lun , enum scsi_scan_mode rescan );
Like yes it returns void, no it's not gonna hand you a result, it just does the thing and dips π«Ά
β¨ ARGUMENTS β¨
parentβ the host you're scanning. Your main character device, basically πchannelβ the channel you're scanning. Pick your lane bestie πidβ the target id you're scanning. The actual one we came here for πlunβ either one specific LUN to scan, orSCAN_WILD_CARDif you're feeling unhinged and want the whole menu πrescanβ this one gets passed straight down to the LUN scanning routines, so it's like the vibe you're sending:SCSI_SCAN_INITIALβ no rescan, fresh start, first-day-of-school energy πSCSI_SCAN_RESCANβ rescan the LUNs that already exist, we're going back in πSCSI_SCAN_MANUALβ force scanning even ifβ¦ β¨
fr fr the original page just stops right there after "even if". No cap, it cliffhangs. I'm not about to invent the rest for you π that's above my pay grade.
β¨ DESCRIPTION β¨
So what it's actually doing: scanning the target id on parent, on that channel, and that id. It scans at least LUN 0 β LUN 0 is the bare minimum, the non-negotiable, the entry-level icon β and possibly all the LUNs on the target id if things go that way πΈ
The strategy, in order, because of course there's an order:
- First it tries a REPORT LUN scan. Efficient queen. β¨
- If that doesn't scan the target, it falls back to a sequential scan of the LUNs on the target id. Old school but it gets the job done πͺ
So it's giving "try the smart way first, brute-force it second." Iconic behavior tbh.
β¨ SEE ALSO β¨
Kernel file ./drivers/scsi/scsi_scan.c β and the whole extended friend group π
scsi_complete_async_scans(9)scsi_unlock_floptical(9)scsi_alloc_sdev(9)scsi_target_reap_ref_release(9)scsi_alloc_target(9)scsi_target_reap(9)scsi_sanitize_inquiry_string(9)scsi_probe_lun(9)scsi_add_lun(9)scsi_inq_str(9)scsi_probe_and_add_lun(9)scsi_sequential_lun_scan(9)scsi_report_lun_scan(9)scsi_add_device(9)scsi_prep_async_scan(9)scsi_finish_async_scan(9)scsi_scan_host(9)scsi_get_pseudo_sdev(9)
And that's the whole page bestie!! π¦ Coming at you live from ./drivers/scsi, dated October 2026 β so yeah, mark your calendar, this manpage is from the future πβ¨ mwah, go scan something responsibly π
π¦ 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