mt(1)mt(1)NAMEmt - Magnetic tape manipulating program
SYNOPSISmt [-f tape_device] command [count]
The mt program gives commands to a magnetic tape drive.
OPTIONS
This option specifies the tape device to be manipulated. This option
specifies the number of times that the operation is to be repeated.
DESCRIPTION
If you do not specify a tape name with the -f option, the TAPE environ‐
ment variable is used; if TAPE does not exist, mt uses the
/dev/ntape/tape0_d1 device. Note that tape_device must refer to a raw
(not block) tape device. By default, mt performs the requested opera‐
tion once. You can perform operations more than once using the count
option.
The following commands are available: Backspaces count files.
Backspaces count records. Writes count End-of-File marks at the cur‐
rent position on the tape. Forward spaces count files. Forward spaces
count records. This option prepares a SCSI tape for loading into the
device. Not all SCSI tape drives support this command. Rewinds the
tape and places the tape unit offline (count is ignored). Bring a SCSI
tape to the ready state if a tape is in the tape path. Currently, this
command is only supported in the SCSI/CAM tape driver. Not all SCSI
tape drives support this functionality. Rewinds the tape (count is
ignored). Sets the tape at the specified read position coordinates.
The data obtained when using the rdpos option can be used as an argu‐
ment to the seek or seekds commands.
Use the following options with the rdpos command: The read posi‐
tion short format. This option requires a tape coordinate argu‐
ment in the following syntax: # mt-f /dev/ntape/tape1 rdpos s
READ POSITION short format
First block: 3 (0x3)
Last block: 0 (0x0)
Number of blocks: 0 (0x0)
Number of bytes: 0 (0x0)
The preceding example provides the following information: The
block address associated with the current logical position. The
block address associated with the next block to be transferred
from the buffer to the medium. The number of data blocks that
have not been written to the medium. The number of data bytes
that have not been written to the medium.
In addition to the information provided by the preceding exam‐
ple, the rdpos s option may display additional messages. Avail‐
ability of these additional messages depends on the capabilities
of the tape drive device. You will only see such error messages
if the tape device is configured to detect the error state and
to display the appropriate message: An error has occurred and
the tape position cannot be returned. An error has occurred as
the device is incapable of reporting block locations. Number of
bytes in the buffer field does not represent the actual number
of bytes in the buffer. Number of blocks in the buffer field
does not represent the actual number of blocks in the buffer.
The logical unit is positioned between early-warning and the end
of media (EOM). The logical unit is at the beginning of media
(BOM). The read position long format. This option requires an
argument in the following syntax: # mt-f /dev/ntape/tape1 rdpos
l READ POSITION long format
File number: 0 (0x0)
Block number: 3 (0x3)
The following information is returned: The number of file marks
between BOM and current logical position. The number of logical
blocks between BOM and the current logical position.
In addition to the information provided by the preceding exam‐
ple, the rdpos l option may display additional messages. Avail‐
ability of these additional messages depends on the capabilities
of the tape drive device. You will only see such error messages
if the tape device is configured to detect the error state and
to display the appropriate message: An error has occurred as the
device is incapable of reporting block locations. File Number
and Set Number are unknown The logical unit is positioned
between early-warning and the end of media (EOM). The logical
unit is at the beginning of media (BOM). The read position
short format, with device-specific addresses. This option only
works on certain devices and requires a tape coordinate argument
as for the s option.
The output will be the same format as for the s option, although
the device-specific data bytes may differ if the device supports
its own format. Not all devices support their own format. If
the d option is not supported by the device, the following
error message will be displayed: MTIOCRDPOS (dev_specific): I/O
error
Space to end of recorded data. Currently, this command is only
supported in the SCSI/CAM tape driver. Not all SCSI tape drives
support this functionality. Positions a tape at the specified
coordinates. The output of the rdpos command may be used as an
argument to this command. You can specify the value from the
First block field when using the s option. Positions a tape at
the specified coordinates. You can use the output from the rdpos
command as an argument, and the syntax is as for the seek com‐
mand.
Unlike the general seek command, the seekds command is device-
specific. Some tape devices provide a device-specific format for
accessing the media position, which differs from the SCSI logi‐
cal block format defined by the SCSI standard. The device-spe‐
cific format may provide a faster way of seeking to a particular
position on the tape. Prints status information about the tape
unit. Prepares a SCSI tape for removal from the device. Not
all SCSI tape drives support this functionality.
Only as many characters as are required to uniquely identify a command
need to be specified.
EXIT STATUS
The mt command returns the following exit status: Success. Command was
unrecognized. Operation failed.
FILES
Raw magnetic tape interface with no rewind when closed. Raw magnetic
tape interface with rewind when closed.
SEE ALSO
Commands: dd(1)
Functions: ioctl(2)mt(1)