Linux and Unix mt command

Quick links

About mt
Syntax
Related commands
Linux and Unix main page

About mt

Magnetic tape control.

Syntax

mt [ -f tapename ] command  [ count ]

-f tapenameSpecify the raw tape device.
commandAvailable commands that can be sent to a magnetic
tape drive. Only as many characters as are
required to uniquely identify a command need be
specified.
eof, weofWrite count EOF marks at the current position on the tape.
fsfForward space over count EOF marks. The tape is positioned on the first block of the file.
fsrForward space count records.
bsfBack space over count EOF marks. The tape is positioned on the beginning-of-tape side of the EOF mark.
bsrBack space count records.
nbsfBack space count files. The tape is positioned on the first block of the
file. This is equivalent to count+1 bsf's followed by one fsf.
asfAbsolute space to count file number. This is equivalent to a rewind followed by a fsf count.

If count is specified with any of the following commands, the count is ignored and the command is performed only once.

eomSpace to the end of recorded media on the tape. This is useful for appending files onto previously written tapes.
rewindRewind the tape.
offline, rewofflRewind the tape and, if appropriate, take the drive unit off-line by unloading the tape. It cycles through all four tapes.
statusPrint status information about the tape unit.
retensionRewind the cartridge tape completely, then wind it forward to the end of the reel and back to beginning-of-tape to smooth out tape tension.
reserveAllow the tape drive to remain reserved after closing the device. The drive must then be explicitly released.
releaseRe-establish the default behavior of releasing at close.
forcereserveBreak the reservation of the tape drive held by another host and then reserve the tape drive. This command can be executed only with super-user privileges.
eraseErase the entire tape. Erasing a tape may take a long time depending on the device or tape. Refer to the device specific manual for time details.
countThe number of times that the requested operation is to be performed. By default, mt performs command once; multiple operations of command may be performed by specifying count.

Related commands

tar
tcopy