mt(1) mt(1)NAME mt - manipulates magnetic tape media SYNOPSIS mt [-fdevice-file] command [count] ARGUMENTS command Specifies the command that you want the tape device to perform. Supported commands are bsf, bsr, eof, format, fsf, fsr, offline, rewind, rewoffl, status, and weof. (For more information, see the next section, ``Description.'') count Specifies the number of times that command should be performed. If you don't supply a count value, it defaults to 1. If specified, this value is ignored for the rewind and format commands. -fdevice-file Specifies the raw device file that corresponds to the desired device. Your choices are limited to the device files in the directory /dev/rmt that reference the port or SCSI ID through which the tape drive is connected. Note that device-file must be a device file for a character tape device driver. The r in rmt indicates ``raw,'' which has the same meaning as ``character'' in terms of device drivers. DESCRIPTION mt sends commands that you specify to manipulate a magnetic tape drive. These commands generate the corresponding device I/O controls, such as read and write, as described for the generic tape interface in mtio(7). If device-file is not specified with the -f option, the environment variable TAPE is used; if TAPE does not exist, mt attempts to use the device referenced by /dev/rmtc. To make this default file a useful reference to a tape device, you need to create it by establishing it as a link to an existing device file in /dev/rmt (see mtio(7) and ln(1)). Device Commands The following list contains device commands that you can specify. You only need to specify as many characters as are necessary to uniquely identify a command within the set. bsf Moves the tape media backwards the number of files indicated by count. bsr Moves the tape media backwards the number of records indicated by count. March 1993 1
mt(1) mt(1)eof weof Writes one or more end-of-file markers at the current position on the tape, based on the value of count. format Formats a tape cartridge This command applies only to /dev/rmt/tcx* device files that represent the Apple Tape Backup 40SC and those that represent a DDS-DC DAT drive. fsf Moves the tape media forward the number of files indicated by count. fsr Moves the tape media forward the number of records indicated by count. offline rewoffl Rewinds the tape and places the tape unit off line If specified, the value of count is ignored. rewind Rewinds the tape If specified, the value of count is ignored. status Displays status information about the tape unit. Note: The number reported as the available space does not give any consideration to media defects, which may reduce the usable space. You should subtract about 5 percent of the total tape capacity to determine the ``usable capacity'' that allows for skipping over defects. fsr and bsr Records For the fsr and bsr commands, records are equivalent to 8192 KB for tape drives. The exceptions are nine-track tape drives, which can use a variable size record that you specify on the command line during write operations; For read operations, such as bsr and fsr, the tape driver determines the record size from the recorded data. The record size should not be confused with the physical block size of the tape unit, which could be anywhere in the range of .5 KB (512 bytes) to 8192 KB. Accordingly, the number reported by the status command as the maxblk amount is equivalent to the maximum number of 8192 KB blocks on the tape media, unless a nine-track drive was queried. 2 March 1993
mt(1) mt(1)STATUS MESSAGES AND VALUES The mt program returns a 0 exit status if count invocations of the specified command were successful, 1 if the specified command was not recognized, and 2 if any invocation of the specified command failed. FILES /dev/rmt/* Raw magnetic tape device files SEE ALSO ioctl(2), environ(5), mtio(7) in A/UX Programmer's Reference March 1993 3