tapeformat for SCSI tape device names |
File Format |
/dev/
[n
] [r
]
mt
[h
#]
[l
#]
[t
#]
[#
]
[s...
]
[b
blocksize]
[d
density]
cpio
,
dd
,
mt
,
pax
, and
tar
commands.
A valid MKS SCSI tape device name uses the following format:
n
specify that the tape should not be rewound after the operation (the
default is to rewind after the operation). Note that commands which
implicitly rewind the tape (such as erase
,
offline
, or retension
) and those
which position the tape (such as fsf
or
bsf
) ignore the no-rewind indicator.
r
accesses the tape in an unbuffered (raw) manner. The
r
option turns off any internal buffering in the tape
drive. All buffering supported by the tape drive is used unless
r
is present in the tape device name.
Using buffered tape access allows the drive to cache reads and writes, resulting in better performance. However, note that errors in writing to the tape might occur after the write operation to the tape drive has already succeeded (since the drive was just caching the information up to that point).
It's worth experimenting with this parameter if you are having performance
problems. Try the raw device (/dev/rmt0
) until you have
successfully read the tape (determined the appropriate block size, etc.),
and then try the buffered device (/dev/mt0
) if you are
experiencing performance problems.
h
#specifies the SCSI host adapter. # can be 0 through 7.
t
#specifies the SCSI device target ID. # can be 0 through 7.
l
#specifies the SCSI logical unit (LUN). # can be 0 through 7.
#
specifies which of the tape drives on the system to use (meeting any of
the criteria specified by any h
#,
t
# or l
#). Typically
h
#, t
# or
l
# are not specified, and this digit indicates
which of the tape drives on the system to use. Thus, /dev/mt0
(or simply /dev/mt
) is the first drive found on the system;
/dev/mt1
is the second, and so on. /dev/mth21
is
the second (1) tape drive found on host adapter #2 (h2).
s
requests a modified speed for the selected density.
Currently accepted by the Archive Viper 2525's QIC-525
format
with a modified speed of 90 ips (as opposed to the standard 120 ips for
QIC-525
when the s
isn't included), and
the Tandberg Data TDC 4100 QIC-1000
format with a modified
speed of 80 ips (vs. the standard 53 ips for the QIC-1000
when the ss
isn't included). For QIC-1000
at 80 ips, s
must be specified twice.
You can specify s
multiple times to select among
multiple modified speeds, should your drive support them.
b
blocksizeattempts to force the drive into fixed block mode, with the block size set to a specific value. An error occurs if the tape drive does not support fixed block mode.
For example, if you wanted to write a
tar
archive to tape with 512
byte blocks, but you wanted to write 10 blocks per tape operation to
improve tape streaming performance, you could use the command
tar -c -f /dev/rmt0b512 -b 10 *
This sets the drive to fixed block mode, with a block size of 512 bytes.
The tar
utility then writes 10
blocks in each tape operation. The tape itself contains the same block
sizes and information as if the tape were written one block at a time, but
performance could be substantially better.
d
densityspecifies the density (tape format). d
density
can take one of the forms shown in Table 1:
Density # | Common Name | Size | Speed | Tracks | BPI | Case Style |
01 | 1/2" | 9 | 800 | Reel-to-reel | ||
02 | 1/2" | 9 | 1,600 | Reel-to-reel | ||
03 | 1/2" | 9 | 6,250 | Reel-to-reel | ||
04/84 | QIC-11 | 1/4" | 4/9 | 8,000 | Cartridge | |
05 | QIC-24 | 1/4" | 90 ips | 9 | 8,000 | Cartridge |
06 | 1/2" | 9 | 3,200 | Reel-to-reel | ||
07 | 1/4" | 4 | 6,400 | Cartridge | ||
08 | .15" | 4 | 8,000 | Cassette | ||
09 | 1/2" | 18 | Cartridge | |||
0A | 1/2" | 22 | 6,667 | Cartridge | ||
0B | 1/4" | 4 | 1,600 | Cartridge | ||
0C | 1/2" | 24 | 12,690 | Cartridge | ||
0D | 1/2" | 24 | 25,380 | Cartridge | ||
0F | QIC-120 | 1/4" | 90 ips | 15 | 10,000 | Cartridge |
10 | QIC-150 | 1/4" | 90 ips | 18 | 10,000 | Cartridge |
11 | QIC-525 | 1/4" | 120 ips | 26 | 16,000 | Cartridge |
12 | QIC-1350 | 1/4" | 30 | 51,677 | Cartridge | |
15 | QIC-1000 | 1/4" | 53 ips | 30 | 36,000 | Cartridge |
Table 1: Forms of the d
density Option
d
density accepts input with the QIC-
prefix in uppercase, lowercase or omitted; it also accepts the prefix
QIC
with the -
omitted. Thus, QIC-150
,
QIC150
, qic150
, or 150
are all valid ways
to specify the QIC-150
format.
QIC-11
specifies the 9 track QIC-11
format;
for the 4 track QIC-11
format, use the alternate format:
d
#4; or d
#xx, where
xx is a hex number indicating the code for the requested density.
This alternate format allows selection of densities beyond the
QIC
formats defined in Table 1. Use the
d
#xx format carefully; consult your tape
drive's technical documentation for the proper density code (usually
documented under the MODE
SELECT
command).
11(9) | 24 | 120 | 150 | 525 | 1000 | 1350 | |
---|---|---|---|---|---|---|---|
Archive | |||||||
Viper 60S | R | R/W | |||||
Viper 125S | R | R | R/W | ||||
Viper 150S | R | R | R/W | R/W | |||
Viper 2525 | R | R/W | R/W | R/W | |||
Anaconda 2750 | R | R/W | R/W | R/W | R/W | R/W | |
Anaconda 2800 | R/W | R/W | R/W | R/W | R/W | R/W | |
Tandberg | |||||||
Data TDC 3620 | R/W | R/W | |||||
Data TDC 3640 | R/W | ||||||
Data TDC 3660 | R/W | R/W | |||||
Data TDC 4100 | R/W | R/W | R/W | R/W | R/W | ||
Wangtek | |||||||
5099ES | R/W | ||||||
5125ES | R | R/W | |||||
5150ES | R | R/W | R/W |
Table 2: 1/4" SCSI Drives and Formats
Utility | Option | Unit | Default |
dd | ibs=/obs=/bs= | Various | 512 bytes |
cpio | -C | bytes | 512 (5120 if -B specified) |
pax | -b | 512-byte-blocks | automatically determined on read |
10240 on write |
Table 3: Block Size Specifications
tar
defaults to a large block size of
63.5K, pax
defaults to 10K, and
cpio
defaults to 512 bytes. For
example, if you are reading a cpio
archive on a tape with an unknown block size, a command such as
has the best chance at reading the tape (that is, if your tape drive supports true block size detection). Note that the typical block size forcpio -it -C 63000 -I /dev/rmt0
cpio
archives on tape is either 512
bytes, or 5120 bytes as specified by the -B
option.
cpio
archives, a block size of 5120 bytes is often used.
Because reads and writes are done on a set block size in fixed mode, several
blocks can be read or written in a single operation. This improves performance
on some older drives, as opposed to the variable mode which must determine the
block size for each individual operation. However, with newer drives, variable
block mode often delivers better performance than writing with multiple blocks
per write in fixed block mode because the new drives that support variable block
mode usually have built-in buffering to improve performance.
/dev/nrmt0
), two filemarks occur between
each file on the tape. When reading the tape, these filemarks appear as an empty
file between each file written.
Some tape drives allow you to overwrite trailing files on a tape. After you have
written a file with a no-rewind device on such drives, you can backspace the
tape to before the second filemark with an mt bsf 1
command, and
then write your second file. This eliminates the second filemark that was
between your two files. By doing an mt bsf 1
after every file
written to the tape, you can separate the files with a single filemark, as is
done on UNIX.
Other tape drives, however, only allow you to append to a tape after all data
has been transferred, including the two terminating filemarks. A write error
occurs if you attempt to write to one of these drives after doing an
mt bsf 1
. On such tape drives, you can do an mt eom
to force the tape to the end of the recorded medium (that is, past all data,
including the two terminating filemarks) before writing your next file. In this
case, you will have two filemarks between each file on your tape.
The following command performs the unbuffered tape operation on the tape drive of SCSI host adapter 0, SCSI target 1, LUN 2, in/dev/mt
QIC-525
format
with a block size of 1024, without rewinding the tape afterwards:
The following command dumps all of drive/dev/nrmth0t1l2b1024dqic525
c:
to a potentially
muti-volume backup using tar
. While
creating an archive, this command writes 10 512-byte tape blocks at a time
(5120 bytes per tape request) in QIC-150
format, and prints the
file names to standard error. The volume name (argument to the
V
flag) is /dev/mtd150
. Since no #
is used, the command drives to the same device name for each volume.
The following command finds all files on drivetar cvbV 10 /dev/mtd150 c:/
c:
, and gives them
to the standard input of cpio
.
cpio
creates an archive (the
-o
option), writing 10 blocks at a time (the
-B
option). It creates the potentially multi-volume archive
on the first tape drive in QIC-150 format, and writes the file names to standard
error as they are processed (the -v
option).
Similar to the -f
option to tar, which lets you specify a
file rather than a volume pattern, the -O
option to
cpio
prompts you for a device or file
name whenever it fills a tape. Note that specifying the -V
flag without #
input removes the need to enter a device name with
every tape, as required with the tar
-f
option and the
cpio
-O
option.
The following command writes all of drivefind c:/ -type f -print | cpio -OBvV /dev/mtd150
c:
to the potentially
multi-volume backup /dev/mtd150
at 5120 bytes per tape write, and
writes the file names to standard error as they are processed (the
-v
option).
pax -wvb 5120 -V /dev/mtd150 c:/
This message can be broken down as follows:dd: SCSICMD: 8: Read Data, ERROR (70 0 0 0): unit needs attention, SCSI bus parity
dd:
the command name
SCSICMD: 8: Read Data,
the SCSI command name/number that resulted in the error
ERROR (70 0 0 0): unit needs attention,
the four hex bytes reported in parenthesis are the raw version of the
error messages that follow. The first two bytes indicate the standard
SCSI error message, which is reported immediately after the
ERROR (x x x x):
.
The last two bytes are the vendor-specific flags which result in the comma separated secondary messages being printed (see below for the list of possible secondary messages).
If you see any of the above errors and it is not consistent with other error messages, the status of the tape drive, the tape, or the command you are using, your tape drive may use the vendor-specific flags in a manner different from the commonly method. In such a case, the extended portion of the error message should be ignored.beginning of media block not located cartridge not in place end of data end of media rror counter overflow filemark detected no data detected SCSI bus parity tape drive not ready unit needs attention unrecoverable data error write data error write protect
tar
,
pax
and
cpio
do not explicitly rewind the
tape before each volume; however, inserting a tape into most drives causes the
tape to automatically rewind. If you find that secondary volumes are not being
written at the start of the tapes, your drive probably isn't rewinding the
tapes, and you should do so manually for each tape with the
mt
rewind
command
before reading or writing a multi-volume archive.