Go to the first, previous, next, last section, table of contents.


The mt Utility

@UNREVISED

@FIXME{Is it true that this only works on non-block devices? should explain the difference, (fixed or variable).} See section The Blocking Factor of an Archive.

You can use the mt utility to advance or rewind a tape past a specified number of archive files on the tape. This will allow you to move to the beginning of an archive before extracting or reading it, or to the end of all the archives before writing a new one. @FIXME{Why isn't there an "advance 'til you find two tape marks together"?}

The syntax of the mt command is:

mt [-f tapename] operation [number]

where tapename is the name of the tape device, number is the number of times an operation is performed (with a default of one), and operation is one of the following:

@FIXME{is there any use for record operations?}

eof
weof
Writes number tape marks at the current position on the tape.
fsf
Moves tape position forward number files.
bsf
Moves tape position back number files.
rewind
Rewinds the tape. (Ignores number).
offline
rewoff1
Rewinds the tape and takes the tape device off-line. (Ignores number).
status
Prints status information about the tape unit.

@FIXME{Is there a better way to frob the spacing on the list?}

If you don't specify a tapename, mt uses the environment variable TAPE; if TAPE does not exist, mt uses the device `/dev/rmt12'.

mt returns a 0 exit status when the operation(s) were successful, 1 if the command was unrecognized, and 2 if an operation failed.

@FIXME{New node on how to find an archive?}

If you use --extract (--get, -x) with the --label=archive-label (-V archive-label) option specified, tar will read an archive label (the tape head has to be positioned on it) and print an error if the archive label doesn't match the archive-name specified. archive-name can be any regular expression. If the labels match, tar extracts the archive. See section Including a Label in the Archive. @FIXME-xref{Matching Format Parameters}. @FIXME{fix cross references} `tar --list --label' will cause tar to print the label.

@FIXME{Program to list all the labels on a tape?}


Go to the first, previous, next, last section, table of contents.