This setion gives information that is specific to scsi tape drives.
Drives using both fixed and variable length blocks smaller than the the driver buffer length (set to 32K in the distribution sources) are supported.
Parameters (block size, buffering, density) are set with ioctls (usually with the mt program), and remain in effect after the device is closed and reopened.
Virtually all drives should work, including :
Try booting with a tape in the drive.
When reading a tape with multiple files, the first tar is successful, a second tar fails silently, and retrying the second tar is successful.
User level programs, such as tar, don't understand file marks. The first tar reads up until the end of the file. The second tar attempts to read at the file mark, gets nothing, but the tape spaces over the file mark. The third tar is successful since the tape is at the start of the next file.
Use mt on the no-rewind device to space forward to the next file.
Decompressing programs cannot handle the zeros padding the last block of the file.
To prevent warnings and errors, wrap your compressed files in a .tar file - ie, rather than doing
tar cfvz /dev/nrst0 file.1 file.2 ...
do
tar cfvz tmp.tar.z file.1 file.2 ...
tar cf /dev/nrst0 tmp.tar.z
You can't read a tape made with another operating system or another operating system can't read a tape written in Linux.
Different systems often use different block sizes. On a tape device using a fixed blocksize, you will get errors when reading blocks written using a different block size.
To read these tapes, you must set the blocksize of the tape driver to match the blocksize used when the tape was written, or to variable.
Note: this is the hardware block size, not the blocking factor used with tar, dump, etc.
You can do this with the mt command -
mt setblk
or
mt setblk 0
to get variable block length support.
Note that these mt flags are NOT supported under the GNU version of mt which is included with some Linux distributions. Instead, you must use the BSD derrived Linux SCSI mt command. Source should be available from
ftp://tsx-11.mit.edu/pub/linux/ALPHA/scsi
All attempts to access the tape result in a
``No such device''
or similar error message. Check the type of your tape device - it must be a character device with major and minor numbers matching those specified in subsection C, Device Files.
Many tape drives support reading at lower densities for compatability with older harware, but will not write at those same densities.
This is especially the case with QIC drives, which will read old 60M tapes but only write new 120, 150, 250, and 525M formats.
SCSI tapes use character device major 9.
Due to constraints imposed by Linux's use of a sixteen bit dev_t with only eight bits allocated to the minor number, the SCSI tape minor numbers are assigned dynamically starting with the lowest SCSI HOST/ID/LUN.
Rewinding devices are numbered from 0 - with the first SCSI tape, /dev/rst0 being c 9 0, the second /dev/rst1 c 9 1, etc. Non-rewinding devices have the high bit set in the minor number, ie /dev/nrst0 is c 9 128.
The standard naming convention is /dev/nrst{digit} for non-rewinding devices /dev/rst{digit} for rewinding devices
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter