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

AUTHOR

237       The program is written by Kai Makisara <Kai.Makisara@kolumbus.fi>.
238
240       The  program  and  the  manual  page  are  copyrighted by Kai Makisara,
241       1998-2005.  They can be distributed according to the GNU Copyleft.
242

SEE ALSO

244       st(4)
245
246
247
248                                  August 2005                            MT(1)
Impressum