Manual browser: mt(1)
|MT(1)||General Commands Manual||MT(1)|
NAMEmt — magnetic tape manipulation
|mt||[-f tapename] command [count]|
DESCRIPTIONThe mt program is used to give commands to a magnetic tape drive. By default mt performs the requested operation once. Operations may be performed multiple times by specifying count.
Note that tapename must reference a raw (not block) tape device. If tapename is of the form “host:tapename”, or “user@host:tapename”, mt writes to the named tape device on the remote host using rmt(8).
The rmt(8) process on the remote host is typically initiated via rsh(1), although an alternate method such as ssh(1) can be specified via the RCMD_CMD environment variable.
The available commands are listed below. Only as many characters as are required to uniquely identify a command need be specified.
- Move forward count files from the beginning of the tape. This is accomplished by a rewind followed by fsf count.
- eof, weof
- Write count end-of-file marks at the current position on the tape.
- Forward space count files.
- Forward space count records.
- Back space count files.
- Back space count records.
- Rewind the tape. (The count is ignored.)
- offline, rewoffl
- Rewind the tape and place the tape unit off-line. Where supported, this ejects the tape. (The count is ignored.)
- Print status information about the tape unit. (The count is ignored.)
- Retensions the tape. Not all tape drives support this feature. (The count is ignored.)
- Erases the tape Not all tape drives support this feature. (The count is ignored.)
- Enable or disable early warning EOM behaviour. Set count to nonzero to enable, zero to disable.
- Forward space to the end of recorded media. (The count is ignored.)
- blocksize, setblk
- Set the tape blocksize to count bytes. A count of zero sets variable blocksize.
- density, setdensity
- Set the tape density code to count as specified in the SCSI-3 specification. See the DENSITY CODES section for a list of codes for commonly used media types.
- Read the logical block position of the tape. Not all tape drives support this feature. (The count is ignored.)
- Read the hardware block position of the tape. Not all tape drives support this feature. (The count is ignored.)
- Set the logical block position of the tape to count. Not all tape drives support this feature.
- Set the hardware block position of the tape to count. Not all tape drives support this feature.
- If count is zero, disable compression. Otherwise enable compression. Not all tape drives support this feature.
If a tape name is not specified, and the environment variable TAPE is not set, then mt uses the device /dev/nrst0.
ENVIRONMENTIf the following environment variables exist, they are used by mt.
- mt uses device filename given in the TAPE environment variable if the tapename argument is not given.
- mt will use RCMD_CMD rather than /usr/bin/rsh to invoke rmt(8) on a remote machine. The full path name must be specified.
- Raw SCSI tape device
- Raw magnetic tape device
EXIT STATUSmt returns a 0 exit status when the operation(s) were successful, 1 if the command was unrecognized, and 2 if an operation failed.
DENSITY CODESThe SCSI-3 specification defines a number of density codes for various tape media, some of which are listed here. Note that many tape drive vendors also define model-specific codes.
||1/2" 800 bpi|
||1/2" 1600 bpi|
||1/2" 6250 bpi|
SEE ALSOdd(1), ioctl(2), mtio(4), st(4), environ(7)
HISTORYThe mt utility appeared in 4.3BSD.
|March 9, 2008||NetBSD 7.0|