RESCAN-SCSI-BUS.SH(8)
π rescan-scsi-bus.sh β like, the whole manual, but make it make sense
okay so bestie, welcome to RESCAN-SCSI-BUS.SH(8) β yes that's the manual section 8, we're in User Commands territory, and this little script is genuinely iconic. It's a script that adds and removes SCSI devices without rebooting. no reboot. none. we simply do not reboot in this house. π¦
β¨ NAME β¨
rescan-scsi-bus.sh β a script to add and remove SCSI devices without rebooting π
πΈ SYNOPSIS πΈ
rescan-scsi-bus.sh [--alltargets] [--attachpq3] [-c] [--channels=CLIST]
[--color] [-d] [--flush] [-f] [--forceremove] [--forcerescan] [--help]
[--hosts=HLIST] [--ids=TLIST] [--ignore-rev] [--issue-lip] [-i]
[--issue-lip-wait=SECS] [-I SECS] [-l] [-L NUM] [--largelun]
[--luns=LLIST] [-m] [--multipath] [--no-lip-scan] [--nooptscan]
[--nosync] [--remove] [--removelun2] [--resize] [--sparselun] [--sync]
[--timeout=SECS] [--update] [--version] [--wide] [HOST1 [HOST2 ...]]
like, that's a lot of brackets, but we move. π
π₯ OPTIONS π₯
real talk first: the options are ordered by their long name. and the ones that don't have a long name? they get ordered as if their single letter was a long name. equality, honestly. we love to see it. β¨
-a,--alltargetsβ scan all the targets, not just the ones that currently exist. [default: disabled]--attachpq3β tell the kernel to attachsgto LUN 0 that reports PQ=3. yes, that's a thing, and yes, it's fine. π«Ά-cβ turns on scanning of channels0 1. [default: 0 / all detected ones]--channels=CLISTβ scan only the channel(s) in CLIST, bestie. nobody else. π--colorβ coloured prefixesOLD/NEW/DEL, because reading is a visual experience and we deserve nice things.-dβ enable debug. [default: 0]-f,--flushβ flush failed multipath devices. [default: disabled]--forceremoveβ remove stale devices. β οΈ (DANGEROUS) like actually dangerous, bestie, don't just vibe your way into this one.--forcerescanβ remove and re-add existing devices. β οΈ (DANGEROUS) same energy, same warning.-h,--helpβ print the usage message, then exit. the classic. π--hosts=HLISTβ scan only the host(s) in HLIST.--ids=TLISTβ scan only the target ID(s) in TLIST.--ignore-revβ ignore the (firmware) revision change. it's the third text field (4 bytes long) in a standardINQUIRYresponse, iykyk. π-i,--issue-lipβ issue a FibreChannel LIP reset. [default: disabled]-I SECS,--issue-lip-wait=SECSβ issue a FibreChannel LIP reset, and then waitSECSseconds. patience is a virtue, apparently. β-L NUMβ activates scanning for LUNs0--NUM. [default: 0]-lβ activates scanning for LUNs0--7. [default: 0]--largelunβ tell the kernel to support LUNs > 7, even on SCSI2 devs. generous of us tbh.--luns=NLISTβ scan only the lun(s) in NLIST.-m,--multipathβ update multipath devices. [default: disabled]--no-lip-scanβ don't scan FC Host when the--issue-lipoption is also given.--nooptscanβ don't stop looking for LUNs if0is not found. keep going, king. π₯--nosyncβ do not issue a sync. [default: sync if remove]-r,--removeβ enables removing of devices. [default: disabled]--reportlun2β tell the kernel to tryREPORT_LUNeven on SCSI2 devices.-s,--resizeβ look for resized disks and reload the associated multipath devices, if applicable. glow-up detection π¦--sparselunβ tell the kernel to support sparse LUN numbering.--syncβ issue a sync. [default: sync if remove]-t,--timeout=SECSβ timeout for testing if the device is online. the test is skipped if0. [default: 30 (seconds)]-u,--updateβ look for existing disks that have been remapped.-V,--versionβ shows the version string, then exits. and the version string is a numeric datestamp of the formYYYYMMDD. cute, right? π-w,--wideβ scan for target device IDs0--15. [default:0--7]
so host numbers may thus be specified either directly on the cmd line (deprecated π) or with the --hosts=LIST parameter (recommended π). please pick the recommended one, bestie, i'm begging.
π the LIST format, explained π
arguments to options that end in LIST (e.g. TLIST) can have this form:
A[-B][,C[-D]]...
which is a comma separated list of single values and/or ranges. and NO spaces allowed. none. zero. not even one tiny space. π
π§ SEE ALSO π§
there's a brief description here, and honestly go read it:
sg3_utils Homepage: https://sg.danny.cz/sg
# this is just a redirect, a bit like a symlink.
okay that's the whole thing!! π«Ά no cap, every flag is in there. this page is from rescan-scsi-bus.sh, dated 2026-06-01, and lives at RESCAN-SCSI-BUS.SH(8) in User Commands β go forth and rescan, you absolute main character. ππ
π¦ where this page comes from
- arch rolling: sg3_utils 1.49-1 Β· GPL-2.0-or-later AND BSD-2-Clause
- nixpkgs unstable: sg3_utils 1.49
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms