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 CCW-attached tape devices and tape devices that are attached to the SCSI bus from sysfs.

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.
  • The st (SCSI tape) device driver in the Linux® kernel.
If you use the IBMtape or lin_tape driver, the sg_inq utility is required. If sg_inq is missing, certain information about the IBMtape or lin_tape driver cannot be displayed.

lstape syntax


1  lstape? -s?  -t + , <devicetype>
1 --online
1 --offline
2? + , <device_bus_id>(1)
1 --ccw-only
1 --scsi-only
1 --verbose
Notes:
  • 1 specify the first device bus-ID with a leading blank.
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 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 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:
    #> 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
    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
    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