Stp is the SCSI tape driver used to control
SCSI tape devices such as nine-track, cartridge,
Digital Audio Tape (DAT), and Exabyte 8mm tape drives.
On configuration, the mkdev tape command prompts for
information about the SCSI tape device to try to
use as many of its device-specific features as it can. If you select to
use the generic SCSI configuration, this may not be
optimal for certain tape drives. For example, for certain
DAT drives, the generic driver will perform a security
erase rather than a fast erase.
for details of the
commands supported by the Stp driver.
Nine-track (also referred to as reel-to-reel or half-inch) tapes
were the traditional medium of off-line storage. Data is written
serially as nine parallel tracks along the tape. These tapes are
capable of storing 4 to 258MB of data.
Cartridge (also referred to as quarter-inch) tapes are written to
as serial tracks on a linear tape in a similar fashion to
nine-track tapes. Cartridge tapes are capable of
storing 25MB to 1.3GB of data.
DAT and Exabyte 8mm tapes are based on a helical scan
technology developed for video recording and adapted to the
storage of digital data.
DAT devices are cassette tape drives based on the
Digital Data Storage (DDS) or the Digital Data
Storage with Data Compression (DDS-DC) recording
formats. Digital Audio Tapes (also referred to as
4-mm tapes) are capable of storing from 1.3 to more
than 2GB of data.
Exabyte 8mm tapes conform to the ANSI X3/653-D recording
standard. These tapes are capable of storing from 1.3 to more
than 5GB of data,
and up to 25GB if data compression is used.
Several DDS and SCSI 2 and 3 features are
explained in later sections ``Setmarks,'' ``Fast search,''
and ``Partition support.'' These allow applications greater
speed and flexibility in archiving and accessing data.
Note that support of SCSI 2 and 3 features for
individual devices depends on the manufacturer's
The tape setcomp command enables and disables
tape drive compression and decompression if the drive has
this capability. Note that a tape drive will not be able
to read a tape that was written using hardware-compression unless
it supports the corresponding decompression method in hardware.
Error code correction (ECC)
ECC is handled by the embedded SCSI
controller on the tape device. It is not possible to
disable ECC as was possible with the
This is a function of the drive firmware and cannot be
invoked by a command from the host system. This mechanism
enables a tapemark search at speeds in excess of 100 times
the normal read/write speed. At these speeds, a search for
a setmark on a 1300MB tape typically takes only 22.5
DDS and SCSI 2 and 3 allow the tape to be
formatted into two entirely separate and independent
partitions. These partitions are normally used for data
(partition 0) and directory information (partition 1). The
use of a directory partition allows much faster indexing to
the position of a data file on the tape. The size of the
smaller directory partition is specified using the
tape setpart command and has a maximum size
depending on the recording density being used. Cartridge
and nine-track tapes allow the directory partition to
occupy at most one track of the tape. The following table
gives the approximate maximum sizes for the directory track
on some common cartridge tape formats:
Approximate maximum size
of directory partition
Some DAT drives also specify a minimum directory
partition size of 1MB if one is specified. The default
configuration is a single partition that spans the entire
If you format the tape into two partitions, each partition
acts as a logically distinct tape, and tape operations are
specific to the partition selected
(via the tape -a # setpart command or the MT_SETPARTioctl command).
The following example archives /dir_A onto partition 0, and
/dir_B onto partition 1 of the tape in the first
The command tape -s -a 1 setpart
positions the tape head at the beginning of
partition 1 on the tape.
Use the tape partition command to divide a tape into two
partitions. For example, to create a 500MB partition 1 on a
DDS tape, enter:
tape -a 500 partition /dev/rStp0
Partition 1 is 500MB, while partition 0 is
the remainder of the tape. For a 1300MB tape, this
implies that partition 0 is approximately 800MB.
To reformat two partitions into a single partition, enter:
tape -a 0 partition /dev/rStp0
Note that some SCSI 2 and 3 devices such as the Exabyte 8500
do not support tape partitions. Similar functionality may be obtained
using setmarks or filemarks.
Data on tapes may be organized as files containing a sequence
of one or more tape records. Filemarks
indicate the end of a file and mark separation between files.
Positioning a tape to a filemark is
much faster than the typical read/write speed.
DDS and SCSI 2 and 3 allow an additional type of mark,
called the setmark.
A setmark is a higher organizational unit than a filemark; a
search to a setmark ignores filemarks (whereas the reverse is
not true). Together, filemarks and setmarks
are called tapemarks.
DDS and SCSI 2 and 3 still use records and filemarks in
the standard manner. If setmarks are ignored
then the drive responds the same way as non-DDS
SCSI 1 tape devices.
One way to use setmarks is by grouping together sets of
files that are logically connected. This is especially valuable
on larger capacity tapes
that can contain numerous files. By using setmarks in
conjunction with filemarks, access to a specified file can be
You can write setmarks by using the tape wsm command.
Variable and fixed-block mode
The -a n setblk argument to the
tape command sets the tape block size to the specified
number (n) of bytes. If this number is 0 (zero),
variable block size is selected. tape sets the block
size automatically when it reads a tape.
SCSI minor device numbering
The minor device numbering scheme for SCSI tape devices is
shown in the following table:
SCSI Tape minor devices
Device number +
No rewind on close
Retension tape on open (iBCSe2)
Perform ECC on data
Override/control device (ioctl)
+ The device number is not necessarily the same as the SCSI
LUN of the device.
The following error messages may be displayed on the console.
for general information about kernel error messages,
including a list of generic device driver errors.
NOTICE: Stp: SCSI tape number device major/minor tape is write protected
Tape is write protected.
Damage to the drive mechanism may also cause this error.
NOTICE: Stp: SCSI tape number device major/minor tape unit not ready
Tape unit was performing another operation.
WARNING: Stp: not enough DMAABLE memory for tape buffer - tape may not function
Not enough memory could be allocated to the tape buffer on initialization.
QIC-02 tapes with ECC written using the
ct cartridge tape driver may not be readable on
SCSI cartridge tape drives; these support a different
form of ECC.
Normally, only one process can have a given SCSI device open
at any time. root can gain access on the override/control
device (/dev/xStp#) to reset a hung drive.
raw interface device file with implicit rewind on close