DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

scsitape(HW)


scsitape: Stp, dat, Exabyte, nine-track -- SCSI tape devices

Description

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.

Refer to tape(HW) for details of the ioctl(S) 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 implementation.

Data compression

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 QIC-02.

Fast search

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

Partition support

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:

Tape Capacity
Approximate maximum size  
format
of directory partition  
QIC-120 (DC6150) 125MB
8MB  
QIC-150 (DC6150) 150MB
8.3MB  
QIC-525 (DC6320) 320MB
12.3MB  
QIC-525 (DC6525) 525MB
20.1MB  
QIC-1000 (DC9100) 1.01GB
33.3MB  
QIC-1000 (DC9100L) 1.35GB
43.8MB  

 +-------------------+----------+
 |Tape               | Capacity |
 +-------------------+----------+
 |format             |          |
 +-------------------+----------+
 |QIC-120 (DC6150)   | 125MB    |
 +-------------------+----------+
 |QIC-150 (DC6150)   | 150MB    |
 +-------------------+----------+
 |QIC-525 (DC6320)   | 320MB    |
 +-------------------+----------+
 |QIC-525 (DC6525)   | 525MB    |
 +-------------------+----------+
 |QIC-1000 (DC9100)  | 1.01GB   |
 +-------------------+----------+
 |QIC-1000 (DC9100L) | 1.35GB   |
 +-------------------+----------+
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 tape.

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_SETPART ioctl command).

The following example archives /dir_A onto partition 0, and /dir_B onto partition 1 of the tape in the first SCSI drive:

tape -a 0 setpart /dev/nrStp0
find /dir_A -print | cpio -oB > /dev/nrStp0
tape -a 1 setpart /dev/nrStp0
find /dir_B -print | cpio -oB > /dev/nrStp0

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.

Setmarks

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 improved dramatically.

You can write setmarks by using the tape wsm command. See tape(C).

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

Bits 7
6 5 4 3 2 1 0 Description  
- - - - - X X X Device number +
- - - - X - - - No rewind on close
- - - X - - - - Retension tape on open (iBCSe2)
- - X - - - - - Perform ECC on data
X - - - - - - - Override/control device (ioctl)

 +-----------------------+---------------------------------+
 |         Bits          |                                 |
 +--+--+--+--+--+--+--+--+---------------------------------+
 |7 |6 |5 |4 |3 |2 |1 |0 | Description                     |
 +--+--+--+--+--+--+--+--+---------------------------------+
 |- |- |- |- |- |X |X |X | Device number                   |
 +--+--+--+--+--+--+--+--+---------------------------------+
 |- |- |- |- |X |- |- |- | No rewind on close              |
 +--+--+--+--+--+--+--+--+---------------------------------+
 |- |- |- |X |- |- |- |- | Retension tape on open (iBCSe2) |
 +--+--+--+--+--+--+--+--+---------------------------------+
 |- |- |X |- |- |- |- |- | Perform ECC on data             |
 +--+--+--+--+--+--+--+--+---------------------------------+
 |X |- |- |- |- |- |- |- | Override/control device (ioctl) |
 +--+--+--+--+--+--+--+--+---------------------------------+
+ The device number is not necessarily the same as the SCSI LUN of the device.

Diagnostics

The following error messages may be displayed on the console. See messages(M) 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.

Limitations

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.

Files


/dev/rStp#
raw interface device file with implicit rewind on close

/dev/nrStp#
no rewind on close(S), raw interface device file

/dev/xStp#
ioctl control device file (does not require a tape to be present in the device)

# is the number of the tape device in the order that it was installed (0,1,...); it is unlikely to correspond to the logical unit number (LUN) of the device or the target ID of the controller.

The files /dev/rStp, /dev/nrStp, and /dev/xStp are linked to /dev/rct0, /dev/nrct0, and /dev/xct0 unless a cartridge tape device controlled by the ct(HW) driver already exists on the system.

There are no special devices for unloading the tape (use tape unload or physically eject the tape), or for selecting a tape partition (use tape setpart).

See also

mkdev(ADM), mscsi(F), scsi(HW), tape(C), tape(HW)
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003