Rescan SCSI Bus to Add or Remove a SCSI Devices on Linux

Rescan SCSI bus

When you need to add a hard disk or network interface cards on the new VMware virtual machine on the production server, but you are not allowed to shutdown the server or you have several related issues as below. The following quick article shows how to rescan SCSI Bus to add or remove a SCSI Devices on Linux.

This steps may work on CentOS 5/6/7 and RHEL 5/6/7.

Other related Issues

  • Is it possible to add or remove a SCSI device without rebooting a running system?
  • Can you scan a SCSI bus for new or missing SCSI devices without rebooting?
  • How can I make newly connected SCSI storage devices available without rebooting?
  • What is the Linux equivalent to the Solaris command devfsadm to add or remove storage devices?
  • I am trying to add a LUN to a live system but it is not recognized
  • I am trying to add a tape drive to a live system but it is not recognized
  • I am trying to add a disk drive to a live system but it is not recognized
  • How can I force a rescan of my SAN to find newly associated LUNs?
  • What to do if a newly allocated LUN on my SAN is not available?
  • Unable to probe for a newly allocated LUN
  • Some nodes can’t see my new storage device, how can I make it available?
  • After SAN maintenance activity, not all devices returned – devices in multipath missing or remain in failed state.
  • After SAN failover testing completed, not all devices returned to running state as expected – devices in multipath missing or remain in failed state.
  • What is the best way to remove a SCSI disk from the system

After Red Hat Enterprise Linux 5.0 (RHEL 5) and above (RHEL 6 and RHEL 7), it is possible to make changes to the SCSI I/O subsystem without rebooting.

How to Rescan SCSI Bus to Add or Remove a SCSI Devices on Linux

1. Identify host bus number :

# ls /sys/class/scsi_host/
host0  host1  host2

2. Rescan the SCSI Bus to Add a SCSI Devices :

# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "- - -" > /sys/class/scsi_host/host1/scan
# echo "- - -" > /sys/class/scsi_host/host2/scan

Reference :

  • https://access.redhat.com/solutions/3941
  • https://blogs.it.ox.ac.uk/oxcloud/2013/03/25/rescanning-your-scsi-bus-to-see-new-storage/
  • http://fibrevillage.com/storage/279-hot-add-remove-rescan-of-scsi-devices-on-linux