1TAPESTAT(1) Linux User's Manual TAPESTAT(1)
2
3
4
6 tapestat - Report tape statistics.
7
8
10 tapestat [ -k | -m ] [ -t ] [ -V ] [ -y ] [ -z ] [ --human ] [ interval
11 [ count ] ]
12
13
15 The tapestat command is used for monitoring the activity of tape drives
16 connected to a system.
17
18 The first report generated by the tapestat command provides statistics
19 concerning the time since the system was booted, unless the -y option
20 is used, when this first report is omitted. Each subsequent report
21 covers the time since the previous report.
22
23 The interval parameter specifies the amount of time in seconds between
24 each report. The count parameter can be specified in conjunction with
25 the interval parameter. If the count parameter is specified, the value
26 of count determines the number of reports generated at interval seconds
27 apart. If the interval parameter is specified without the count parame‐
28 ter, the tapestat command generates reports continuously.
29
30
32 The tapestat report provides statistics for each tape drive connected
33 to the system. The following data are displayed:
34
35 r/s The number of reads issued expressed as the number per second
36 averaged over the interval.
37
38 w/s The number of writes issued expressed as the number per second
39 averaged over the interval.
40
41 kB_read/s | MB_read/s
42 The amount of data read expressed in kilobytes (by default or if
43 option -k used) or megabytes (if option -m used) per second av‐
44 eraged over the interval.
45
46 kB_wrtn/s | MB_wrtn/s
47 The amount of data written expressed in kilobytes (by default or
48 if option -k used) or megabytes (if option -m used) per second
49 averaged over the interval.
50
51 %Rd Read percentage wait - The percentage of time over the interval
52 spent waiting for read requests to complete. The time is mea‐
53 sured from when the request is dispatched to the SCSI mid-layer
54 until it signals that it completed.
55
56 %Wr Write percentage wait - The percentage of time over the interval
57 spent waiting for write requests to complete. The time is mea‐
58 sured from when the request is dispatched to the SCSI mid-layer
59 until it signals that it completed.
60
61 %Oa Overall percentage wait - The percentage of time over the inter‐
62 val spent waiting for any I/O request to complete (read, write,
63 and other).
64
65 Rs/s The number of I/Os, expressed as the number per second averaged
66 over the interval, where a non-zero residual value was encoun‐
67 tered.
68
69 Ot/s The number of I/Os, expressed as the number per second averaged
70 over the interval, that were included as "other". Other I/O in‐
71 cludes ioctl calls made to the tape driver and implicit opera‐
72 tions performed by the tape driver such as rewind on close (for
73 tape devices that implement rewind on close). It does not in‐
74 clude any I/O performed using methods outside of the tape driver
75 (e.g. via sg ioctls).
76
77
79 --human
80 Print sizes in human readable format (e.g. 1.0k, 1.2M, etc.)
81 The units displayed with this option supersede any other default
82 units (e.g. kilobytes, sectors...) associated with the metrics.
83
84 -k Show the amount of data written or read in kilobytes per second
85 instead of megabytes. This option is mutually exclusive with
86 -m.
87
88 -m Show the amount of data written or read in megabytes per second
89 instead of kilobytes. This option is mutually exclusive with
90 -k.
91
92 -t Display time stamps. The time stamp format may depend on the
93 value of the S_TIME_FORMAT environment variable (see below).
94
95 -V Print version and exit.
96
97 -y Omit the initial statistic showing values since boot.
98
99 -z Tell tapestat to omit output for any tapes for which there was
100 no activity during the sample period.
101
102
104 It is possible for a percentage value (read, write, or other) to be
105 greater than 100 percent (the tapestat command will never show a per‐
106 centage value more than 999). If rewinding a tape takes 40 seconds
107 where the interval time is 5 seconds the %Oa value would show as 0 in
108 the intervals before the rewind completed and then show as approxi‐
109 mately 800 percent when the rewind completes.
110
111 Similar values will be observed for %Rd and %Wr if a tape drive stops
112 reading or writing and then restarts (that is it stopped streaming). In
113 such a case you may see the r/s or w/s drop to zero and the %Rd/%Wr
114 value could be higher than 100 when reading or writing continues (de‐
115 pending on how long it takes to restart writing or reading). This is
116 only an issue if it happens a lot as it may cause tape wear and will
117 impact on the backup times.
118
119 For fast tape drives you may see low percentage wait times. This does
120 not indicate an issue with the tape drive. For a slower tape drive
121 (e.g. an older generation DDS drive) the speed of the tape (and tape
122 drive) is much slower than filesystem I/O, percent wait times are
123 likely to be higher. For faster tape drives (e.g. LTO) the percentage
124 wait times are likely to be lower as program writing to or reading from
125 tape is going to be doing a lot more filesystem I/O because of the
126 higher throughput.
127
128 Although tape statistics are implemented in the kernel using atomic
129 variables they cannot be read atomically as a group. All of the statis‐
130 tics values are read from different files under /sys, because of this
131 there may be I/O completions while reading the different files for the
132 one tape drive. This may result in a set of statistics for a device
133 that contain some values before an I/O completed and some after.
134
135 This command uses rounding down as the rounding method when calculating
136 per second statistics. If, for example, you are using dd to copy one
137 tape to another and running tapestat with an interval of 5 seconds and
138 over the interval there were 3210 writes and 3209 reads then w/s would
139 show 642 and r/s 641 (641.8 rounded down to 641). In such a case if it
140 was a tar archive being copied (with a 10k block size) you would also
141 see a difference between the kB_read/s and kB_wrtn/s of 2 (one I/O 10k
142 in size divided by the interval period of 5 seconds). If instead there
143 were 3210 writes and 3211 reads both w/s and r/s would both show 642
144 but you would still see a difference between the kB_read/s and
145 kB_wrtn/s values of 2 kB/s.
146
147 This command is provided with an interval in seconds. However inter‐
148 nally the interval is tracked per device and can potentially have an
149 effect on the per second statistics reported. The time each set of
150 statistics is captured is kept with those statistics. The difference
151 between the current and previous time is converted to milliseconds for
152 use in calculations. We can look at how this can impact the statistics
153 reported if we use an example of a tar archive being copied between two
154 tape drives using dd. If both devices reported 28900 kilobytes trans‐
155 ferred and the reading tape drive had an interval of 5001 milliseconds
156 and the writing tape drive 5000 milliseconds that would calculate out
157 as 5778 kB_read/s and 5780 kB_wrtn/s.
158
159 The impact of some retrieving statistics during an I/O completion,
160 rounding down, and small differences in the interval period on the sta‐
161 tistics calculated should be minimal but may be non-zero.
162
163
165 The tapestat command takes into account the following environment vari‐
166 ables:
167
168 S_COLORS
169 By default statistics are displayed in color when the output is
170 connected to a terminal. Use this variable to change the set‐
171 tings. Possible values for this variable are never, always or
172 auto (the latter is equivalent to the default settings).
173 Please note that the color (being red, yellow, or some other
174 color) used to display a value is not indicative of any kind of
175 issue simply because of the color. It only indicates different
176 ranges of values.
177
178 S_COLORS_SGR
179 Specify the colors and other attributes used to display statis‐
180 tics on the terminal. Its value is a colon-separated list of
181 capabilities that defaults to
182 H=31;1:I=32;22:M=35;1:N=34;1:Z=34;22. Supported capabilities
183 are:
184
185 H= SGR (Select Graphic Rendition) substring for percentage
186 values greater than or equal to 75%.
187
188 I= SGR substring for tape names.
189
190 M= SGR substring for percentage values in the range from 50%
191 to 75%.
192
193 N= SGR substring for non-zero statistics values.
194
195 Z= SGR substring for zero values.
196
197 S_TIME_FORMAT
198 If this variable exists and its value is ISO then the current
199 locale will be ignored when printing the date in the report
200 header. The tapestat command will use the ISO 8601 format (YYYY-
201 MM-DD) instead. The timestamp displayed with option -t will
202 also be compliant with ISO 8601 format.
203
204
206 /sys filesystem must be mounted for tapestat to work. It will not work
207 on kernels that do not have sysfs support
208
209 This command requires kernel version 4.2 or later (or tape statistics
210 support backported for an earlier kernel version).
211
212 Although tapestat speaks of kilobytes (kB), megabytes (MB)..., it actu‐
213 ally uses kibibytes (kiB), mebibytes (MiB)... A kibibyte is equal to
214 1024 bytes, and a mebibyte is equal to 1024 kibibytes.
215
216
218 /sys/class/scsi_tape/st<num>/stats/*
219 Statistics files for tape devices.
220
221 /proc/uptime contains system uptime.
222
223
225 Initial revision by Shane M. SEYMOUR (shane.seymour <at> hpe.com)
226 Modified for sysstat by Sebastien Godard (sysstat <at> orange.fr)
227
228
230 iostat(1), mpstat(1)
231
232 https://github.com/sysstat/sysstat
233 http://pagesperso-orange.fr/sebastien.godard/
234
235
236
237Linux JUNE 2020 TAPESTAT(1)