mt

NAME

mt - magnetic tape utility

SYNOPSIS

mt [-hv] [-f tapename] [command args...]

DESCRIPTION

The mt(1) utility is used to give commands to a magnetic tape drive.

If the -h option is given, a description of the command-line argument syntax is written to standard output, and the program exits without opening the tape drive.

If the -f option is given, tapename specifies which tape drive is to be operated upon. The form for tapename must be [/dev/]ntapeN or [/dev/]tapeN, where N is a decimal digit. In this release of Interix, tapeN-type devices are treated as though they are ntapeN devices, although in future releases of Interix, mt(1) may support tapeN devices. For information on tape devices supported by Interix, see tapes(5).

If the -f option is not specified, the tape name is obtained from the TAPE environment variable. If that variable is not set, the default tape name is /dev/ntape0.

If the -v option is given, mt(1) prints a verbose description of what it is doing to standard output. To determine why mt(1) takes so long to perform some operations on your tape drive, use -v.

Following the command-line options is a command name, which can be followed by arguments.

The following commands are supported:

analyse or analyze (synonym for analyse)
Scan the tape and display information about each tape block and each file mark found on the tape.
online
Bring the tape unit online.
read file
Read the tape until a tape mark or end-of-file is reached, and store the resulting data in file. The block size used for reading the tape is the current block size, as set by
mt setblk
The command fails if the current block size is 0. The tape is not rewound after the file is read; the tape is left positioned at the tape mark or end-of-file.

The command read nul will read the tape and discard any information read; the result is to forward space to the next tape mark.

The file argument must use Windows path syntax (for example, C:\winnt\notepad.exe). In future releases of Interix, the mt(1) utility read command will support Interix path syntax.

rewind
Rewind the tape.
setblk count
Set the block size of the drive to count bytes per record. A count of 0 means variable length blocks. Use
mt status
to determine the minimum, maximum, and default block size (this is part of the "tape drive" information), and the current block size (this is part of the "tape media" information).
setcmp switch
If switch is set to 1, turn on hardware data compression; if switch is set to 0, turn off hardware data compression.
status
Print tape-drive and tape-media parameters to stdout.

DIAGNOSTICS

The mt(1) utility has an exit status of 0 on success, 1 on a syntax error interpreting command line arguments, and 2 on a tape error.

SEE ALSO

dd(1)

tapes(5)