tapecntl(1) tapecntl(1)
NAME
tapecntl - tape control for tape device
SYNOPSIS
tapecntl [-abelrtuvw] [-d arg] [-f arg] [-p arg] [special]
DESCRIPTION
tapecntl sends the optional commands to the tape device driver
sub-device /dev/rmt/ntape*. The sub-device /dev/rmt/ctape*
provides a rewind on close capability, while /dev/rmt/ntape*
allows for closing of the device without rewind. Error
messages are written to standard error. special is the tape
device, and defaults to /dev/rmt/ntape1 if not specified.
Not all options are supported by all tape devices or all tape
device drivers.
Options
tapecntl takes the following options:
-a Position the tape to the end of data (EOD) mark. This
option is valid only for SCSI tape devices.
-b Read block length limits from the tape device and
display them.
-e Erase the tape. The erase bar is activated while moving
the tape from beginning to end, erasing all data tracks
in a single pass over the tape.
-l Load the tape media and position the tape at the
beginning of tape (BOT) mark.
-r Reset the tape device, initializing the tape controller
registers and positioning the tape at the beginning of
tape (BOT) mark.
-t Retension the tape, moving the tape from beginning to
end and back, thereby repacking the tape with the proper
tension across its length.
-u Unload the tape media from the tape device. Depending
on the device, unloading may include ejecting the
cartridge.
Copyright 1994 Novell, Inc. Page 1
tapecntl(1) tapecntl(1)
-v Set the tape device to read and write variable length
blocks. This option works only on devices that support
variable length blocks.
-w Rewind the tape, moving the tape to the BOT mark.
-d[n] Set the tape density with argument n, where n is the
numeric density code as defined in the SCSI-2
specification. This option works only with SCSI drives.
The number specified must be in decimal. Common density
codes include: 0 = the default value for the device,
meaning autodetect; 4 = QIC-11; 5 = QIC-24; 15 = QIC-
120; 16 = QIC-150. Zero is the recommended value. For
DAT devices, 0 and 13 both denote the DDS format and are
the only valid density codes.
-f[n] Set the tape device to read and write in fixed length
blocks of n bytes, where n is some positive, non-zero
integer. Individual devices have specific limitations
and you should set this parameter only to a value
supported by the device.
-p[n] Position tape past the end of file (EOF) mark n, where n
is an integer, positive or negative, representing the
number of EOF marks to move forward or backward. A
positive integer moves the tape forward relative to its
current position, to a point just after the specified
EOF mark. A negative integer moves the tape backward in
the same manner, to a point on the tape just before the
specified EOF mark. So, for example, using -p 2 will
move the tape to the beginning of the third record;
using -p -1 will move the tape back past the previous
file mark, putting the tape at the end of the record.
For this reason, backward positioning cannot move to the
beginning of a record, and because backward positioning
is slow, rewinding and moving forward to the needed
record is the recommended approach. Note, however, that
backward positioning is not available on all devices. A
positioning value of zero is ignored. Illegal or out-
of-range values will leave the tape positioned at the
last valid EOF mark.
Options can be used individually or strung together.
Copyright 1994 Novell, Inc. Page 2
tapecntl(1) tapecntl(1)
The default mode for I/O from any magnetic tape, such as
QICtape, 9-track, or DAT is fixed-length blocks which are 512
bytes long.
Files
/usr/bin/tapecntl
/dev/rmt/ntape*
/dev/rmt/ctape*
Errors
Exit codes for tapecntl and their meanings are as follows:
1 Device function could not initiate properly due to
misconnected cables or poorly inserted tape cartridge.
2 Device function failed to complete properly due to
unrecoverable error condition, either in the command
setup or due to mechanical failure.
3 Device function failed due to the cartridge being write
protected or to the lack of written data on the tape.
4 Device /dev/rmt/ntape* or /dev/rmt/ctape* failed to open
properly due to already being opened or claimed by
another process.
NOTICES
Using variable-length block mode when writing magnetic tapes
is discouraged because it may not work correctly in releases
before SVR4.2 MP. Magnetic tape should always be written in
fixed-length block mode, even though you are free to change
the default fixed-block length from 512 bytes to any other
fixed-block mode the tape drive supports.
The default mode for I/O from any magnetic tape (QICtape, 9-
track, DAT) is fixed-length blocks 512 bytes long.
Copyright 1994 Novell, Inc. Page 3