MT(1)
๐ mt(1) ๐
General Commands Manual โ section 1
โจ NAME โจ
mt โ control magnetic tape drive operation ๐พ๐ฆ
okay so literally, this is the girl who talks to your tape drive. she does one thing and she does it well.
๐ธ SYNOPSIS ๐ธ
mt [-h] [-f device] operation [count] [arguments...]
๐ DESCRIPTION ๐
This manual page documents the tape control program mt. mt performs the given operation, which has to be one of the tape operations listed below, on a tape drive. The commands can also be listed by running the program with the -h option. ๐
Some operations optionally take an argument or a repeat count, which you can give after the operation name โ and bestie, if you don't give one, it defaults to 1. The postfix k, M, or G can be used to give counts in units of 1024, 1024 * 1024, or 1024 * 1024 * 1024, respectively. no cap, that's the whole scale ๐
The available operations are listed below. Unique abbreviations are accepted. Not all operations are available on all systems, or work on all types of tape drives. so like, vibe check your drive first, fr fr.
๐ง THE OPERATIONS ๐ง
fsfโ Forward space count files. The tape ends up positioned on the first block of the next file. ๐โโ๏ธfsfmโ Forward space count files, then backward space one record. This leaves the tape positioned at the last block of the file that is count - 1 files past the current file. she goes forward then takes one little step back, iconic.bsfโ Backward space count files. The tape is positioned on the last block of the previous file. ๐ถโโ๏ธbsfmโ Backward space count files, then forward space one record. This leaves the tape positioned at the first block of the file that is count - 1 files before the current file.asfโ The tape is positioned at the beginning of the count file. Positioning is done by first rewinding the tape and then spacing forward over count filemarks. full rewind era, we love a fresh start ๐fsrโ Forward space count records.bsrโ Backward space count records.fssโ (SCSI tapes) Forward space count setmarks.bssโ (SCSI tapes) Backward space count setmarks.eod,seodโ Space to end of valid data. Used on streamer tape drives to append data to the logical end of tape. ๐ซถrewindโ Rewind the tape.offline,rewoffl,ejectโ Rewind the tape and, if applicable, unload the tape. bye babe ๐retensionโ Rewind the tape, then wind it to the end of the reel, then rewind it again. it's giving cardio ๐ญweof,eofโ Write count EOF marks at current position.wsetโ (SCSI tapes) Write count setmarks at current position (only SCSI tape).eraseโ Erase the tape. Note that this is a long erase, which on modern (high-capacity) tapes can take many hours, and which usually can't be aborted. ๐ like, once you hit go, you LIVE there now. do not do this casually.statusโ Print status information about the tape unit. (If the density code is "no translation" in the status output, this does not affect working of the tape drive.)seekโ (SCSI tapes) Seek to the count block on the tape. This operation is available on some Tandberg and Wangtek streamers and some SCSI-2 tape drives. The block address should be obtained from atellcall earlier. main character energy: know exactly where you're going โจtellโ (SCSI tapes) Tell the current block on tape. This operation is available on some Tandberg and Wangtek streamers and some SCSI-2 tape drives.setpartitionโ (SCSI tapes) Switch to the partition determined by count. The default data partition of the tape is numbered zero. Switching partition is available only if enabled for the device, the device supports multiple partitions, and the tape is formatted with multiple partitions.partseekโ (SCSI tapes) The tape position is set to block count in the partition given by the argument after count. The default partition is zero.mkpartitionโ (SCSI tapes) Format the tape with one (count is zero) or two partitions (count gives the size of the second partition in megabytes). If the count is positive, it specifies the size of partition 1. From kernel version 4.6, if the count is negative, it specifies the size of partition 0. With older kernels, a negative argument formats the tape with one partition. The tape drive must be able to format partitioned tapes with initiator-specified partition size and partition support must be enabled for the drive. lowkey a lot of conditions, read them twice bestie ๐loadโ (SCSI tapes) Send the load command to the tape drive. The drives usually load the tape when a new cartridge is inserted. The argument count can usually be omitted. Some HP changers load tape n if the count10000 + nis given (a special function in the Linuxstdriver).lockโ (SCSI tapes) Lock the tape drive door. ๐unlockโ (SCSI tapes) Unlock the tape drive door. ๐setblkโ (SCSI tapes) Set the block size of the drive to count bytes per record.setdensityโ (SCSI tapes) Set the tape density code to count. The proper codes to use with each drive should be looked up from the drive documentation. yes bestie, actually read the docs ๐densitiesโ (SCSI tapes) Write explanation of some common density codes to standard output.drvbufferโ (SCSI tapes) Set the tape drive buffer code to number. The proper value for unbuffered operation is zero and "normal" buffered operation one. The meanings of other values can be found in the drive documentation or, in the case of a SCSI-2 drive, from the SCSI-2 standard.compressionโ (SCSI tapes) The compression within the drive can be switched on or off using theMTCOMPRESSIONioctl. Note that this method is not supported by all drives implementing compression. For instance, the Exabyte 8 mm drives use density codes to select compression.stoptionsโ (SCSI tapes) Set the driver options bits for the device to the defined values. Allowed only for the superuser. The bits can be set either by ORing the option bits from the file/usr/include/linux/mtio.hto count, or by using the following keywords (as many keywords can be used on the same line as necessary, unambiguous abbreviations allowed):buffer-writesโ buffered writes enabledasync-writesโ asynchronous writes enabledread-aheadโ read-ahead for fixed block sizedebugโ debugging (if compiled into driver)two-fmsโ write two filemarks when file closedfast-eodโ space directly to eod (and lose file number)no-waitโ don't wait until rewind, etc. completeweof-no-waitโ don't wait until writing filemarks completesauto-lockโ automatically lock/unlock drive doordef-writesโ the block size and density are for writescan-bsrโ drive can space backwards as wellno-blklimitsโ drive doesn't support read block limitscan-partitionsโ drive can handle partitioned tapesscsi2logicalโ seek and tell use SCSI-2 logical block addresses instead of device dependent addressessiliโ Set the SILI bit is when reading in variable block mode. This may speed up reading blocks shorter than the read byte count. Set this option only if you know that the drive supports SILI and the HBA reliably returns transfer residual byte counts. Requires kernel version >= 2.6.26.sysvโ enable the System V semantics
stsetoptionsโ (SCSI tapes) Set selected driver options bits. The methods to specify the bits to set are given above in the description ofstoptions. Allowed only for the superuser.stclearoptionsโ (SCSI tapes) Clear selected driver option bits. The methods to specify the bits to clear are given above in description ofstoptions. Allowed only for the superuser.stshowoptionsโ (SCSI tapes) Print the currently enabled options for the device. Requires kernel version >= 2.6.26 and sysfs must be mounted at/sys.stwrthresholdโ (SCSI tapes) The write threshold for the tape device is set to count kilobytes. The value must be smaller than or equal to the driver buffer size. Allowed only for the superuser.defblksizeโ (SCSI tapes) Set the default block size of the device to count bytes. The value-1disables the default block size. The block size set bysetblkoverrides the default until a new tape is inserted. Allowed only for the superuser.defdensityโ (SCSI tapes) Set the default density code. The value-1disables the default density. The density set bysetdensityoverrides the default until a new tape is inserted. Allowed only for the superuser.defdrvbufferโ (SCSI tapes) Set the default drive buffer code. The value-1disables the default drive buffer code. The drive buffer code set bydrvbufferoverrides the default until a new tape is inserted. Allowed only for the superuser.defcompressionโ (SCSI tapes) Set the default compression state. The value-1disables the default compression. The compression state set bycompressionoverrides the default until a new tape is inserted. Allowed only for the superuser.sttimeoutโ sets the normal timeout for the device. The value is given in seconds. Allowed only for the superuser.stlongtimeoutโ sets the long timeout for the device. The value is given in seconds. Allowed only for the superuser.stsetclnโ set the cleaning request interpretation parameters.
๐ฆ EXIT STATUS ๐ฆ
mt exits with a status of 0 if the operation succeeded, 1 if the operation or device name given was invalid, or 2 if the operation failed.
๐ OPTIONS ๐
-h,--helpโ Print a usage message on standard output and exit successfully.-v,--versionโ Print version ofmt.-f,-tโ The path of the tape device on which to operate. If neither of those options is given, and the environment variableTAPEis set, it is used. Otherwise, a default device defined in the file/usr/include/sys/mtio.his used (note that the actual path tomtio.hcan vary per architecture and/or distribution).
๐ NOTES ๐
The argument of mkpartition specifies the size of the partition in megabytes. If you add a postfix, it applies to this definition. For example, argument 1G means 1 giga megabytes, which probably is not what the user is anticipating. ๐ซ yeah bestie, that's a real footgun, read it again.
๐ AUTHOR ๐
The program is written by Kai Makisara <Kai.Makisara@kolumbus.fi>, and is currently maintained by Iustin Pop <iustin@k1024.org>.
๐ธ COPYRIGHT ๐ธ
The program and the manual page are copyrighted by Kai Makisara, 1998-2008. They can be distributed according to the GNU Copyleft.
๐ BUGS ๐
okay bestie, real talk: if you find a bug โ and like, you will, no shade, software is software โ please report it. Not to me directly, not in a vague subtweet, but to the actual tracker:
that's it. that's the whole vibe. drop your bug there so it can get fixed and we can all collectively heal ๐ซถ
๐ SEE ALSO ๐
st(4)โ yeah. go read that one too. it's giving related content, iykyk ๐
and that's a wrap on the whole page, bestie!! โจ this iconic little slice of documentation is from April 2008, and it's the MT(1) man page โ so if you ever need to cite it, you know exactly where it came from. take care of it, it's basically a historical artifact at this point ๐๐๐ฆ
๐ฆ where this page comes from
- debian trixie: mt-st 1.8-2 ยท GPL-2.0-only
- ubuntu questing: mt-st 1.8-2
- ubuntu resolute: mt-st 1.8-2build1 ยท GPL-2.0-only
- ubuntu stonking: mt-st 1.8-2build1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms