tape" -- Technical Information" "
Magnetic-tape devices
The COHERENT system supports two classes of magnetic-tape
devices: floppy tape, in which the tape device
is plugged into your system's floppy-disk controller; and
SCSI tape, in which the tape device is plugged
into your system's SCSI controller (should it have one).
The following gives general remarks on tape devices, then
briefly discusses the drivers for tape devices and the
block-special files by which you can access them.
Tape Devices
A tape consists of one or more files. Each file, in turn,
consists of one or more records and is terminated by a tape
mark. Two tape marks terminate the last file. Tape records
may vary in length, but cannot exceed 32 kilobytes (16
kilobytes is more practical).
Like other block-oriented devices, tape units can be
accessed through a system's cooked interface or its
raw interface. On a cooked device, seeking to any
byte offset and reading in any number of bytes is possible.
You cannot read beyond the tape mark at the end of the
current file. For block-I/O requests, every record in the
file must be 512 bytes long. Write requests must be made in
increments of 512 bytes.
A raw device bypasses the buffer cache, so that data are
written directly to or from your buffer. One write request
generates one tape record, and one read request returns
exactly one record. The number of bytes read may be fewer
than expected. If the tape mark is read, a count of zero is
returned, but the system positions the tape at the start of
the next tape file. Seeking on a raw device is ignored, and
mounting is not allowed. Raw (or character) requests are
usually performed in units much larger than 512 bytes.
A unit cannot be opened if it is off-line or already in use.
If tape cartridge within the tape drive is write protected,
you cannot open the tape device for writing. Closing the
device has varying effects, depending on the device's minor-
device number and whether the device was opened for reading
or writing. If the tape had been read, the tape is rewound;
if the no-rewind device was specified, the tape advances to
the next file. In the case of writing, two tape marks are
written at the current position and the tape is rewound; if
the no-rewind device was specified, two tape marks are
written and the tape is positioned between them. When you
close a device that had been opened for writing, the tape
volume ends at the current position; data beyond this point
are undefined.
Hard errors may occur during tape operation. They include
detecting the end-of-tape (EOT) reflector, reading an
unexpectedly long record, or seeking a cooked tape into a
tape mark. After an error, no further operations can be
performed on the unit until the program closes the device
and you rewind the tape. Soft parity errors may arise due
to dirt on the tape, a bad tape, or misaligned heads. If an
error occurs on a write, the device may attempt to place the
record further along the tape. If the error occurs on a
read, the driver simply rescans the record. After several
failures, the driver announces a hard error.
Drivers
COHERENT includes two drivers for tape backups:
- fftt
- This driver has major number 4, the same as the floppy-
disk drive. It works with QIC-40 and QIC-80 drives from
Colorado, Archive, Mountain, Summit, and IBM.
- hhaaii
- This is a host adapter-independent SCSI driver, which
supports SCSI hard disks as well as tape. This has major
device number 13. hai works with hard
disks from Adaptec, Seagate, and Future Domain. It has been
tested with the Archive Viper 60, 150, 250, and 525 SCSI
tape devices, and is known to work with them.
Each driver has a number of default behaviors, depending
upon how you access it. For details, see the driver's entry
in the Lexicon.
Devices
The following names the devices used to access tape drives.
For SCSI tape devices, N is the SCSI identifier of
your tape unit, as set when you installed COHERENT. (To
change your suite of SCSI identifiers, you must reconfigure
your kernel. For directions on how to do this, see the
Lexicon entry for hai.)
- //ddeevv//rrSSttpp_N
- SCSI tape unit _N, raw device, rewind.
- //ddeevv//nnrrSSttpp_N
- SCSI tape unit _N, raw device, no rewind.
- //ddeevv//xxSSttpp_N
- SCSI tape unit _N, control device.
- //ddeevv//rrcctt_N
- QIC-24 tape unit _N, raw device, rewind.
- //ddeevv//nnrrcctt_N
- QIC-24 tape unit _N, raw device, no rewind.
- //ddeevv//xxcctt_N
- QIC-24 tape unit _N, control device.
- //ddeevv//fftt_N
- QIC-40/80 (floppy tape), rewind.
- //ddeevv//nnfftt_N
- QIC-40/80 (floppy tape), no rewind.
- //ddeevv//ccttmmiinnii
- Default mini-cartridge device, retensioning.
- //ddeevv//rrccttmmiinnii
- Default mini-cartridge device, no retensioning.
- //ddeevv//xxccttmmiinnii
- Default mini-cartridge device, control device.
- //ddeevv//mmcc_N
- Irwin floppy tape, retensioning
- //ddeevv//rrmmcc_N
- Irwin floppy tape, no retensioning.
- //ddeevv//xxmmcc_N
- Irwin floppy tape, control device.
Installing Tape Devices
To install a SCSI tape device onto your system, do the
following:
- +o
- Power down your system; then plug the SCSI device into
your SCSI board. Do not plug the tape device into
your SCSI board while your system is powered up, or you will
damage your hardware.
- +o
- After you have rebooted your system, log in as the
superuser root.
- +o
- cd to directory
/etc/conf.
- +o
- Invoke the command cohtune hai and set
the variable HAI_TAPE to the SCSI ID of the
tape drive -- usually two.
- +o
- Invoke the command idmkcoh to build a
new kernel.
- +o
- Reboot your system and invoke the newly built kernel.
To install a floppy-tape device onto your system, do the
following:
- +o
- If you have not already done so, make sure that the you
have updated COHERENT to a version that supports floppy
tape, that is, release 4.2.12 or later.
- +o
- Power down your system and install the floppy-tape
device as described in its manual. Do not attempt to
install your device while your system is powered up, or you
can damage or destroy your system. Be very careful that DIP
switches and jumpers are set correctly. Also, make sure
that all cables are seated firmly -- it is easy to loosen a
connected while installing a tape device.
- +o
- Reboot your system into single-user mode. You can do
so by typing <ctrl-C> while your file
system is being checked during the reboot process, or invoke
the command
/etc/shutdown single 0
-
- after the system has checked its file system and
rebooted.
- +o
- Running from single-user mode, run the script
/etc/conf/ft/mkdev. If you know that your tape
drive uses soft select and know the manufacturer, you can
specify these features explicitly. If you know that your
tape drive uses hard select and know the unit number (for
example, a tape drive that takes the place of a second
floppy-disk drive is unit 1), you can specify these features
explicitly. If you are not sure of the above, select
automatic configuration. The device driver
ft will try to sense which type of drive
you are using.
- +o
- Unless you have other tape drives installed, we
recommend that you link the no-rewind-on-close floppy-tape
device to the default tape device /dev/tape.
- +o
- While still in single-user mode, run the script
/etc/conf/bin/idmkcoh. This generates a new
kernel that can access the tape drive.
- +o
- Reboot your system and invoke the newly built kernel.
Manipulating Tape Devices
The command tape manipulates tape devices.
With this command, you can rewind a tape, check the status
of a tape device, or perform other useful tasks. For
details, see its entry in the Lexicon.
Command ftbad lets you view and edit the
list of bad blocks on a floppy-tape cartridge. For details
on how to use this command, use see its entry in the
Lexicon.
For details on how to build backups onto tape devices, see
the Lexicon entry backups.
See Also
Notes
Systems with a very slow CPU (e.g., a 16-megahertz 80386SX)
may have trouble running the floppy-tape driver
ft in multi-user mode. The reason is that
floppy-tape hardware does not have much intelligence built
into it, so the driver must consume many CPU cycles. In
such instances, we suggest that you back up your system
while in single-user mode (which is a good idea in any
case).