lstape - List tape devices
Use the lstape command to gather information about tape devices and display it in a summary format.
It gathers information about the following types of tape devices:
- CCW-attached tape devices
- Tape drive and medium charger devices that are available through the sysfs SCSI bus
For information about SCSI tape devices, the command uses the following sources for the
information displayed:
- The IBMtape or the open source lin_tape driver.
- The sg_inq command from the scsi/sg3_utils package.Note: Issuing lstape without option --ccw-only causes extra SAN traffic for each SCSI tape or changer device.
- The st (SCSI tape) device driver in the Linux® kernel.
- The ch SCSI medium changer device driver in the Linux kernel.
lstape syntax
Where:
- -s or --shortid
- strips the
0.<n>.
from the device bus-IDs in the command output. For CCW-attached devices only. - -t or --type
- limits the output to information about the specified type or types of CCW-attached devices only.
- --ccw-only
- limits the output to information about CCW-attached devices only.
- --scsi-only
- limits the output to information about tape devices that are attached to the SCSI bus.
- --online | --offline
- limits the output to information about online or offline CCW-attached tape devices only.
- <device_bus_id>
- limits the output to information about the specified CCW-attached tape device or devices only.
- -V or --verbose
- For tape devices attached to the SCSI bus only. Prints the serial of the tape and information about the FCP or virtio-scsi-ccw connection as an additional text line after each SCSI tape in the list.
- -v or --version
- displays the version of the command.
- -h or --help
- displays a short help text, then exits. To view the man page, enter man lstape.
Examples
- This command displays information about all tapes that are found, here one CCW-attached tape and
one tape and changer device that is configured for zFCP:
If only the st tape device driver and the ch changer device driver are loaded, the output lists those names in the device section:#> lstape FICON/ESCON tapes (found 1): TapeNo BusID CuType/Model DevType/Model BlkSize State Op MedState 0 0.0.0480 3480/01 3480/04 auto UNUSED --- UNLOADED SCSI tape devices (found 2): Generic Device Target Vendor Model Type State sg4 IBMchanger0 0:0:0:0 IBM 03590H11 changer running sg5 IBMtape0 0:0:0:1 IBM 03590H11 tapedrv running
#> lstape FICON/ESCON tapes (found 1): TapeNo BusID CuType/Model DevType/Model BlkSize State Op MedState 0 0.0.0480 3480/01 3480/04 auto UNUSED --- UNLOADED SCSI tape devices (found 2): Generic Device Target Vendor Model Type State sg0 sch0 0:0:0:0 IBM 03590H11 changer running sg1 st0 0:0:0:1 IBM 03590H11 tapedrv running
- This command displays information about all available CCW-attached
tapes.
# lstape –-ccw-only TapeNo BusID CuType/Model DevType/DevMod BlkSize State Op MedState 0 0.0.0132 3590/50 3590/11 auto IN_USE --- LOADED 1 0.0.0110 3490/10 3490/40 auto UNUSED --- UNLOADED 2 0.0.0133 3590/50 3590/11 auto IN_USE --- LOADED 3 0.0.012a 3480/01 3480/04 auto UNUSED --- UNLOADED N/A 0.0.01f8 3480/01 3480/04 N/A OFFLINE --- N/A
- This command limits the output to tapes of type 3480 and 3490.
# lstape -t 3480,3490 TapeNo BusID CuType/Model DevType/DevMod BlkSize State Op MedState 1 0.0.0110 3490/10 3490/40 auto UNUSED --- UNLOADED 3 0.0.012a 3480/01 3480/04 auto UNUSED --- UNLOADED N/A 0.0.01f8 3480/01 3480/04 N/A OFFLINE --- N/A
- This command limits the output to those tapes of type 3480 and
3490 that are currently online.
# lstape -t 3480,3490 --online TapeNo BusID CuType/Model DevType/DevMod BlkSize State Op MedState 1 0.0.0110 3490/10 3490/40 auto UNUSED --- UNLOADED 3 0.0.012a 3480/01 3480/04 auto UNUSED --- UNLOADED
- This command limits the output to the tape with device bus-ID 0.0.012a and strips the
0.<n>.
from the device bus-ID in the output.# lstape -s 0.0.012a TapeNo BusID CuType/Model DevType/DevMod BlkSize State Op MedState 3 012a 3480/01 3480/04 auto UNUSED --- UNLOADED
- This command limits the output to SCSI devices but gives more
details. The serial numbers are only displayed if the sg_inq command
is found on the system.
#> lstape --scsi-only --verbose Generic Device Target Vendor Model Type State HBA WWPN Serial sg0 st0 0:0:0:1 IBM 03590H11 tapedrv running 0.0.1708 0x500507630040727b NO/INQ sg1 sch0 0:0:0:2 IBM 03590H11 changer running 0.0.1708 0x500507630040727b NO/INQ
- Example details about a zfcp-attached SCSI tape library
with multiple paths operated by the IBM lin_tape device driver instead of Linux st or
ch.
# lstape --scsi-only --verbose SCSI tape devices (found 8): Generic Device Target Vendor Model Type State HBA WWPN Serial sg0 IBMtape0 0:0:0:0 IBM ULT3580-TD6 tapedrv running 0.0.5080 0x2002000e1115c62f 10WT037733 sg1 IBMchanger0 0:0:0:1 IBM 3573-TL changer running 0.0.5080 0x2002000e1115c62f 00L4U78W6497_LL0 sg4 IBMtape2 0:0:1:0 IBM ULT3580-TD6 tapedrv running 0.0.5080 0x2008000e1115c62f 10WT037701 sg5 IBMchanger2 0:0:1:1 IBM 3573-TL changer running 0.0.5080 0x2008000e1115c62f 00L4U78W6497_LL0 sg6 IBMtape3 1:0:0:0 IBM ULT3580-TD6 tapedrv running 0.0.50c0 0x2002000e1115c62f 10WT037733 sg7 IBMchanger3 1:0:0:1 IBM 3573-TL changer running 0.0.50c0 0x2002000e1115c62f 00L4U78W6497_LL0 sg2 IBMtape1 1:0:1:0 IBM ULT3580-TD6 tapedrv running 0.0.50c0 0x2008000e1115c62f 10WT037701 sg3 IBMchanger1 1:0:1:1 IBM 3573-TL changer running 0.0.50c0 0x2008000e1115c62f 00L4U78W6497_LL0