For Fibre Channel storage devices, certain commands allow you to reset, scan, or both reset and scan one or more interconnects, which potentially adds and removes multiple devices in one operation. However, this type of scan can be disruptive, as it can cause delays while I/O operations timeout, and remove devices unexpectedly.

Red Hat recommends using interconnect scanning only when necessary.

Observe the following restrictions when scanning storage interconnects:

All I/O on the effected interconnects must be paused and flushed before executing the procedure, 
and the results of the scan checked before I/O is resumed.
As with removing a device, interconnect scanning is not recommended when the system is under
memory pressure. To determine the level of memory pressure, run the vmstat 1 10 0 command.
Interconnect scanning is not recommended if free memory is less than 5% of the total memory in
more than 10 samples per 100. Also, interconnect scanning is not recommended if swapping is
active (non-zero si and so columns in the vmstat output).
The following commands can be used to scan storage interconnects:
echo "1" > /sys/class/fc_host/host/issue_lip
This operation performs a Loop Initialization Protocol (LIP), scans the interconnect, and causes
the SCSI layer to be updated to reflect the devices currently on the bus. Essentially,
an LIP is a bus reset, and causes device addition and removal.

This procedure discussed below is necessary to configure a new SCSI target on a Fibre Channel interconnect.
Note that issue_lip is an asynchronous operation. The command can complete before the entire scan has completed. You must monitor /var/log/messages to determine when issue_lip finishes.
The lpfc, qla2xxx, and bnx2fc drivers support issue_lip.
/usr/bin/rescan-scsi-bus. sh
The /usr/bin/rescan-scsi-bus. sh script was introduced in Red Hat Enterprise Linux 5.4. By default, this script scans all the SCSI buses on the system, and updates the SCSI layer to reflect new devices on the bus. The script provides additional options to allow device removal, and the issuing of LIPs.

echo "- - -" > /sys/class/scsi_host/hostth/scan

In this case, however, the channel number, SCSI target ID , and LUN values are replaced by wildcards. Any combination of identifiers and wildcards is allowed, so you can make the command as specific or broad as needed. This procedure adds LUNs, but does not remove them.

modprobe --remove driver-name; modprobe driver-name

Running the modprobe --remove driver-name command followed by the modprobe driver-name command completely re-initializes the state of all interconnects controlled by the driver.

Despite being rather extreme, using the described commands can be appropriate in certain situations. The commands can be used, for example, to restart the driver with a different module parameter value.

Comments powered by CComment