TAPESTAT(1)
๐ TAPESTAT(1) โ like, the tape statistics era ๐
okay bestie, gather round, because this one is from the Linux User's Manual and it's genuinely iconic: tapestat is your girl for keeping an eye on tape drives ๐
โจ NAME โจ
tapestat โ report tape statistics ๐
๐ธ SYNOPSIS ๐ธ
tapestat [ -k | -m | -G ] [ -t ] [ -U ] [ -V ] [ -y ] [ -z ] [ --human ]
[ -o JSON ] [ interval [ count ] ]
๐ฆ DESCRIPTION ๐ฆ
So the tapestat command is literally for monitoring the activity of the tape drives hooked up to your system. That's it, that's the vibe ๐ซถ
The first report that tapestat generates gives you stats covering the time since the system was booted โ unless you use the -y option, in which case that first report is just... not invited to the party ๐ Every report after that one covers the time since the previous report.
The interval parameter sets how many seconds sit between each report. The count parameter can be used alongside interval. If you do specify count, its value decides how many reports get generated, interval seconds apart. And if you give interval without count? Bestie, it just generates reports continuously, forever, no cap ๐ฅ
๐ REPORT ๐
The tapestat report gives you the stats for each tape drive connected to the system. Here's what gets displayed:
r/sโ the number of reads issued, expressed as the number per second, averaged over the interval.w/sโ the number of writes issued, expressed as the number per second, averaged over the interval.kB_read/s|MB_read/s|GB_read/sโ how much data was read, expressed in kibibytes (that's the default, or when option-kis used), mebibytes (if option-mis used) or gibibytes (if option-Gis used) per second, averaged over the interval.kB_wrtn/s|MB_wrtn/s|GB_wrtn/sโ how much data was written, expressed in kibibytes (default again, or if option-kis used), mebibytes (if option-mis used) or gibibytes (if option-Gis used) per second, averaged over the interval.%Rdโ Read percentage wait: the percentage of time over the interval spent waiting for read requests to complete. The time is measured from when the request is dispatched to the SCSI mid-layer until it signals that it completed ๐%Wrโ Write percentage wait: the percentage of time over the interval spent waiting for write requests to complete. Same deal, the time is measured from when the request is dispatched to the SCSI mid-layer until it signals that it completed.%Oaโ Overall percentage wait: the percentage of time over the interval spent waiting for any I/O request to complete (read, write, and other).Rs/sโ the number of I/Os, expressed as the number per second averaged over the interval, where a non-zero residual value was encountered ๐Ot/sโ the number of I/Os, expressed as the number per second averaged over the interval, that got lumped in as "other". Other I/O includesioctlcalls made to the tape driver plus implicit operations performed by the tape driver, like rewind on close (for tape devices that implement rewind on close). It does not include any I/O performed using methods outside of the tape driver (e.g. viasgioctls). periodt.
โจ OPTIONS โจ
-Gโ show the amount of data written or read in gibibytes per second. This option is mutually exclusive with-kand-m๐ซ--humanโ print sizes in human readable format (e.g.1.0k,1.2M, etc.). The units displayed with this option supersede any other default units associated with the metrics (e.g. kibibytes, sectors...). slay โจ-kโ show the amount of data written or read in kibibytes per second instead of mebibytes. This option is mutually exclusive with-Gand-m.-mโ show the amount of data written or read in mebibytes per second instead of kibibytes. This option is mutually exclusive with-Gand-k.-o JSONโ display the statistics in JSON (JavaScript Object Notation) format. ngl, the JSON output field order is undefined, and new fields may be added in the future, so don't get too attached to the layout ๐-tโ display time stamps. The time stamp format may depend on the value of theS_TIME_FORMATenvironment variable (see below) and on whether option-Uhas been used.-Uโ display timestamp (UTC โ Coordinated Universal Time) in seconds from the epoch.-Vโ print version and exit.-yโ omit the initial statistic showing values since boot. bye felicia ๐-zโ telltapestatto omit output for any tapes for which there was no activity during the sample period. if you were boring this interval, you don't get a mention ๐
๐ง CONSIDERATIONS ๐ง
So here's the thing: it is possible for a percentage value (read, write, or other) to be greater than 100 percent. Don't panic โ tapestat will never show a percentage value more than 999. If rewinding a tape takes 40 seconds where the interval time is 5 seconds, the %Oa value would show as 0 in the intervals before the rewind completed, and then show as approximately 800 percent when the rewind completes ๐ญ iconic behavior honestly.
Similar values will be observed for %Rd and %Wr if a tape drive stops reading or writing and then restarts (that is, it stopped streaming). In such a case you may see the r/s or w/s drop to zero and the %Rd/%Wr value could be higher than 100 when reading or writing continues (depending on how long it takes to restart writing or reading). This is only an issue if it happens a lot, because it may cause tape wear and will impact on the backup times โ ๏ธ
For fast tape drives you may see low percentage wait times. This does not indicate an issue with the tape drive. For a slower tape drive (e.g. an older generation DDS drive) the speed of the tape (and tape drive) is much slower than filesystem I/O, so percent wait times are likely to be higher. For faster tape drives (e.g. LTO) the percentage wait times are likely to be lower, because the program writing to or reading from tape is going to be doing a lot more filesystem I/O because of the higher throughput. iykyk ๐ฆ
Although tape statistics are implemented in the kernel using atomic variables, they cannot be read atomically as a group. All of the statistics values are read from different files under /sys, and because of this there may be I/O completions while reading the different files for the one tape drive. This may result in a set of statistics for a device that contain some values before an I/O completed and some after ๐ตโ๐ซ
This command uses rounding down as the rounding method when calculating per second statistics. If, for example, you're using dd to copy one tape to another and running tapestat with an interval of 5 seconds, and over the interval there were 3210 writes and 3209 reads, then w/s would show 642 and r/s 641 (641.8 rounded down to 641). In such a case, if it was a tar archive being copied (with a 10k block size), you would also see a difference between the kB_read/s and kB_wrtn/s of 2 (one I/O 10k in size divided by the interval period of 5 seconds). If instead there were 3210 writes and 3211 reads, both w/s and r/s would both show 642, but you would still see a difference between the kB_read/s and kB_wrtn/s values of 2 kB/s ๐
This command is provided with an interval in seconds. However, internally the interval is tracked per device and can potentially have an effect on the per second statistics reported. The time each set of statistics is captured is kept with those statistics. The difference between the current and previous time is converted to milliseconds for use in calculations. We can look at how this can impact the statistics reported if we use an example of a tar archive being copied between two tape drives using dd. If both devices reported 28900 kibibytes transferred and the reading tape drive had an interval of 5001 milliseconds and the writing tape drive 5000 milliseconds, that would calculate out as 5778 kB_read/s and 5780 kB_wrtn/s ๐
The impact of some retrieving statistics during an I/O completion, rounding down, and small differences in the interval period on the statistics calculated should be minimal, but may be non-zero. fr fr, tiny but real ๐
๐ ENVIRONMENT ๐
The tapestat command takes into account the following environment variables:
S_COLORS
By default, statistics are displayed in color when the output is connected to a terminal. Use this variable to change the settings. Possible values for this variable are never, always or auto (the latter is equivalent to the default settings).
Please note that the color (being red, yellow, or some other color) used to display a value is not indicative of any kind of issue simply because of the color. It only indicates different ranges of values. don't read into it bestie ๐
S_COLORS_SGR
Specify the colors and other attributes used to display statistics on the terminal. Its value is a colon-separated list of capabilities that defaults to I=32;22:N=34;1:W=35;1:X=31;1:Z=34;22. Supported capabilities are:
I=โ SGR (Select Graphic Rendition) substring for tape names.N=โ SGR substring for non-zero statistics values.W=(orM=) โ SGR substring for percentage values in the range from 75% to 90% (or in the range 10% to 25% depending on the metric's meaning).X=(orH=) โ SGR substring for percentage values greater than or equal to 90% (or lower than or equal to 10% depending on the metric's meaning).Z=โ SGR substring for zero values.
S_TIME_FORMAT
If this variable exists and its value is ISO then the current locale will be ignored when printing the date in the report header. The tapestat command will use the ISO 8601 format (YYYY-MM-DD) instead. The timestamp displayed with option -t will also be compliant with ISO 8601 format ๐
๐ BUGS ๐
/sys filesystem must be mounted for tapestat to work. It will not work on kernels that do not have sysfs support ๐ญ
This command requires kernel version 4.2 or later (or tape statistics support backported for an earlier kernel version).
Although tapestat displays units corresponding to kilobytes (kB), megabytes (MB), gigabytes (GB)..., it actually uses kibibytes (kiB), mebibytes (MiB), gibibytes (GiB)... A kibibyte is equal to 1024 bytes, a mebibyte is equal to 1024 kibibytes, and a gibibyte is equal to 1024 mebibytes. sneaky but honest ๐ซถ
๐ FILES ๐
/sys/class/scsi_tape/st<num>/stats/*โ Statistics files for tape devices./proc/uptimecontains system uptime.
โญ AUTHOR โญ
Initial revision by Shane M. SEYMOUR (shane.seymour <at> hpe.com) Modified for sysstat by Sebastien Godard (sysstat <at> orange.fr)
๐ฆ SEE ALSO ๐ฆ
https://github.com/sysstat/sysstat
https://sysstat.github.io/
and that's the whole page bestie ๐ this one's from the Linux manual, version dated AUGUST 2026 โ go forth and watch those tapes stream ๐ธโจ
๐ฆ where this page comes from
- arch rolling: sysstat 12.8.0-1 ยท GPL-2.0-only
- nixpkgs unstable: sysstat 12.8.0
- (C) 2015 Hewlett-Packard Development Company, L.P
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms