Monday, October 1, 2012

Rescan the SCSI bus w/out rebooting

To add or remove a SCSI device explicitly, or to re-scan an entire SCSI bus without rebooting a running system:



Red Hat Enterprise Linux 4 or 5:

To rescan an entire SCSI bus and re-register all devices found:
When dealing with fibre attached storage, it is necessary to issue a LIP (loop initialization primitive) on the fabric:
shell> echo "1" > /sys/class/fc_host/host#/issue_lip

Replace the “#” with the number of the SCSI bus to be rescanned.

Note: Issueing a LIP (above) on Red Hat Enterprise Linux 5 is all that is needed to rescan fibre
attached storage. Once the LIP is issued, the bus scan may take a few seconds to complete.

To rescan all other SCSI attached storage, a rescan should be issued:
shell> echo "- - -" > /sys/class/scsi_host/host#/scan

Replace the “#” with the number of the SCSI bus to be rescanned.

In addition to re-scanning the entire bus, a specific device can be added or deleted for some versions or Red Hat Enterprise Linux as specified below.

Red Hat Enterprise Linux 4 or 5:

To remove a single existing device explicitly
shell> echo 1 > /sys/block//device/delete

Red Hat Enterprise Linux 3 or 4:

To add a single device explicitly:
shell> echo "scsi add-single-device    " > /proc/scsi/scsi
To remove a device explicitly:
shell> echo "scsi remove-single-device    " > /proc/scsi/scsi
Where are the host, bus, target, and LUN numbers for the device,as reported in /sys (2.6 kernels only) or /proc/scsi/scsi or dmesg. These numbers are sometimes refered to as “Host”, “Channel”, “Id”, and “Lun” in Linux tool output and documentation.

No comments:

How to use DiskSpd to simulate Veeam Backup & Replication disk actions

This HOW-TO contains information on how to use Microsoft© DiskSpd to simulate Veeam Backup & Replication disk actions to measure disk pe...