You can control tape drives with the mt command to move and position the tape in several ways. This section describes how to perform the following tasks:
The syntax of the mt command is as follows:
mt {-f|-t} device command [ count ]
The -f and -t options are interchangeable; they indicate that the next argument is a device.
device is a tape device.
command is an mt command. The following table discusses the most common mt commands.
count specifies the number of times to execute a command that supports multiple operations.
This section discusses the mt commands listed in the following table. For a description of all the mt commands, see the mt(1) man page.
Note
Use nrst devices for all tape status and movement operations. Using other rewind types might produce unwanted side effects.
Caution
When you use the urst device with the mt command, the tape drives it is used with must be stackers and there must be sufficient tapes in the stacker sequence. Otherwise, the tape drives involved will terminate the command sequence or overwrite the same tape multiple times.
You move a tape to the end of data if you want to append data on a tape.
To move a tape to the end of data, or end of medium if the tape is full, complete the following step.
| 1 |
mt -f device eom |
mt -f nrst0a eom
Note
If you use a rewind or unload/reload tape device, this command rewinds the device, moves the tape to the beginning of data, and unloads it if possible.
You move forward to access a particular tape file further along the tape. You can skip over a specified number of file marks and stop at the end-of-tape side of a file mark. This puts the tape drive head at the beginning of a file.
To move forward to the beginning of a tape file, complete the following step.
If you enter the following command in the middle of the third file on the tape, it moves the tape to the beginning of the eighth file on the tape:
mt -f nrst0a fsf 5
You move backward to access a particular tape file further back on the tape.
To move backward to the beginning of a tape file, complete the following steps.
If you enter the following command in the middle of the fifth file on the tape, it moves the tape to the beginning of the second file on the tape:
mt -f nrst0a bsf 3
You rewind a tape to get to the beginning of the tape when using a no-rewind device. You do this before performing a restore of a backup that was done using a no-rewind device, provided that there is no other data before the backed-up data on the tape and it is not unloaded.
To rewind a tape, complete the following step.
| 1 |
mt -f device rewind |
mt -f nrst0a rewind
You take a tape drive offline to service it.
To rewind the tape and take the tape drive offline by unloading the tape, complete the following step.
| 1 |
mt -f device offline |
mt -f nrst0a offline
You display status information to find out whether you can read with a device or to verify that a tape drive is not in use.
To display status information about a tape device and the drive associated with it, complete the following step.
| 1 |
mt -f device status |
mt -f nrst0a status
A display like the following appears:
Tape drive: Quantum DLT7000
Status: ready, write enabled
Format: 85937 bpi 70 GB (w/comp)
fileno = 0 blockno = 95603 resid = 0
The fields in the display are as follows:
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00325
File: tape8.htm
Last updated: 01/14/03 17:51:17