COHERENT manpages

This page displays the COHERENT manpage for tape [Magnetic-tape devices].

List of available manpages
Index


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:

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

hai  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.)

/dev/rStpN        SCSI tape unit N, raw device, rewind.
/dev/nrStpN       SCSI tape unit N, raw device, no rewind.
/dev/xStpN        SCSI tape unit N, control device.
/dev/rctN         QIC-24 tape unit N, raw device, rewind.
/dev/nrctN        QIC-24 tape unit N, raw device, no rewind.
/dev/xctN         QIC-24 tape unit N, control device.
/dev/ftN          QIC-40/80 (floppy tape), rewind.
/dev/nftN         QIC-40/80 (floppy tape), no rewind.
/dev/ctmini       Default mini-cartridge device, retensioning.
/dev/rctmini      Default mini-cartridge device, no retensioning.
/dev/xctmini      Default mini-cartridge device, control device.
/dev/mcN          Irwin floppy tape, retensioning
/dev/rmcN         Irwin floppy tape, no retensioning.
/dev/xmcN         Irwin floppy tape, control device.

Installing Tape Devices

To install a SCSI tape device onto your system, do the following:

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

-> After you have rebooted your system, log in as the superuser root.

-> cd to directory /etc/conf.

-> Invoke the command cohtune hai and set the variable HAI_TAPE to the SCSI
   ID of the tape drive -- usually two.

-> Invoke the command idmkcoh to build a new kernel.

-> Reboot your system and invoke the newly built kernel.

To install a floppy-tape device onto your system, do the following:

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

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

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

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

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

-> While still  in single-user mode, run  the script /etc/conf/bin/idmkcoh.
   This generates a new kernel that can access the tape drive.

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

Administering COHERENT,
backups,
ft,
ftbad,
hai,
tape [command]

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