RESCAN-SCSI-BUS.SH(8)
π RESCAN-SCSI-BUS.SH(8) β like, the actual man page bestie
okay so real talk: this is rescan-scsi-bus.sh, living in the User Commands section of the manual, and it's the script that lets you add and remove SCSI devices without rebooting. no cap. no β¨turn it off and on againβ¨ energy required.
πΈ 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, type it exactly, bestie β every bracket matters π
β¨ OPTIONS β¨
quick heads-up from the script itself: options are ordered by their long name. and the ones with no long name? they get ordered as if their single letter was a long name. iconic little sorting rule tbh.
-a,--alltargetsβ scans all the targets, not just the ones that currently exist. [default: disabled]--attachpq3β tells the kernel to attachsgto LUN 0 that reportsPQ=3-cβ turns on scanning of channels0 1. [default:0/ all detected ones]--channels=CLISTβ only scans the channel(s) inCLIST--colorβ gives you coloured prefixesOLD/NEW/DELπ¨ (aesthetic and functional)-dβ debug mode on. [default:0]-f,--flushβ flushes failed multipath devices. [default: disabled]--forceremoveβ removes stale devices. (DANGEROUS) π like for real for real--forcerescanβ removes and re-adds existing devices. (DANGEROUS) π same warning, same energy-h,--helpβ prints the usage message, then dips. bye π--hosts=HLISTβ only scans the host(s) inHLIST--ids=TLISTβ only scans the target ID(s) inTLIST--ignore-revβ ignores a (firmware) revision change. for the curious: that's the third text field (4bytes long) in a standardINQUIRYresponse. iykyk-i,--issue-lipβ issues a FibreChannel LIP reset. [default: disabled]-I SECS,--issue-lip-wait=SECSβ issues a FibreChannel LIP reset, then waitsSECSseconds π°οΈ-L NUMβ activates scanning for LUNs0βNUM. [default:0]-lβ activates scanning for LUNs0β7. [default:0]--largelunβ tells the kernel to support LUNs>7even on SCSI2 devs--luns=NLISTβ only scans the lun(s) inNLIST-m,--multipathβ updates multipath devices. [default: disabled]--no-lip-scanβ doesn't scan FC Host when the--issue-lipoption is also given.--nooptscanβ doesn't stop looking for LUNs is0is not found--nosyncβ doesn't issue a sync. [default: sync if remove]-r,--removeβ turns on removing of devices. [default: disabled]--reportlun2β tells the kernel to tryREPORT_LUNeven on SCSI2 devices-s,--resizeβ looks for resized disks and reloads the associated multipath devices, if applicable--sparselunβ tells the kernel to support sparse LUN numbering--syncβ issues a sync. [default: sync if remove]-t,--timeout=SECSβ timeout for testing if a device is online. the test gets skipped if it's0. [default:30(seconds)]-u,--updateβ looks for existing disks that have been remapped-V,--versionβ shows the version string, then exits. and the version string? it's a numeric datestamp of the formYYYYMMDDβ-w,--wideβ scans for target device IDs0β15. [default:0β7]
π¦ the host-number lore π¦
host numbers may thus be specified either directly on cmd line β which is deprecated, ngl β or with the --hosts=LIST parameter, which is recommended. do the recommended one bestie π
π the LIST format π
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 β zero, zilch, none π
π₯ SEE ALSO π₯
- there's a brief description right here:
https://fibrevillage.com/storage/585-rescan-scsi-bus-sh-script-for-adding-and-removing-scsi-devices-without-rebooting sg3_utilsHomepage:https://sg.danny.cz/sg
and that's the whole page, bestie β go rescan something, slay, periodt π
this has been rescan-scsi-bus.sh, dated 2026-06-01, in RESCAN-SCSI-BUS.SH(8) β source and version and date, all present and accounted for, mwah πβ¨
π¦ 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