Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/scsi_tape

FieldValue
SubsystemSCSI tape driver (“st” per the ABI text: “the number of I/Os currently in-flight between the st module and the SCSI mid-layer”); implementation file not in cached tree
Config gatenot verifiable from the cached tree: no SCSI Kconfig is cached and the ABI entry names no config symbol (not verified)
ABI documentationDocumentation/ABI/testing/sysfs-class-scsi_tape
Since4.2 (all entries dated Apr 2015, KernelVersion 4.2)
Live (5.10.134 host)class absent: no scsi_tape row in the cached live enumeration of 46 classes
Ledger IDSYSC-scsi_tape

What it represents

I/O statistics for SCSI tape drives, one stats/ group per tape device directory in the class. The counters cover the traffic between the st driver and the SCSI midlayer: read/write request and byte counts, wait times in nanoseconds, non-read/write SCSI commands (e.g. the rewind issued when a rewind tape device is closed), in-flight commands, and residuals. Byte counts are tracked in bytes because, as the ABI notes, tape drives support variable length block sizes.

Relationship to the device model

The stats/ group hangs off per-device directories under /sys/class/scsi_tape; the devices are the st driver’s view of scsi_device LUNs that present as tape. The class is a statistics-only view: device control (position, mode select) is done through the tape char devices and ioctls, not sysfs. No relationship to block devices exists – tapes do not appear in /sys/block.

Attributes

All documented attributes are read-only counters under the stats/ subdirectory.

AttributeR/WUnit/formatConditional?Source
*/stats/in_flightROnumber of I/Os in-flight between st and the SCSI mid-layeralwaysABI testing sysfs-class-scsi_tape
*/stats/read_cnt / write_cntROnumber of read / write requests issuedalwaysABI testing sysfs-class-scsi_tape
*/stats/read_byte_cnt / write_byte_cntROtotal bytes requested from / written to the drive (bytes, variable block sizes)alwaysABI testing sysfs-class-scsi_tape
*/stats/read_ns / write_nsROnanoseconds waiting for read / write I/O completionalwaysABI testing sysfs-class-scsi_tape
*/stats/io_nsROtotal nanoseconds waiting for all I/O incl. other commands (io_ns - read_ns - write_ns = other wait)alwaysABI testing sysfs-class-scsi_tape
*/stats/other_cntROnumber of I/O requests other than SCSI read/write (e.g. rewinds)alwaysABI testing sysfs-class-scsi_tape
*/stats/resid_cntROcount of residual > 0 cases found when the midlayer indicated an erroralwaysABI testing sysfs-class-scsi_tape
*/stats/write_msROABI description says “total amount of time in nanoseconds” for writes – name says ms, text says ns; discrepancy kept as documentedalwaysABI testing sysfs-class-scsi_tape

Safety and writes

Read-only throughout; no write path exists in the ABI file. Reads are safe and cheap (accounting state, no hardware access). Note the write_ms naming inconsistency flagged above; the ABI entries also carry empty Users: fields – no consumers are named in the cached tree.

References