1MT(1)                       General Commands Manual                      MT(1)
2
3
4

NAME

6       mt - control magnetic tape drive operation
7

SYNOPSIS

9       mt [-h] [-f device] operation [count] [arguments...]
10

DESCRIPTION

12       This  manual  page  documents the tape control program mt.  mt performs
13       the given operation, which must be one of the  tape  operations  listed
14       below,  on a tape drive. The commands can also be listed by running the
15       program with the -h option.
16
17       Some operations optionally take an argument or repeat count, which  can
18       be  given after the operation name and defaults to 1. The postfix k , M
19       , or G can be used to give counts in units of 1024,  1024  *  1024,  or
20       1024 * 1024 * 1024, respectively.
21
22       The  available  operations  are listed below.  Unique abbreviations are
23       accepted.  Not all operations are available on all systems, or work  on
24       all types of tape drives.
25
26       fsf    Forward  space count files.  The tape is positioned on the first
27              block of the next file.
28
29       fsfm   Forward space count files, then backward space one record.  This
30              leaves the tape positioned at the last block of the file that is
31              count - 1 files past the current file.
32
33       bsf    Backward space count files.  The tape is positioned on the  last
34              block of the previous file.
35
36       bsfm   Backward  space count files, then forward space one record. This
37              leaves the tape positioned at the first block of the  file  that
38              is count - 1 files before the current file.
39
40       asf    The tape is positioned at the beginning of the count file. Posi‐
41              tioning is done by first rewinding the  tape  and  then  spacing
42              forward over count filemarks.
43
44       fsr    Forward space count records.
45
46       bsr    Backward space count records.
47
48       fss    (SCSI tapes) Forward space count setmarks.
49
50       bss    (SCSI tapes) Backward space count setmarks.
51
52       eod, seod
53              Space to end of valid data.  Used on streamer tape drives to ap‐
54              pend data to the logical end of tape.
55
56       rewind Rewind the tape.
57
58       offline, rewoffl, eject
59              Rewind the tape and, if applicable, unload the tape.
60
61       retension
62              Rewind the tape, then wind it to  the  end  of  the  reel,  then
63              rewind it again.
64
65       weof, eof
66              Write count EOF marks at current position.
67
68       wset   (SCSI tapes) Write count setmarks at current position (only SCSI
69              tape).
70
71       erase  Erase the tape. Note that this is a long erase, which on  modern
72              (high-capacity)  tapes  can  take  many hours, and which usually
73              can't be aborted.
74
75       status Print status information about the tape unit.  (If  the  density
76              code is "no translation" in the status output, this does not af‐
77              fect working of the tape drive.)
78
79       seek   (SCSI tapes) Seek to the count block on the tape.   This  opera‐
80              tion  is  available  on  some Tandberg and Wangtek streamers and
81              some SCSI-2 tape drives. The block address  should  be  obtained
82              from a tell call earlier.
83
84       tell   (SCSI  tapes) Tell the current block on tape.  This operation is
85              available on some Tandberg and Wangtek streamers and some SCSI-2
86              tape drives.
87
88       setpartition
89              (SCSI  tapes)  Switch to the partition determined by count.  The
90              default data partition of the tape is numbered  zero.  Switching
91              partition  is  available only if enabled for the device, the de‐
92              vice supports multiple partitions, and  the  tape  is  formatted
93              with multiple partitions.
94
95       partseek
96              (SCSI tapes) The tape position is set to block count in the par‐
97              tition given by the argument after count. The default  partition
98              is zero.
99
100       mkpartition
101              (SCSI  tapes)  Format  the  tape with one (count is zero) or two
102              partitions (count gives the size  of  the  second  partition  in
103              megabytes).  If  the count is positive, it specifies the size of
104              partition 1. From kernel version 4.6, if the count is  negative,
105              it specifies the size of partition 0. With older kernels, a neg‐
106              ative argument formats the tape with  one  partition.  The  tape
107              drive  must  be able to format partitioned tapes with initiator-
108              specified partition size and partition support must  be  enabled
109              for the drive.
110
111       load   (SCSI tapes) Send the load command to the tape drive. The drives
112              usually load the tape when a new cartridge is inserted. The  ar‐
113              gument  count can usually be omitted. Some HP changers load tape
114              n if the count 10000 + n is given (a  special  function  in  the
115              Linux st driver).
116
117       lock   (SCSI tapes) Lock the tape drive door.
118
119       unlock (SCSI tapes) Unlock the tape drive door.
120
121       setblk (SCSI  tapes) Set the block size of the drive to count bytes per
122              record.
123
124       setdensity
125              (SCSI tapes) Set the tape density code  to  count.   The  proper
126              codes  to use with each drive should be looked up from the drive
127              documentation.
128
129       densities
130              (SCSI tapes) Write explanation of some common density  codes  to
131              standard output.
132
133       drvbuffer
134              (SCSI  tapes)  Set  the  tape  drive buffer code to number.  The
135              proper value for  unbuffered  operation  is  zero  and  "normal"
136              buffered  operation  one.  The  meanings  of other values can be
137              found in the drive documentation or, in the  case  of  a  SCSI-2
138              drive, from the SCSI-2 standard.
139
140       compression
141              (SCSI tapes) The compression within the drive can be switched on
142              or off using the MTCOMPRESSION ioctl. Note that this  method  is
143              not  supported  by  all drives implementing compression. For in‐
144              stance, the Exabyte 8 mm drives use density codes to select com‐
145              pression.
146
147       stoptions
148              (SCSI  tapes)  Set the driver options bits for the device to the
149              defined values. Allowed only for the superuser. The bits can  be
150              set  either  by  ORing  the  option  bits from the file /usr/in‐
151              clude/linux/mtio.h to count, or by using the following  keywords
152              (as many keywords can be used on the same line as necessary, un‐
153              ambiguous abbreviations allowed):
154
155              buffer-writes  buffered writes enabled
156
157              async-writes   asynchronous writes enabled
158
159              read-ahead     read-ahead for fixed block size
160
161              debug          debugging (if compiled into driver)
162
163              two-fms        write two filemarks when file closed
164
165              fast-eod       space directly to eod (and lose file number)
166
167              no-wait        don't wait until rewind, etc. complete
168
169              auto-lock      automatically lock/unlock drive door
170
171              def-writes     the block size and density are for writes
172
173              can-bsr        drive can space backwards as well
174
175              no-blklimits   drive doesn't support read block limits
176
177              can-partitions drive can handle partitioned tapes
178
179              scsi2logical   seek and tell use SCSI-2 logical block  addresses
180                             instead of device dependent addresses
181
182              sili           Set  the  SILI  bit  is  when reading in variable
183                             block mode. This  may  speed  up  reading  blocks
184                             shorter than the read byte count. Set this option
185                             only if you know that the drive supports SILI and
186                             the  HBA  reliably returns transfer residual byte
187                             counts. Requires kernel version >= 2.6.26.
188
189              sysv           enable the System V semantics
190
191       stsetoptions
192              (SCSI tapes) Set selected driver options bits.  The  methods  to
193              specify  the  bits  to set are given above in the description of
194              stoptions.  Allowed only for the superuser.
195
196       stclearoptions
197              (SCSI tapes) Clear selected driver option bits.  The methods  to
198              specify  the  bits  to  clear  are given above in description of
199              stoptions.  Allowed only for the superuser.
200
201       stshowoptions
202              (SCSI tapes) Print the currently enabled options for the device.
203              Requires  kernel  version >= 2.6.26 and sysfs must be mounted at
204              /sys.
205
206       stwrthreshold
207              (SCSI tapes) The write threshold for the tape device is  set  to
208              count  kilobytes. The value must be smaller than or equal to the
209              driver buffer size. Allowed only for the superuser.
210
211       defblksize
212              (SCSI tapes) Set the default block size of the device  to  count
213              bytes.  The value -1 disables the default block size.  The block
214              size set by setblk overrides the default until a new tape is in‐
215              serted.  Allowed only for the superuser.
216
217       defdensity
218              (SCSI tapes) Set the default density code. The value -1 disables
219              the default density. The density set by setdensity overrides the
220              default until a new tape is inserted. Allowed only for the supe‐
221              ruser.
222
223       defdrvbuffer
224              (SCSI tapes) Set the default drive buffer  code.  The  value  -1
225              disables  the  default  drive buffer code. The drive buffer code
226              set by drvbuffer overrides the default until a new tape  is  in‐
227              serted. Allowed only for the superuser.
228
229       defcompression
230              (SCSI  tapes)  Set  the  default compression state. The value -1
231              disables the default compression. The compression state  set  by
232              compression  overrides the default until a new tape is inserted.
233              Allowed only for the superuser.
234
235       sttimeout
236              sets the normal timeout for the device. The value  is  given  in
237              seconds. Allowed only for the superuser.
238
239       stlongtimeout
240              sets the long timeout for the device. The value is given in sec‐
241              onds. Allowed only for the superuser.
242
243       stsetcln
244              set the cleaning request interpretation parameters.
245
246       mt exits with a status of 0 if the operation succeeded, 1 if the opera‐
247       tion or device name given was invalid, or 2 if the operation failed.
248

OPTIONS

250       -h, --help
251              Print a usage message on standard output and exit successfully.
252
253       -v, --version
254              Print version of mt.
255
256       -f, -t The path of the tape device on  which to operate.  If neither of
257              those options is given, and the  environment  variable  TAPE  is
258              set,  it  is  used.   Otherwise, a default device defined in the
259              file /usr/include/sys/mtio.h is used (note that the actual  path
260              to mtio.h can vary per architecture and/or distribution).
261

NOTES

263       The  argument  of  mkpartition  specifies  the size of the partition in
264       megabytes. If you add a postfix, it applies to this definition. For ex‐
265       ample,  argument  1G means 1 giga megabytes, which probably is not what
266       the user is anticipating.
267

AUTHOR

269       The program is written by Kai Makisara <Kai.Makisara@kolumbus.fi>,  and
270       is currently maintained by Iustin Pop <iustin@k1024.org>.
271
273       The  program  and  the  manual  page  are  copyrighted by Kai Makisara,
274       1998-2008.  They can be distributed according to the GNU Copyleft.
275

BUGS

277       Please report bugs to <https://github.com/iustin/mt-st>.
278

SEE ALSO

280       st(4)
281
282
283
284                                  April 2008                             MT(1)
Impressum