1 '\" te
   2 .\"  Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH MT 1 "Jun 21, 2007"
   7 .SH NAME
   8 mt \- magnetic tape control
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 \fBmt\fR [\fB-f\fR \fItapename\fR] \fIcommand\fR... [\fIcount\fR]
  13 .fi
  14 
  15 .SH DESCRIPTION
  16 .sp
  17 .LP
  18 The \fBmt\fR utility sends commands to a magnetic tape drive. If \fB-f\fR
  19 \fItapename\fR is not specified, the environment variable \fBTAPE\fR is used.
  20 If \fBTAPE\fR does not exist, \fBmt\fR uses the device \fB/dev/rmt/0n\fR.
  21 .SH OPTIONS
  22 .sp
  23 .LP
  24 The following options are supported:
  25 .sp
  26 .ne 2
  27 .na
  28 \fB\fB-f\fR \fItapename\fR\fR
  29 .ad
  30 .RS 15n
  31 Specifies the raw tape device.
  32 .RE
  33 
  34 .SH OPERANDS
  35 .sp
  36 .LP
  37 The following operands are supported:
  38 .sp
  39 .ne 2
  40 .na
  41 \fB\fIcount\fR\fR
  42 .ad
  43 .RS 11n
  44 The number of times that the requested operation is to be performed. By
  45 default, \fBmt\fR performs \fIcommand\fR once. Multiple operations of
  46 \fIcommand\fR can be performed by specifying \fIcount\fR.
  47 .RE
  48 
  49 .sp
  50 .ne 2
  51 .na
  52 \fB\fIcommand\fR\fR
  53 .ad
  54 .RS 11n
  55 The following available commands that can be sent to a magnetic tape drive are
  56 supported. Only as many characters as are required to uniquely identify a
  57 \fIcommand\fR need be specified.
  58 .sp
  59 .ne 2
  60 .na
  61 \fB\fBasf\fR\fR
  62 .ad
  63 .RS 10n
  64 Specifies absolute space to \fIcount\fR file number. This is equivalent to a
  65 \fBrewind\fR followed by a \fBfsf\fR \fIcount\fR.
  66 .RE
  67 
  68 .sp
  69 .ne 2
  70 .na
  71 \fB\fBbsf\fR\fR
  72 .ad
  73 .RS 10n
  74 Back spaces over \fIcount\fR EOF marks. The tape is positioned on the
  75 beginning-of-tape side of the EOF mark.
  76 .RE
  77 
  78 .sp
  79 .ne 2
  80 .na
  81 \fB\fBbsr\fR\fR
  82 .ad
  83 .RS 10n
  84 Back spaces \fIcount\fR records.
  85 .RE
  86 
  87 .sp
  88 .ne 2
  89 .na
  90 \fB\fBbssf\fR\fR
  91 .ad
  92 .RS 10n
  93 Back spaces over the requested number of sequential file marks. Sequential file
  94 marks are where the file marks are one right after the other with no other
  95 blocks of any kind between the file marks. The number argument specifies how
  96 many sequential file marks to which to space. For example, \fBbssf 4\fR
  97 searches backwards to the first place where there are 4 sequential file marks
  98 and positions to the BOP side of the 4th file mark.
  99 .sp
 100 This command is not supported by all drives.
 101 .RE
 102 
 103 .sp
 104 .ne 2
 105 .na
 106 \fB\fBeof\fR\fR
 107 .ad
 108 .br
 109 .na
 110 \fB\fBweof\fR\fR
 111 .ad
 112 .RS 10n
 113 Writes \fIcount\fR EOF marks at the current position on the tape.
 114 .RE
 115 
 116 .sp
 117 .ne 2
 118 .na
 119 \fB\fBfsf\fR\fR
 120 .ad
 121 .RS 10n
 122 Forward spaces over \fIcount\fR EOF marks. The tape is positioned on the first
 123 block of the file.
 124 .RE
 125 
 126 .sp
 127 .ne 2
 128 .na
 129 \fB\fBfsr\fR\fR
 130 .ad
 131 .RS 10n
 132 Forward spaces \fIcount\fR records.
 133 .RE
 134 
 135 .sp
 136 .ne 2
 137 .na
 138 \fB\fBfssf\fR\fR
 139 .ad
 140 .RS 10n
 141 Forward spaces the over requested number of sequential file marks. Sequential
 142 file marks are where the file marks are one right after the other with no other
 143 blocks of any kind between the file marks. The number argument specifies how
 144 many sequential file marks to which to space. For example, \fBfssf 4\fR
 145 searches forwards to the first place where there are 4 sequential file marks
 146 and positions after the 4th file mark.
 147 .sp
 148 This command is not supported by all drives.
 149 .RE
 150 
 151 .sp
 152 .ne 2
 153 .na
 154 \fB\fBload\fR\fR
 155 .ad
 156 .RS 10n
 157 Requests drive load and thread current media. Not supported by all drives.
 158 .RE
 159 
 160 .sp
 161 .ne 2
 162 .na
 163 \fB\fBlock\fR\fR
 164 .ad
 165 .RS 10n
 166 Prevents media removal.
 167 .RE
 168 
 169 .sp
 170 .ne 2
 171 .na
 172 \fB\fBnbsf\fR\fR
 173 .ad
 174 .RS 10n
 175 Back spaces \fIcount\fR files. The tape is positioned on the first block of the
 176 file. This is equivalent to \fIcount+1\fR \fBbsf\fRs ollowed by one \fBfsf\fR.
 177 .RE
 178 
 179 .sp
 180 .ne 2
 181 .na
 182 \fB\fBseek\fR\fR
 183 .ad
 184 .RS 10n
 185 Positions to requested logical tape position.
 186 .RE
 187 
 188 .sp
 189 .ne 2
 190 .na
 191 \fB\fBtell\fR\fR
 192 .ad
 193 .RS 10n
 194 Gets and prints current logical tape position.
 195 .RE
 196 
 197 .sp
 198 .ne 2
 199 .na
 200 \fB\fBunlock\fR\fR
 201 .ad
 202 .RS 10n
 203 Allows media removal.
 204 .RE
 205 
 206 If \fIcount\fR is specified with any of the following commands, the \fIcount\fR
 207 is ignored and the command is performed only once.
 208 .sp
 209 .ne 2
 210 .na
 211 \fB\fBconfig\fR\fR
 212 .ad
 213 .RS 16n
 214 Reads the drives current configuration from the driver and displays it in
 215 \fBst.conf\fR format. See \fBst\fR(7D) for definition of fields and there
 216 meanings.
 217 .RE
 218 
 219 .sp
 220 .ne 2
 221 .na
 222 \fB\fBeom\fR\fR
 223 .ad
 224 .RS 16n
 225 Spaces to the end of recorded media on the tape. This is useful for appending
 226 files onto previously written tapes.
 227 .RE
 228 
 229 .sp
 230 .ne 2
 231 .na
 232 \fB\fBerase\fR\fR
 233 .ad
 234 .RS 16n
 235 Erases the entire tape.
 236 .sp
 237 Some tape drives have option settings where only portions of the tape can be
 238 erased. Be sure to select the correct setting to erase the whole tape. Erasing
 239 a tape can take a long time depending on the device and/or tape. Refer to the
 240 device specific manual for time details.
 241 .RE
 242 
 243 .sp
 244 .ne 2
 245 .na
 246 \fB\fBforcereserve\fR\fR
 247 .ad
 248 .RS 16n
 249 Attempts to break a SCSI II reserve issued by another initiator. When this
 250 command completes, the drive is not reserved for the current initiator, but is
 251 available for use. This command can be only be executed by those with
 252 super-user privileges.
 253 .RE
 254 
 255 .sp
 256 .ne 2
 257 .na
 258 \fB\fBoffline\fR\fR
 259 .ad
 260 .br
 261 .na
 262 \fB\fBrewoffl\fR\fR
 263 .ad
 264 .RS 16n
 265 Rewinds the tape and, if appropriate, takes the drive unit off-line by
 266 unloading the tape.
 267 .RE
 268 
 269 .sp
 270 .ne 2
 271 .na
 272 \fB\fBrelease\fR\fR
 273 .ad
 274 .RS 16n
 275 Re-establishes the default behavior of releasing at close.
 276 .RE
 277 
 278 .sp
 279 .ne 2
 280 .na
 281 \fB\fBreserve\fR\fR
 282 .ad
 283 .RS 16n
 284 Allows the tape drive to remain reserved after closing the device. The drive
 285 must then be explicitly released.
 286 .RE
 287 
 288 .sp
 289 .ne 2
 290 .na
 291 \fB\fBretension\fR\fR
 292 .ad
 293 .RS 16n
 294 Rewinds the cartridge tape completely, then winds it forward to the end of the
 295 reel and back to beginning-of-tape to smooth out tape tension.
 296 .RE
 297 
 298 .sp
 299 .ne 2
 300 .na
 301 \fB\fBrewind\fR\fR
 302 .ad
 303 .RS 16n
 304 Rewinds the tape.
 305 .RE
 306 
 307 .sp
 308 .ne 2
 309 .na
 310 \fB\fBstatus\fR\fR
 311 .ad
 312 .RS 16n
 313 Prints status information about the tape unit.
 314 .sp
 315 Status information can include the sense key reported by the drive, the
 316 residual and retries for the last operation, the current tape position reported
 317 in file number, and the number of blocks from the beginning of that file. It
 318 might also report that WORM media is loaded in that drive.
 319 .RE
 320 
 321 .RE
 322 
 323 .SH EXIT STATUS
 324 .sp
 325 .ne 2
 326 .na
 327 \fB\fB0\fR\fR
 328 .ad
 329 .RS 5n
 330 All operations were successful.
 331 .RE
 332 
 333 .sp
 334 .ne 2
 335 .na
 336 \fB\fB1\fR\fR
 337 .ad
 338 .RS 5n
 339 Command was unrecognized or \fBmt\fR was unable to open the specified tape
 340 drive.
 341 .RE
 342 
 343 .sp
 344 .ne 2
 345 .na
 346 \fB\fB2\fR\fR
 347 .ad
 348 .RS 5n
 349 An operation failed.
 350 .RE
 351 
 352 .SH FILES
 353 .sp
 354 .ne 2
 355 .na
 356 \fB\fB/dev/rmt/*\fR\fR
 357 .ad
 358 .RS 14n
 359 magnetic tape interface
 360 .RE
 361 
 362 .SH SEE ALSO
 363 .sp
 364 .LP
 365 \fBtar\fR(1), \fBtcopy\fR(1), \fBar.h\fR(3HEAD), \fBattributes\fR(5),
 366 \fBmtio\fR(7I), \fBst\fR(7D)
 367 .SH BUGS
 368 .sp
 369 .LP
 370 Not all devices support all options. Some options are hardware-dependent. Refer
 371 to the corresponding device manual page.
 372 .sp
 373 .LP
 374 \fBmt\fR is architecture sensitive. Heterogeneous operation (that is, SPARC to
 375 x86 or the reverse) is not supported.