Controlling the SCSI device state
You can use the state
attribute of the
SCSI device to set a SCSI device back online if it was set offline
by error recovery.
Before you begin
About this task
If the connection to a storage system is working but
the storage system has a problem, the error recovery
might set the SCSI device offline. This condition is indicated
by a message like Device offlined - not ready after error recovery
.
To
find out the current state of the device, read the state
attribute:
# cat /sys/bus/scsi/devices/<scsi_host_no>:0:<scsi_id>:<scsi_lun>/state
where:
- <scsi_host_no>
- is the SCSI host number that corresponds to the FCP device.
- <scsi_id>
- is the SCSI ID of the target port.
- <scsi_lun>
- is the LUN of the SCSI device.
- running
- The SCSI device can be used for running regular I/O requests.
- cancel
- The data structure for the device is being removed.
- deleted
- Follows the
cancel
state when the data structure for the device is being removed. - quiesce
- No I/O requests are sent to the device, only special requests for managing the device. This state is used when the system is suspended.
- offline
- Error recovery for the SCSI device failed.
- blocked
- Error recovery is in progress and the device cannot be used until the recovery process is completed.
To set an offline device online again, write running to the state attribute.
Procedure
Issue a command of this form:
# echo running > /sys/bus/scsi/devices/<scsi_host_no>:0:<scsi_id>:<scsi_lun>/state
Example
In the following example, SCSI device 1:0:18:1086537744 is offline and is then set online again:
# cat /sys/bus/scsi/devices/1:0:18:1086537744/state
offline
# echo running > /sys/bus/scsi/devices/1:0:18:1086537744/state