Displaying information about SCSI devices

Red Hat Enterprise Linux 8.6 LPAR mode z/VM guest

For each SCSI device, there is a number of read-only attributes in sysfs that provide information for the device.

About this task

Table 1 summarizes the read-only attributes for manually configured FCP LUNs, including those attributes that indicate whether the device access is restricted by access control software on the FCP channel. These attributes can be found in the zfcp branch of sysfs. The path has the form:
/sys/bus/ccw/drivers/zfcp/<device_bus_id>/<wwpn>/<fcp_lun>/<attribute>
Table 1. Attributes of manually configured FCP LUNs with device access information
Attribute Explanation
access_denied Flag that indicates whether access to the device is restricted by the FCP channel.

The value is 1 if access is denied and 0 if access is permitted.

If access is denied to your Linux instance, confirm that your SCSI devices are configured as intended. Also, be sure that you really want to share a SCSI device. For shared access to a SCSI device, preferably use NPIV). You might also use different FCP channels or target ports.

access_shared This attribute is obsolete. The value is always 0.
access_readonly This attribute is obsolete. The value is always 0.
in_recovery Shows if unit is in recovery (0 or 1)
Table 2 lists further read-only attributes with information about the SCSI device. These attributes can be found in the SCSI branch of sysfs. The path has the form:
/sys/class/scsi_device/<device_name>/device/<attribute>
Table 2. SCSI device class attributes
Attribute Explanation
device_blocked Flag that indicates whether the device is in blocked state (0 or 1).
iocounterbits The number of bits used for I/O counters.
iodone_cnt The number of completed or rejected SCSI commands.
ioerr_cnt The number of SCSI commands that completed with an error.
iorequest_cnt The number of issued SCSI commands.
model The model of the SCSI device, received from inquiry data.
rev The revision of the SCSI device, received from inquiry data.
scsi_level The SCSI revision level, received from inquiry data.
type The type of the SCSI device, received from inquiry data.
vendor The vendor of the SCSI device, received from inquiry data.
zfcp_access_denied Flag that indicates whether access to the device is restricted by the FCP channel.

The value is 1 if access is denied and 0 if access is permitted.

If access is denied to your Linux instance, confirm that your SCSI devices are configured as intended. Also, be sure that you really want to share a SCSI device. For shared access to a SCSI device, preferably use NPIV). You might also use different FCP channels or target ports.

zfcp_in_recovery Shows if unit is in recovery (0 or 1).

Procedure

Use the lszfcp command to display information about the associated SCSI device.
Alternatively, you can use sysfs to read the information. To read attributes of the associated SCSI device, use a command of this form:
# cat /sys/class/scsi_device/<device_name>/device/<attribute>
where:
<device_name>
is the name of the associated SCSI device.
<attribute>
is one of the attributes in Table 2.
Tip: For SCSI-attached tape devices, you can display a summary of this information by using the lstape command.

Examples

  • In this example, information is displayed for a manually configured FCP LUN with LUN 0x4010403200000000 that is accessed through a target port with WWPN 0x500507630300c562 and is attached through an FCP device 0.0.3d0c. For the device, access is permitted.
    # cat /sys/bus/ccw/drivers/zfcp/0.0.3d0c/0x500507630300c562/0x4010403200000000/access_denied
    0

    For the device to be accessible, the access_denied attribute of the target port, 0x500507630300c562, must also be 0 (see Displaying port information).

  • You can use lszfcp to display attributes of a SCSI device. The example shows the attributes listed in Table 2 as well as other relevant attributes:
    # lszfcp -l 0x4010403200000000 -a
    0.0.3d0c/0x500507630300c562/0x4010403200000000 0:0:0:1077035024
    Class = "scsi_device"
        ...
        device_blocked      = "0"
        ...
        iocounterbits       = "32"
        iodone_cnt          = "0xbe"
        ioerr_cnt           = "0x2"
        iorequest_cnt       = "0xbe"
        ...
        model               = "2107900"
        queue_depth         = "32"
        queue_ramp_up_period = "120000"
        ...
        rev                 = ".166"
        scsi_level          = "6"
        state               = "running"
        timeout             = "30"
        type                = "0"
        uevent              = "DEVTYPE=scsi_device"
        vendor              = "IBM"
        ...
        zfcp_access_denied  = "0"
        zfcp_failed         = "0"
        zfcp_in_recovery    = "0"
        zfcp_status         = "0x54000000"