---
name: "ftmt"
section: "1"
platform: "linux"
package: "ftape-util"
version: "1:1.09.2002.03.21-0.3"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/ftmt"
---

# ftmt(1)

control magnetic tape drive operation

## NAME

mt - control magnetic tape drive operation

## SYNOPSIS

**mt** \[-V\] \[-f device\] \[--file=device\] \[--version\] operation \[count\]

## DESCRIPTION

This manual page documents the GNU version of **mt**. **mt** performs the given *operation*, which must be one of the tape operations listed below, on a tape drive.

The default tape device to operate on is taken from the file */usr/include/sys/mtio.h* when **mt** is compiled.  It can be overridden by giving a device file name in the environment variable **TAPE** or by a command line option (see below), which also overrides the environment variable.

The device must be either a character special file or a remote tape drive.  To use a tape drive on another machine as the archive, use a filename that starts with \`HOSTNAME:'.  The hostname can be preceded by a username and an \`@' to access the remote tape drive as that user, if you have permission to do so (typically an entry in that user's \`~/.rhosts' file).

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. Some operations optionally take a repeat count, which can be given after the operation name and defaults to 1.

- asf

  Absolute space to file number *count*. Equivalent to rewind followed by fsf *count*.

- eof, weof

  Write *count* EOF marks at current position.

- eom, seod

  Space to the end of the recorded media on the tape (for appending files onto tapes).

- erase

  Erase the tape. Old versions of the floppy tape driver **ftape** required that the tape had to be erased before EOF marks could be used. Recent versions of **zftape** no longer have this restriction.

- fsf

  Forward space over *count* EOF marks. The tape is positioned at the end-of-the-tape side of the EOF mark.

- bsf

  Backward space over *count* EOF marks. The tape then is positioned on the end-of-the-tape side of the last skipped EOF mark, i.e. **mt bsf 1** (equivalent to **mt bsf** ) always stays within the same tape volume and has the effect to position the tape at the beginning of the current volume.

- fsfm

  Forward space over *count* file marks. The tape is positioned on the beginning-of-the-tape side of the last skipped file mark.

- bsfm

  Backward space over *count* file marks. The tape is positioned on the beginning-of-the-tape side of the last skipped file mark.

- fsr

  Forward space *count* records.

- bsr

  Backward space *count* records.

- offline, rewoffl

  Rewind the tape and, if applicable, unload the tape. For the **ftape** floppy tape driver this has the effect of the a soft eject: the tape driver will reject all operations with the exception of a reset command until a new cartridge is inserted. A reset command has the same effect for the **ftape** driver as inserting a new cartridge.

- ras1

  Run self test 1 (non-destructive). Implemented on some QIC-02 drives.

- ras2

  Run self test 2 (destructive). Implemented on some QIC-02 drives.

- ras3

  Run self test 3 (reserved).

- reset

  Reset the drive in case of problems.

- retension

  Rewind the tape, then wind it to the end of the reel, then rewind it again.

- rewind

  Rewind the tape. When using the **ftape** floppy tape driver, one always should issue this command (or **offline, rewoffl** ) before removing a cartridge, because **ftape** caches information that has to be stored in the header segments of a floppy tape cartridge.

- seek

  Seek to the *count* th block of the tape (absolute from BOT, Tandberg tape drives, relative to the current file resp. volume for zftape QIC-117 floppy tape driver)

- setblk

  Set the length of a tape block to *count bytes (SCSI tapes and zftape-driver for QIC-117 floppy-tapes).* A value of 0 means to select variable block size mode.

- getblk

  Get the length of tape blocks (zftape-driver for QIC-117 floppy-tapes) in bytes.

- setdensity

  Set the tape density according to *count* for SCSI tapes. For the **zftape** version of the **ftape** floppy tape driver for Linux, this has the special meaning to set the trace level that specifies the amount of debugging output printed to the system log files.

- setdrvbuffer

  Set the drive buffering according to SCSI-2. For **zftape** this has the special meaning to set the number of 32kb dma buffers the driver uses.

- status

  Print status information about the tape unit. Usually this results in sending an *MTNOP* MTIOCTOP command to the tape drive followed by a  *MTSTATUS* command. This version of  **mt** also sends a *MTIOCVOLINFO* ioctl to get information about the current volume and a  *MTIOCGETSIZE* command to query the capacity of the inserted tape catridge. These two are special ioctls supported by the **zftape** floppy tape device driver for **Linux.**

- tell

  Tell the current block-number (zftape QIC-117 driver, Tandberg  tapedrives, for zftape relative to the current file resp. volume).

- getseg

  Read an arbitrary segment, including the header segments, of a floppy  tape drive (zftape QIC-117 floppy tape driver). This results in up to  29kb of data written to stdout (don't forget to redirect stdout to a file).

- getsize

  Query the tape capacity of the tape cartridge (zftape QIC-117 floppy tape  driver). This results in printing the total data capacity, the used data  capacity and the remaining data capacity.

**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

- *-f, --file=device*

  Use *device* as the file name of the tape drive to operate on. To use a tape drive on another machine, use a filename that starts with \`HOSTNAME:'.  The hostname can be preceded by a username and an \`@' to access the remote tape drive as that user, if you have permission to do so (typically an entry in that user's \`~/.rhosts' file).

- *-V, --version*

  Print the version number of **mt**.
