Displaying tape information
Use the lstape command to display summary information about your tape devices, or read tape information from sysfs.
Alternatively, you can read tape information from sysfs. Each physical tape device is represented in a sysfs directory of the form
/sys/bus/ccw/devices/<device_bus_id>
where <device_bus_id> is the device bus-ID that corresponds to the physical tape device. This directory contains a number of attributes with information about the physical device. The attributes: blocksize, state, operation, and medium_state, might not show the current values if the device is offline.
Attribute | Explanation |
---|---|
online | 1 if the device is online or 0 if it is
offline (see Setting a tape device online or offline) |
cmb_enable | 1 if channel measurement block is enabled for the physical
device or 0 if it is not enabled (see Channel measurement facility) |
cutype | Type and model of the control unit |
devtype | Type and model of the physical tape device |
blocksize | Currently used block size in bytes or 0 for auto |
state | State of the physical tape device, either of:
|
operation | The current tape operation, for example:
|
medium_state | The current state of the tape cartridge:
|
Procedure
Issue a command of this form to read an attribute:
# cat /sys/bus/ccw/devices/<device_bus_id>/<attribute>
where
<attribute> is one of the attributes of Table 1.Example
The following lstape command displays information about a tape device with bus
ID 0.0.015f:
# lstape 0.0.015f --ccw-only
TapeNo BusID CuType/Model DevType/Model BlkSize State Op MedState
2 0.0.015f 3480/01 3480/04 auto UNUSED --- LOADED
This sequence of commands reads the same information from sysfs:
# cat /sys/bus/ccw/devices/0.0.015f/online
1
# cat /sys/bus/ccw/devices/0.0.015f/cmb_enable
0
# cat /sys/bus/ccw/devices/0.0.015f/cutype
3480/01
# cat /sys/bus/ccw/devices/0.0.015f/devtype
3480/04
# cat /sys/bus/ccw/devices/0.0.015f/blocksize
0
# cat /sys/bus/ccw/devices/0.0.015f/state
UNUSED
# cat /sys/bus/ccw/devices/0.0.015f/operation
---
# cat /sys/bus/ccw/devices/0.0.015f/medium_state
1