LinuxCommandLibrary

mt-gnu

Control magnetic tape drives

SYNOPSIS

mt-gnu [-f device] operation [count]

PARAMETERS

-f device
    Specifies the tape device to operate on, e.g., /dev/st0. If omitted, the TAPE environment variable or /dev/tape is used.

operation
    The action to perform on the tape drive. Common operations include rewind, offline, fsf, bsr, status, etc.

count
    An optional integer argument for operations like fsf (forward space file) or bsr (backward space record), specifying how many files/records to skip.

rewind
    Rewinds the tape to its beginning.

offline or rewoffl
    Rewinds the tape and takes the drive offline, often ejecting the tape.

eject
    Ejects the tape from the drive.

fsf
    Forward spaces count file marks.

bsf
    Backward spaces count file marks.

fsr
    Forward spaces count records.

bsr
    Backward spaces count records.

status
    Prints the status information of the tape drive.

retension
    Winds the tape to the end and then rewinds it, improving tension.

DESCRIPTION

The mt-gnu command, often a symbolic link to or a specific build of the standard mt (magnetic tape) utility, provides an interface for controlling magnetic tape devices. It allows system administrators and users to perform various low-level operations on tape drives, such as rewinding, ejecting, skipping records or files, and querying the drive's status. This utility is crucial for managing tape backups, archiving data, and interacting directly with tape hardware. Unlike file system commands, mt-gnu operates on the raw tape device, manipulating its position and state. It is a fundamental tool in environments utilizing tape storage for data retention and disaster recovery. The "gnu" suffix typically denotes its origin or adherence to GNU standards, often part of the mt-st package.

CAVEATS

Using mt-gnu requires appropriate permissions on the tape device file (e.g., read/write access). Incorrect usage, especially with operations like fsf or bsr, can lead to data loss or inability to locate desired data on the tape. Always ensure the correct device file is specified. Be aware of rewinding (/dev/st0) vs. non-rewinding (/dev/nst0) device paths. Physical tape must be loaded for operations.

<I>NON-REWINDING DEVICES</I>

For operations that should not rewind the tape automatically after each command, use the non-rewinding device node, typically named /dev/nstX (e.g., /dev/nst0). This is crucial for multi-file archives where you want to read subsequent files without repositioning the tape.

<I>PERMISSIONS AND DEVICE FILES</I>

Tape devices are typically located in /dev/ (e.g., /dev/st0 for the first SCSI tape drive). Users performing mt-gnu operations must have read and write permissions on these device files, usually achieved by being part of the 'tape' or 'disk' group, or by using sudo.

HISTORY

The mt utility has been a standard component of Unix-like operating systems for controlling magnetic tape drives since their early days. The mt-gnu variant specifically refers to the version provided by the GNU project, often distributed as part of the mt-st (Magnetic Tape SCSI Tape) tools. This package provides enhanced features and better compatibility across various Linux distributions, ensuring robust control over SCSI and other modern tape drives. Its development follows the general evolution of GNU core utilities, focusing on reliability and adherence to open standards.

SEE ALSO

mt(1), tar(1), dd(1), cpio(1), ftape(4)

Copied to clipboard