Library Table of Contents Index Previous Next Comments

Controlling tape drives

About controlling tape drives  Top

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 mt command syntax  Top

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.

Command

Task

eom

Position the tape to the end of the data or the end of the medium if the tape is full.

fsf

Move the tape forward, skipping a specified number of files.

bsf

Move the tape backward, skipping a specified number of files.

rewind

Rewind the tape.

offline

Rewind the tape and unload the tape medium if possible.

status

Display information about a device and the drive associated with it.

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.

Moving a tape to the end of data  Top

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.

Step

Action

1

Enter the following command:

mt -f device eom 

device is the name of a no-rewind tape device.

Example
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.

Moving forward to a file  Top

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.

Step

Action

1

Enter the following command:

mt -f device fsf n

device is the name of a tape device used on the tape.

n is the number of tape file marks you want to skip over going forward. The tape moves to the beginning of the nth file after the file where it is when the command is issued.

Example

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

Moving backward to the beginning of a file  Top

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.

Step

Action

1

Enter the following command:

mt -f device bsf n

device is the name of a tape device used on the tape.

n is the number of tape file marks you want to skip over going backward. The tape moves to the beginning of the nth file before the file where it is when the command is issued.

Example

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

Rewinding a tape  Top

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.

Step

Action

1

Enter the following command:

mt -f device rewind

device is the name of a tape device used on the tape.

Example
mt -f nrst0a rewind

Taking a tape drive offline  Top

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.

Step

Action

1

Enter the following command:

mt -f device offline

device is the name of a tape device used on the tape.

Example
mt -f nrst0a offline

Displaying status information  Top

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.

Step

Action

1

Enter the following command:

mt -f device status

device is the name of a tape device.

Example
mt -f nrst0a status
Result

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:

Library Table of Contents Index Previous Next Comments