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 past count file marks,  then  backward  space  one
30              file  record.  This leaves the tape positioned on the last block
31              of the file that is 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  past  count  file marks, then forward space one
37              file record.  This leaves the tape positioned on the first block
38              of the file that 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
54              append 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.
72
73       status Print status information about the tape unit.  (If  the  density
74              code  is  "no  translation"  in the status output, this does not
75              affect working of the tape drive.)
76
77       seek   (SCSI tapes) Seek to the count block on the tape.   This  opera‐
78              tion  is  available  on  some Tandberg and Wangtek streamers and
79              some SCSI-2 tape drives. The block address  should  be  obtained
80              from a tell call earlier.
81
82       tell   (SCSI  tapes) Tell the current block on tape.  This operation is
83              available on some Tandberg and Wangtek streamers and some SCSI-2
84              tape drives.
85
86       setpartition
87              (SCSI  tapes)  Switch to the partition determined by count.  The
88              default data partition of the tape is numbered  zero.  Switching
89              partition  is  available  only  if  enabled  for the device, the
90              device supports multiple partitions, and the tape  is  formatted
91              with multiple partitions.
92
93       partseek
94              (SCSI tapes) The tape position is set to block count in the par‐
95              tition given by the argument after count. The default  partition
96              is zero.
97
98       mkpartition
99              (SCSI  tapes)  Format  the  tape with one (count is zero) or two
100              partitions (count gives the size  of  the  second  partition  in
101              megabytes).  The  tape  drive must be able to format partitioned
102              tapes with initiator-specified partition size and partition sup‐
103              port must be enabled for the drive.
104
105       load   (SCSI tapes) Send the load command to the tape drive. The drives
106              usually load the tape when a  new  cartridge  is  inserted.  The
107              argument  count  can  usually  be omitted. Some HP changers load
108              tape n if the count 10000 + n is given (a special funtion in the
109              Linux st driver).
110
111       lock   (SCSI tapes) Lock the tape drive door.
112
113       unlock (SCSI tapes) Unlock the tape drive door.
114
115       setblk (SCSI  tapes) Set the block size of the drive to count bytes per
116              record.
117
118       setdensity
119              (SCSI tapes) Set the tape density code  to  count.   The  proper
120              codes  to use with each drive should be looked up from the drive
121              documentation.
122
123       densities
124              (SCSI tapes) Write explanation of some common density  codes  to
125              standard output.
126
127       drvbuffer
128              (SCSI  tapes)  Set  the  tape  drive buffer code to number.  The
129              proper value for  unbuffered  operation  is  zero  and  "normal"
130              buffered  operation  one.  The  meanings  of other values can be
131              found in the drive documentation or, in the  case  of  a  SCSI-2
132              drive, from the SCSI-2 standard.
133
134       compression
135              (SCSI tapes) The compression within the drive can be switched on
136              or off using the MTCOMPRESSION ioctl. Note that this  method  is
137              not  supported  by  all  drives  implementing  compression.  For
138              instance, the Exabyte 8 mm drives use density  codes  to  select
139              compression.
140
141       stoptions
142              (SCSI  tapes)  Set the driver options bits for the device to the
143              defined values. Allowed only for the superuser. The bits can  be
144              set   either   by   ORing   the   option   bits  from  the  file
145              /usr/include/linux/mtio.h to count, or by  using  the  following
146              keywords  (as many keywords can be used on the same line as nec‐
147              essary, unambiguous abbreviations allowed):
148
149              buffer-writes  buffered writes enabled
150
151              async-writes   asynchronous writes enabled
152
153              read-ahead     read-ahead for fixed block size
154
155              debug          debugging (if compiled into driver)
156
157              two-fms        write two filemarks when file closed
158
159              fast-eod       space directly to eod (and lose file number)
160
161              no-wait        don't wait until rewind, etc. complete
162
163              auto-lock      automatically lock/unlock drive door
164
165              def-writes     the block size and density are for writes
166
167              can-bsr        drive can space backwards as well
168
169              no-blklimits   drive doesn't support read block limits
170
171              can-partitions drive can handle partitioned tapes
172
173              scsi2logical   seek and tell use SCSI-2 logical block  addresses
174                             instead of device dependent addresses
175
176              sili           Set  the  SILI  bit  is  when reading in variable
177                             block mode. This  may  speed  up  reading  blocks
178                             shorter than the read byte count. Set this option
179                             only if you know that the drive supports SILI and
180                             the  HBA  reliably returns transfer residual byte
181                             counts. Requires kernel version >= 2.6.26.
182
183              sysv           enable the System V semantics
184
185       stsetoptions
186              (SCSI tapes) Set selected driver options bits.  The  methods  to
187              specify  the  bits  to set are given above in the description of
188              stoptions.  Allowed only for the superuser.
189
190       stclearoptions
191              (SCSI tapes) Clear selected driver option bits.  The methods  to
192              specify  the  bits  to  clear  are given above in description of
193              stoptions.  Allowed only for the superuser.
194
195       stshowoptions
196              (SCSI tapes) Print the currently enabled options for the device.
197              Requires  kernel  version >= 2.6.26 and sysfs must be mounted at
198              /sys.
199
200       stwrthreshold
201              (SCSI tapes) The write threshold for the tape device is  set  to
202              count  kilobytes. The value must be smaller than or equal to the
203              driver buffer size. Allowed only for the superuser.
204
205       defblksize
206              (SCSI tapes) Set the default block size of the device  to  count
207              bytes.  The value -1 disables the default block size.  The block
208              size set by setblk overrides the default until  a  new  tape  is
209              inserted.  Allowed only for the superuser.
210
211       defdensity
212              (SCSI tapes) Set the default density code. The value -1 disables
213              the default density. The density set by setdensity overrides the
214              default until a new tape is inserted. Allowed only for the supe‐
215              ruser.
216
217       defdrvbuffer
218              (SCSI tapes) Set the default drive buffer  code.  The  value  -1
219              disables  the  default  drive buffer code. The drive buffer code
220              set by drvbuffer overrides the  default  until  a  new  tape  is
221              inserted. Allowed only for the superuser.
222
223       defcompression
224              (SCSI  tapes)  Set  the  default compression state. The value -1
225              disables the default compression. The compression state  set  by
226              compression  overrides the default until a new tape is inserted.
227              Allowed only for the superuser.
228
229       sttimeout
230              sets the normal timeout for the device. The value  is  given  in
231              seconds. Allowed only for the superuser.
232
233       stlongtimeout
234              sets the long timeout for the device. The value is given in sec‐
235              onds. Allowed only for the superuser.
236
237       stsetcln
238              set the cleaning request interpretation parameters.
239
240       mt exits with a status of 0 if the operation succeeded, 1 if the opera‐
241       tion or device name given was invalid, or 2 if the operation failed.
242

OPTIONS

244       -h, --help
245              Print a usage message on standard output and exit successfully.
246
247       -v, --version
248              Print version of mt.
249
250       -f, -t The path of the tape device on  which to operate.  If neither of
251              those options is given, and the  environment  variable  TAPE  is
252              set,  it  is  used.   Otherwise, a default device defined in the
253              file /usr/include/sys/mtio.h is used.
254

AUTHOR

256       The program is written by Kai Makisara <Kai.Makisara@kolumbus.fi>.
257
259       The program and the  manual  page  are  copyrighted  by  Kai  Makisara,
260       1998-2008.  They can be distributed according to the GNU Copyleft.
261

SEE ALSO

263       st(4)
264
265
266
267                                  April 2008                             MT(1)
Impressum