Editing /usr/bin/rescan-scsi-bus.sh

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
<code>/usr/bin/rescan-scsi-bus.sh</code><ref>https://github.com/hreinecke/sg3_utils/blob/master/scripts/rescan-scsi-bus.sh</ref> included in <code>[[sg3-utils]]</code> package.
+
<code>rescan-scsi-bus.sh</code><ref>https://github.com/hreinecke/sg3_utils/blob/master/scripts/rescan-scsi-bus.sh</ref> included in <code>[[sg3-utils]]</code> package.
:https://raw.githubusercontent.com/hreinecke/sg3_utils/master/scripts/rescan-scsi-bus.sh
+
:<code>rescan-scsi-bus.sh -h</code>  
* <code>rescan-scsi-bus.sh -h</code>
 
* <code>rescan-scsi-bus.sh --alltargets</code>
 
* <code>rescan-scsi-bus.sh --remove</code>
 
  
== Discover new [[block devices]]: rescan-scsi-bus.sh -a ==
 
 
<pre>
 
<pre>
 
rescan-scsi-bus.sh --alltargets or rescan-scsi-bus.sh -a
 
rescan-scsi-bus.sh --alltargets or rescan-scsi-bus.sh -a
Line 30: Line 26:
 
0 device(s) removed.
 
0 device(s) removed.
 
</pre>
 
</pre>
You may need to execute: <code>multipath -f</code> (flush) to remove unused devices and [[pvresize]] if your [[LUN]] has changed size.
+
 
  
 
:<code>rescan-scsi-bus.sh -i --issue-[[lip]]</code>
 
:<code>rescan-scsi-bus.sh -i --issue-[[lip]]</code>
  
 +
== Remove ==
 +
:<code>rescan-scsi-bus.sh --remove</code> or <code>rescan-scsi-bus.sh -r</code>
 
<pre>
 
<pre>
Scanning for device 32 0 0 0 ...
 
OLD: Host: scsi32 Channel: 00 Id: 00 Lun: 00
 
      Vendor: VMware  Model: Virtual disk    Rev: 2.0
 
      Type:  Direct-Access                    ANSI SCSI revision: 06
 
Scanning for device 32 0 1 0 ...
 
NEW: Host: scsi32 Channel: 00 Id: 01 Lun: 00
 
      Vendor: VMware  Model: Virtual disk    Rev: 2.0
 
      Type:  Direct-Access                    ANSI SCSI revision: 06
 
1 new or changed device(s) found.
 
[32:0:1:0]
 
0 remapped or resized device(s) found.
 
0 device(s) removed.
 
</pre>
 
 
== Remove block devices: rescan-scsi-bus.sh --remove  ==
 
<pre>
 
View current block devices: lsblk or lsscsi
 
rescan-scsi-bus.sh --remove or rescan-scsi-bus.sh -r
 
 
 
sg10 changed: LU not available (PQual 1)
 
sg10 changed: LU not available (PQual 1)
 
REM: Host: scsi3 Channel: 00 Id: 00 Lun: 07
 
REM: Host: scsi3 Channel: 00 Id: 00 Lun: 07
Line 62: Line 41:
 
4 device(s) removed.
 
4 device(s) removed.
  
View block devices after command execution: lsblk or lsscsi
 
  
 
multipath -ll
 
multipath -ll
Line 69: Line 47:
 
</pre>
 
</pre>
  
== Related commands ==
+
Related commands: <code>[[blkid]]</code> <code>[[multipath -f]]</code> <code>[[multipath -w]]</code> <code>[[pvcreate]]</code>
* <code>[[blkid]]</code>, <code>[[multipath -f]]</code>, <code>[[multipath -w]]</code>, <code>[[pvcreate]]</code>
+
 
* [[LVM scan commands]]
 
  
 
== Activities ==
 
== Activities ==
# Understand differences between <code>[[pvscan]]</code> which list all physical volumes and <code>[[rescan-scsi-bus.sh]]</code>
+
# Understand differences between <code>[[pvscan]]</code> which list all physical volumes and [[rescan-scsi-bus.sh]]
 
# Read Change log: https://github.com/hreinecke/sg3_utils/blob/master/scripts/rescan-scsi-bus.sh
 
# Read Change log: https://github.com/hreinecke/sg3_utils/blob/master/scripts/rescan-scsi-bus.sh
# [[Add a new disk]]
 
  
 
== See also ==
 
== See also ==
* {{HBA}}
 
 
* {{Linux block devices}}
 
* {{Linux block devices}}
 
* {{Linux Fibre Channel}}
 
* {{Linux Fibre Channel}}

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: