Displaying tape information

7.1 LPAR mode z/VM guest

Use the lstape command to display summary information about your tape devices, or read tape information from sysfs.

Each 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 tape device. This directory contains a number of attributes with information about the device. The attributes: blocksize, state, operation, and medium_state, might not show the current values if the device is offline.

Table 1. Tape device attributes
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 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 tape device
blocksize Currently used record size in bytes or 0 for auto
state State of the tape device, either of:
UNUSED
The device is not in use and is available to any operating system image in a shared environment.
IN_USE
The device is being used by a process on this Linux® instance.
OFFLINE
The device is offline.
NOT_OP
Device is not operational.
operation The current tape operation, for example:
---
No operation
WRI
Write operation
RFO
Read operation
MSN
Medium sense
Several other operation codes exist, for example, for rewind and seek.
medium_state The current state of the tape cartridge:
1
Cartridge is loaded into the tape device
2
No cartridge is loaded
0
The tape device driver does not have information about the current cartridge state

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   3490/54      3490/54         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
3490/54
# cat /sys/bus/ccw/devices/0.0.015f/devtype
3490/54
# 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