mt
controls magnetic tape drive operations, commonly used with LTO and other SCSI
TLDR
Check status of a tape drive
SYNOPSIS
mt [-f device] operation [count]
DESCRIPTION
mt controls magnetic tape drive operations, commonly used with LTO (Linear Tape-Open) and other SCSI tape drives. It provides commands for positioning, rewinding, ejecting, and writing control marks on tape media.
The device is specified with -f option or via the TAPE environment variable. Use /dev/nstX for non-rewinding devices (preserves position after operations) or /dev/stX for auto-rewinding devices.
PARAMETERS
-f _device_, -t _device_
Specify tape device (e.g., /dev/nst0, /dev/st0)-h
List available commands-v, --version
Display version information
OPERATIONS
status
Print tape drive status and positionrewind
Rewind tape to beginningfsf _count_
Forward space specified number of filesbsf _count_
Backward space specified number of filesfsr _count_
Forward space specified number of recordsbsr _count_
Backward space specified number of recordsasf _count_
Rewind and position at beginning of specified fileeod, seod
Space to end of valid dataweof _count_, eof
Write EOF (end-of-file) markseject, offline, rewoffl
Rewind and unload/eject tapeerase
Erase entire tape (long operation)retension
Rewind, wind to end, rewind again (conditions tape)seek _block_
Seek to specified block number (SCSI)tell
Print current block number (SCSI)
CAVEATS
Tape operations can be slow, especially erase and retension. Using the wrong device (st vs nst) can cause unexpected tape rewinding. Some operations are SCSI-specific. Ensure correct device permissions for non-root access.
HISTORY
mt (magnetic tape) has been a standard Unix utility since early Unix systems for controlling tape drives. The Linux version supports additional SCSI tape features beyond traditional operations.
