 |
Index for Section 1 |
|
 |
Alphabetical listing for M |
|
 |
Bottom of page |
|
mt(1)
NAME
mt - Magnetic tape manipulating program
SYNOPSIS
mt [-f tape_device] command [count]
The mt program gives commands to a magnetic tape drive.
OPTIONS
-f tape_device
This option specifies the tape device to be manipulated.
count (integer)
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 environment
variable is used; if TAPE does not exist, mt uses the /dev/ntape/tape0_d0
device. Note that tape_device must refer to a raw (not block) tape device.
By default, mt performs the requested operation once. You can perform
operations more than once using the count option.
The following commands are available:
bsf Backspaces count files.
bsr Backspaces count records.
eof, weof
Writes count End-of-File marks at the current position on the tape.
fsf Forward spaces count files.
fsr Forward spaces count records.
load
This option prepares a SCSI tape for loading into the device. Not all
SCSI tape drives support this command.
offline, rewoffl
Rewinds the tape and places the tape unit offline (count is ignored).
online
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.
rewind
Rewinds the tape (count is ignored).
rdpos
Sets the tape at the specified read position coordinates. The data
obtained when using the rdpos option can be used as an argument to the
seek or seekds commands.
Use the following options with the rdpos command:
s (the default)
The read position short format. This option requires a tape
coordinate argument 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:
First block
The block address associated with the current logical position.
Last block
The block address associated with the next block to be
transferred from the buffer to the medium.
Number of blocks
The number of data blocks that have not been written to the
medium.
Number of bytes
The number of data bytes that have not been written to the
medium.
In addition to the information provided by the preceding example,
the rdpos s option may display additional messages. Availability 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:
Position overflow error
An error has occurred and the tape position cannot be returned.
Block position unknown
An error has occurred as the device is incapable of reporting
block locations.
Byte count unknown
Number of bytes in the buffer field does not represent the
actual number of bytes in the buffer.
Block count unknown
Number of blocks in the buffer field does not represent the
actual number of blocks in the buffer.
End of partition
The logical unit is positioned between early-warning and the
end of media (EOM).
Beginning of partition
The logical unit is at the beginning of media (BOM).
l (the default)
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:
File number
The number of file marks between BOM and current logical
position.
Block number
The number of logical blocks between BOM and the current
logical position.
In addition to the information provided by the preceding example,
the rdpos l option may display additional messages. Availability 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:
Block position unknown
An error has occurred as the device is incapable of reporting
block locations.
Mark position unknown
File Number and Set Number are unknown
End of partition
The logical unit is positioned between early-warning and the
end of media (EOM).
Beginning of partition
The logical unit is at the beginning of media (BOM).
d 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
seod
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.
seek
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.
seekds
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 command.
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 logical block format
defined by the SCSI standard. The device-specific format may provide a
faster way of seeking to a particular position on the tape.
status
Prints status information about the tape unit.
unload
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:
0 (Zero)
Success.
1 Command was unrecognized.
2 Operation failed.
FILES
/dev/ntape/tape?_d?
Raw magnetic tape interface with no rewind when closed.
/dev/tape/tape?_d?
Raw magnetic tape interface with rewind when closed.
SEE ALSO
Commands: dd(1)
Functions: ioctl(2)
 |
Index for Section 1 |
|
 |
Alphabetical listing for M |
|
 |
Top of page |
|