Fix markup. Fix backslashes to surive roff.
[netbsd-mini2440.git] / bin / mt / mt.1
blobecc4be52540b845fd7cd00d65257607a97e104e4
1 .\"     $NetBSD: mt.1,v 1.33 2003/08/07 09:05:17 agc Exp $
2 .\"
3 .\" Copyright (c) 1981, 1990, 1993
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\"    may be used to endorse or promote products derived from this software
16 .\"    without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .\"     @(#)mt.1        8.1 (Berkeley) 6/6/93
31 .\"
32 .Dd March 9, 2008
33 .Dt MT 1
34 .Os
35 .Sh NAME
36 .Nm mt
37 .Nd magnetic tape manipulation
38 .Sh SYNOPSIS
39 .Nm
40 .Op Fl f Ar tapename
41 .Ar command
42 .Op Ar count
43 .Sh DESCRIPTION
44 The
45 .Nm
46 program is used to give commands to a magnetic tape drive.
47 By default
48 .Nm
49 performs the requested operation once.
50 Operations may be performed multiple times by specifying
51 .Ar count  .
52 .Pp
53 Note
54 that
55 .Ar tapename
56 must reference a raw (not block) tape device.
58 .Ar tapename
59 is of the form
60 .Qq host:tapename ,
62 .Qq user@host:tapename ,
63 .Nm
64 writes to the named tape device on the remote host using
65 .Xr rmt 8 .
66 .Pp
67 The
68 .Xr rmt 8
69 process on the remote host is typically initiated via
70 .Xr rsh 1 ,
71 although an alternate method such as
72 .Xr ssh 1
73 can be specified via the
74 .Ev RCMD_CMD
75 environment variable.
76 .Pp
77 The available commands are listed below.
78 Only as many characters as are required to uniquely identify a command
79 need be specified.
80 .Bl -tag -width "eof, weof"
81 .It Cm asf
82 Move forward
83 .Ar count
84 files from the beginning of the tape.
85 This is accomplished by a rewind followed by fsf
86 .Ar count .
87 .It Cm eof , weof
88 Write
89 .Ar count
90 end-of-file marks at the current position on the tape.
91 .It Cm fsf
92 Forward space
93 .Ar count
94 files.
95 .It Cm fsr
96 Forward space
97 .Ar count
98 records.
99 .It Cm bsf
100 Back space
101 .Ar count
102 files.
103 .It Cm bsr
104 Back space
105 .Ar count
106 records.
107 .It Cm rewind
108 Rewind the tape.
109 (The
110 .Ar count
111 is ignored.)
112 .It Cm offline , rewoffl
113 Rewind the tape and place the tape unit off-line.
114 Where supported, this ejects the tape.
115 (The
116 .Ar count
117 is ignored.)
118 .It Cm status
119 Print status information about the tape unit.
120 (The
121 .Ar count
122 is ignored.)
123 .It Cm retension
124 Retensions the tape.
125 Not all tape drives support this feature.
126 (The
127 .Ar count
128 is ignored.)
129 .It Cm erase
130 Erases the tape
131 Not all tape drives support this feature.
132 (The
133 .Ar count
134 is ignored.)
135 .It Cm eew
136 Enable or disable early warning EOM behaviour.
138 .Ar count
139 to nonzero to enable, zero to disable.
140 .It Cm eom
141 Forward space to the end of recorded media.
142 (The
143 .Ar count
144 is ignored.)
145 .It Cm blocksize , setblk
146 Set the tape blocksize to
147 .Ar count
148 bytes.
150 .Ar count
151 of zero sets variable blocksize.
152 .It Cm density , setdensity
153 Set the tape density code to
154 .Ar count
155 as specified in the
156 .Tn SCSI-3
157 specification.
158 See the
159 .Sx DENSITY CODES
160 section for a list of codes for commonly used media types.
161 .It Cm rdspos
162 Read the logical block position of the tape.
163 Not all tape drives support this feature.
164 (The
165 .Ar count
166 is ignored.)
167 .It Cm rdhpos
168 Read the hardware block position of the tape.
169 Not all tape drives support this feature.
170 (The
171 .Ar count
172 is ignored.)
173 .It Cm setspos
174 Set the logical block position of the tape to
175 .Ar count.
176 Not all tape drives support this feature.
177 .It Cm sethpos
178 Set the hardware block position of the tape to
179 .Ar count.
180 Not all tape drives support this feature.
181 .It Cm compress
183 .Ar count
184 is zero, disable compression.
185 Otherwise enable compression.
186 Not all tape drives support this feature.
189 If a tape name is not specified, and the environment variable
190 .Ev TAPE
191 is not set, then
193 uses the device
194 .Pa /dev/nrst0 .
195 .Sh EXIT STATUS
197 returns a 0 exit status when the operation(s) were successful,
198 1 if the command was unrecognized, and 2 if an operation failed.
199 .Sh DENSITY CODES
200 The SCSI-3 specification defines a number of density codes for
201 various tape media, some of which are listed here.
202 Note that many tape drive vendors also define model-specific codes.
204 .Bl -column "Code" "Format" -compact
205 .It Em "Code    Format"
206 .It Li 0 Ta Device default
207 .It Li 1 Ta 1/2" 800 bpi
208 .It Li 2 Ta 1/2" 1600 bpi
209 .It Li 3 Ta 1/2" 6250 bpi
210 .It Li 4 Ta QIC-11
211 .It Li 5 Ta QIC-24
212 .It Li 15 Ta QIC-120
213 .It Li 16 Ta QIC-150
214 .It Li 17 Ta QIC-320/525
215 .It Li 18 Ta QIC-1320/1350
216 .It Li 19 Ta DDS
217 .It Li 28 Ta QIC-385M
218 .It Li 29 Ta QIC-410M
219 .It Li 30 Ta QIC-1000C
220 .It Li 31 Ta QIC-2100C
221 .It Li 32 Ta QIC-6GB
222 .It Li 33 Ta QIC-20GB
223 .It Li 34 Ta QIC-2GB
224 .It Li 35 Ta QIC-875M
225 .It Li 36 Ta DDS-2
226 .It Li 37 Ta DDS-3
227 .It Li 38 Ta DDS-4
229 .Sh ENVIRONMENT
230 If the following environment variables exist, they are used by
231 .Nm .
232 .Bl -tag -width Fl
233 .It Ev TAPE
235 uses device filename given in the
236 .Ev TAPE
237 environment variable if the
238 .Ar tapename
239 argument is not given.
240 .It Ev RCMD_CMD
242 will use
243 .Ev RCMD_CMD
244 rather than
245 .Pa /usr/bin/rsh
246 to invoke
247 .Xr rmt 8
248 on a remote machine.
249 The full path name must be specified.
251 .Sh FILES
252 .Bl -tag -width /dev/rst* -compact
253 .It Pa /dev/rst*
255 .Tn SCSI
256 tape device
257 .It Pa /dev/rmt*
258 Raw magnetic tape device
260 .Sh SEE ALSO
261 .Xr dd 1 ,
262 .Xr ioctl 2 ,
263 .Xr mtio 4 ,
264 .Xr st 4 ,
265 .Xr environ 7
266 .Sh HISTORY
269 utility appeared in
270 .Bx 4.3 .