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 attach sg to LUN 0 that reports PQ=3
  • -c β€” turns on scanning of channels 0 1. [default: 0 / all detected ones]
  • --channels=CLIST β€” only scans the channel(s) in CLIST
  • --color β€” gives you coloured prefixes OLD/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) in HLIST
  • --ids=TLIST β€” only scans the target ID(s) in TLIST
  • --ignore-rev β€” ignores a (firmware) revision change. for the curious: that's the third text field (4 bytes long) in a standard INQUIRY response. iykyk
  • -i, --issue-lip β€” issues a FibreChannel LIP reset. [default: disabled]
  • -I SECS, --issue-lip-wait=SECS β€” issues a FibreChannel LIP reset, then waits SECS seconds πŸ•°οΈ
  • -L NUM β€” activates scanning for LUNs 0–NUM. [default: 0]
  • -l β€” activates scanning for LUNs 0–7. [default: 0]
  • --largelun β€” tells the kernel to support LUNs > 7 even on SCSI2 devs
  • --luns=NLIST β€” only scans the lun(s) in NLIST
  • -m, --multipath β€” updates multipath devices. [default: disabled]
  • --no-lip-scan β€” doesn't scan FC Host when the --issue-lip option is also given.
  • --nooptscan β€” doesn't stop looking for LUNs is 0 is 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 try REPORT_LUN even 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's 0. [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 form YYYYMMDD ⭐
  • -w, --wide β€” scans for target device IDs 0–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 πŸ”₯


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