1.\" Copyright (c) 1981, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. All advertising materials mentioning features or use of this software 14.\" must display the following acknowledgement: 15.\" This product includes software developed by the University of 16.\" California, Berkeley and its contributors. 17.\" 4. Neither the name of the University nor the names of its contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" SUCH DAMAGE. 32.\" 33.\" @(#)mt.1 8.1 (Berkeley) 6/6/93 34.\" 35.Dd June 6, 1993 36.Dt MT 1 37.Os BSD 4 38.Sh NAME 39.Nm mt 40.Nd magnetic tape manipulating program 41.Sh SYNOPSIS 42.Nm 43.Op Fl f Ar tapename 44.Ar command 45.Op Ar count 46.Sh DESCRIPTION 47.Nm Mt 48is used to give commands to a magnetic tape drive. 49By default 50.Nm 51performs the requested operation once. Operations 52may be performed multiple times by specifying 53.Ar count . 54Note 55that 56.Ar tapename 57must reference a raw (not block) tape device. 58.Pp 59The available commands are listed below. Only as many 60characters as are required to uniquely identify a command 61need be specified. 62.Bl -tag -width "eof, weof" 63.It Cm weof 64Write 65.Ar count 66end-of-file marks at the current position on the tape. 67.It Cm fsf 68Forward space 69.Ar count 70files. 71.It Cm fsr 72Forward space 73.Ar count 74records. 75.It Cm bsf 76Back space 77.Ar count 78files. 79.It Cm bsr 80Back space 81.Ar count 82records. 83.It Cm rewind 84Rewind the tape 85(Count is ignored). 86.It Cm offline , rewoffl 87Rewind the tape and place the tape unit off-line 88(Count is ignored). 89.It Cm erase 90Erase the tape 91(Count is ignored). 92.It Cm retension 93Re-tension the tape 94(one full wind forth and back, Count is ignored). 95.It Cm status 96Print status information about the tape unit. 97.It Cm blocksize 98Set the block size for the tape unit. Zero means variable-length 99blocks. 100.It Cm density 101Set the density for the tape unit. For the density codes, see below. 102The density value could be given either numerically, or as a string, 103corresponding to the 104.Dq Reference 105field. If the string is abbreviated, it will be resolved in the order 106shown in the table, and the first matching entry will be used. If the 107given string and the resulting canonical density name do not match 108exactly, an informational message is printed about what the given 109string has been taken for. 110.It Cm eom 111Forward space to end of recorded medium 112(Count is ignored). 113.It Cm eod 114Forward space to end of data, identical to 115.Cm eom . 116.It Cm comp 117Set compression mode. 118(The kernel counterpart of this has not yet been reported to work 119correctly.) 120.El 121.Pp 122If a tape name is not specified, and the environment variable 123.Ev TAPE 124does not exist; 125.Nm 126uses the device 127.Pa /dev/nrst0 . 128.Pp 129.Nm Mt 130returns a 0 exit status when the operation(s) were successful, 1311 if the command was unrecognized, and 2 if an operation failed. 132.Pp 133The different density codes are as follows: 134.Pp 135.Dl 0x0 default for device 136.Dl 0xE reserved for ECMA 137.Bd -literal -offset indent 138Value Tracks Density(bpi) Code Type Reference Note 1390x1 9 800 NRZI R X3.22-1983 2 1400x2 9 1600 PE R X3.39-1986 2 1410x3 9 6250 GCR R X3.54-1986 2 1420x5 4/9 8000 GCR C X3.136-1986 1 1430x6 9 3200 PE R X3.157-1987 2 1440x7 4 6400 IMFM C X3.116-1986 1 1450x8 4 8000 GCR CS X3.158-1986 1 1460x9 18 37871 GCR C X3B5/87-099 2 1470xA 22 6667 MFM C X3B5/86-199 1 1480xB 4 1600 PE C X3.56-1986 1 1490xC 24 12690 GCR C HI-TC1 1,5 1500xD 24 25380 GCR C HI-TC2 1,5 1510xF 15 10000 GCR C QIC-120 1,5 1520x10 18 10000 GCR C QIC-150 1,5 1530x11 26 16000 GCR C QIC-320(525?) 1,5 1540x12 30 51667 RLL C QIC-1350 1,5 1550x13 1 61000 DDS CS X3B5/88-185A 4 1560x14 1 43245 RLL CS X3.202-1991 4 1570x15 1 45434 RLL CS ECMA TC17 4 1580x16 48 10000 MFM C X3.193-1990 1 1590x17 48 42500 MFM C X3B5/91-174 1 160.Ed 161 162where Code means: 163.Bd -literal -offset indent 164NRZI Non Return to Zero, change on ones 165GCR Group Code Recording 166PE Phase Encoded 167IMFM Inverted Modified Frequency Modulation 168MFM Modified Frequency Modulation 169DDS Dat Data Storage 170RLL Run Length Encoding 171.Ed 172 173where Type means: 174.Bd -literal -offset indent 175R Reel-to-Reel 176C Cartridge 177CS cassette 178.Ed 179 180where Notes means: 181.Bd -literal -offset indent 1821 Serial Recorded 1832 Parallel Recorded 1843 Old format know as QIC-11 1854 Helical Scan 1865 Not ANSI standard, rather industry standard. 187.Ed 188 189.Sh ENVIRONMENT 190If the following environment variable exists, it is utilized by 191.Nm mt . 192.Bl -tag -width Fl 193.It Ev TAPE 194.Nm Mt 195checks the 196.Ev TAPE 197environment variable if the 198argument 199.Ar tapename 200is not given. 201.Sh FILES 202.Bl -tag -width /dev/*rst[0-9]*xx -compact 203.It Pa /dev/*rwt* 204QIC-02/QIC-36 magnetic tape interface 205.It Pa /dev/*rst[0-9]* 206SCSI magnetic tape interface 207.El 208.Sh SEE ALSO 209.Xr dd 1 , 210.Xr ioctl 2 , 211.Xr mtio 4 , 212.Xr st 4 , 213.Xr wt 4 , 214.Xr environ 7 215.Sh HISTORY 216The 217.Nm 218command appeared in 219.Bx 4.3 . 220.Pp 221Extensions regarding the 222.Xr st 4 223driver appeared in 386BSD 0.1 as a separate 224.Xr st 1 225command, and have been merged into the 226.Nm 227command in 228.Fx 2.1 . 229.Pp 230The former 231.Cm eof 232command that used to be a synonym for 233.Cm weof 234has been abandoned in 235.Fx 2.1 236since it was often confused with 237.Cm eom , 238which is fairly dangerous. 239