tape(HW)


tape -- magnetic tape device drivers

Description

The information on this page is provided for compatibility with applications built on previous releases. See the st01(HW) manual page for a description of the Release 6 interface, which also supports the functionality described on this page.

G Five different device drivers are provided for use with peripheral tape devices:


ct
QIC-02 cartridge tape drives described on cartridge(HW)

ft
QIC-40 and QIC-80 tape drives connected to the floppy disk controller described on floppytape(HW)

mc
Irwin tape drives connected to the floppy disk controller described on irwin(HW)

Stp
SCSI tape devices (cartridge, DAT, Exabyte, and nine-track) described on scsitape(HW)

cpqs
obsolete Compaq SCSI tape drives described on cpqs(HW)
Each driver supports a single tape drive with a raw (character, non-blocking) interface, except for the SCSI tape driver, which supports a number of devices only limited by the number of host adapters attached to your system or the 128KB DMA buffer required for each device. There are four standard tape device prefixes:

e
ECC devices that support a 2/64 error recovery scheme in software; the driver will correct up to two bad 512-byte blocks out of every 64 blocks. This feature is only available on the ct driver with the QIC-02 device. Other devices perform ECC in hardware.

n
no rewind on close used for storing and restoring multiple files. Not supported by the ft or mc drivers.

r
raw used for most normal tape work; performs an implicit rewind on close.

x
control devices used for issuing ioctl(S) calls to the tape subsystem. These devices do not require there to be a tape in the drive for the device to be opened.

Default tape device

By default, tape(C) uses the tape device named in the file /etc/default/tape. This file should always contain the control device name of the default device, and is normally updated using the mkdev tape command.

Definition of ioctl calls

The following request arguments to the ioctl(S) system call can be used with the various supported tape device drivers. Where the request requires an argument, this is passed by the argument arg to ioctl.

The letters following each description indicate which drivers support each ioctl call:


A
All drivers

C
QIC-02 cartridge tape driver (ct)

F
QIC-40 and QIC-80 mini-cartridge tape drivers (ft)

I
Irwin mini-cartridge tape driver (mc)

S
SCSI tape driver (Stp)


HP_ERASE (S)
Performs a fast erase for HP DAT.

MT_AMOUNT (C,F,S)
Writes a count of the amount of the last data transfer to an integer pointed to by the argument arg.

MT_DSTATUS (C,F,S)
Writes status information for the drive into the device-dependent structure pointed to by the argument arg.

MT_EOD (S)
Positions the tape at the EOD.

MT_ERASE (C,F,S)
Erases the data on the tape and retensions the cartridge.

MT_FORMAT (F,I)
Formats the tape. Expects as an argument (arg) the number of tracks to format, which must be an even number. If no argument is provided, the default is 20 tracks for QIC-40 drives, and 28 tracks for QIC-80 drives.

MT_FORMPART (S)
Formats the tape into two partitions. Partition 1 (the directory partition) is given the size in megabytes indicated by the int value of arg. If arg is 0 (zero), the tape is reformatted as a one-partition tape. This may fail if the drive is not positioned at physical BOT of the tape. Note that on some DAT drives, partition 1 is the first partition on the tape and partition 0 is the second. Also note that some drives will override the requested partition size.

MT_GETBLK (S)
Returns the tape block size in the Stp_bsize member of the struct Stp_stuff pointed to by arg.

MT_GETCOMP (S)
Returns the compression status in the int pointed to by arg.

MT_GETDENSITY (S)
Returns the tape density in the Stp_density member of the struct Stp_stuff pointed to by arg.

MT_GETHDR (F,I)
Expects as an argument (arg) a pointer to a struct ft_header or struct ir_header and copies the header of the current tape into it.

MT_GETNEWBB (F,I)
Takes a pointer to a struct ft_newbbt or struct ir_newbbt as an argument (arg), and copies in a list of bad blocks detected on the last write operation.

MT_GETPART (S)
Returns the current partition number in the Stp_part member of the struct Stp_stuff pointed to by arg.

MT_GSPEED (S)
Returns the speed setting of the tape drive in the Stp_speed member of the struct Stp_stuff pointed to by arg.

MT_GETVTBL (F,I)
Takes a pointer to a struct ft_vtbl as an argument (arg), and copies in the volume table from the tape.

MT_LOAD (S)
On devices which are capable of doing so, loads the tape into the drive.

MT_LOCATE (S)
Positions tape at the logical block address given by the position member of the struct tape_position pointed to by arg.

MT_LOCK (S)
Performs a pseudo-close operation; rewinds the tape and locks the contents of the tape buffer. Used when performing a multi-volume backup when EOT is reached. The data is flushed from the buffer by an MT_UNLOCK.

MT_PUTHDR (F,I)
Takes a pointer to a struct ft_header or struct ir_header as an argument (arg), and writes it onto the tape. This call should be used with caution.

MT_PUTNEWBB (F,I)
Takes a pointer to a struct ft_newbbt or struct ir_newbbt as an argument (arg), reads in the header from the tape, then writes a new bad block onto the tape with the new bad blocks from the provided bad block table.

MT_PUTVTBL (F,I)
Takes a pointer to a struct ft_vtbl as an argument (arg), and writes the volume table onto the tape. This call should be used with caution.

MT_RBK (S)
Moves the tape head forward arg logical blocks. The default is one block. Any data in the tape buffer is flushed.

MT_READPOS (S)
Returns the logical block address of the tape in the position member of the struct tape_position pointed to by arg. Any unwritten data is flushed to the tape before executing the command so that the block address is correct.

MT_RECOVER (S)
Copies any uncommitted data back to the user application and frees any kernel buffers.

MT_REMAIN (S)
Returns the number of bytes of data remaining in the tape buffer in the int pointed to by arg.

MT_REPORT (C,F,S)
Writes a code according to the type of tape device to an integer pointed to by the argument arg. The device type codes are defined in /usr/include/sys/tape.h.

MT_RESET (C,F,S)
Resets the driver software and the tape drive. Interrupts tape operations in progress.

MT_RETEN (A)
Winds the tape forward to EOT and then backward to BOT.

MT_REWIND (A)
Rewinds the tape to BOT.

MT_RFM (A)
Winds the tape forward to the next filemark.

MT_RSM (S)
Winds the tape forward to the next setmark.

MT_SETANSI (S)
Marks unit as having ANSI EOT handling.

MT_SETBLK (S)
Sets the block size (in bytes) of the tape blocks. Takes as an argument (arg) the size in bytes; if this is 0 (zero), use a variable block size. The block size remains set until the next close of the raw (not override) tape device.

MT_SETCOMP (S)
Sets the compression status to the int value passed by arg.

MT_SETDENSITY (S)
Sets the tape density to the int value passed by arg.

MT_SETPART (S)
Changes the active partition to that specified by the int value of arg.

MT_SSPEED (S)
Sets the speed setting of the tape drive to the int value of arg.

MT_STATUS (C,F,S)
Writes the status of the drive into a device-independent structure tape_info pointed to by the argument arg. The tape_info structure is defined in /usr/include/sys/tape.h.

MT_SERVO (F,I)
Writes servo marks on a blank tape in preparation for formatting with MT_FORMAT. If the tape has previously been servo-written, this command may fail unless the tape is first bulk-erased with a commercial tape eraser. Normally, a tape should only be servo-written once in its lifetime, although it can be formatted many times.

MT_UNLOAD (S)
On devices which are capable of doing so, unloads the tape from the drive.

MT_UNLOCK (S)
Performs a pseudo-open operation; flushes the contents of the tape buffer after loading the tape.

MT_WFM (A)
Writes a filemark at the current location on the tape.

MT_WMFM (A)
Writes multiple file markers to tape, as supported by the SCO OpenServer tape subsystems. The number of arguments is that specified in the third ioctl argument

MT_WSM (S)
Writes a setmark at the current location on the tape.

Limitations

After certain tape operations are executed, the system returns a prompt before the tape controller has finished its operation. If the user enters another tape command too quickly, a ``device busy'' error is returned until the tape device is finished with its previous operation.

Periodic tape cartridge retensioning and tape head cleaning are necessary for continued error-free operation of the tape subsystem. Use tape to retension the tape.

Files


/dev/rct0
default tape device for cartridge, SCSI, and Compaq drives

/dev/rctmini
default tape device for Irwin, QIC-40, and QIC-80 drives

/usr/include/sys/ct.h
header file for the cartridge tape driver (ct)

/usr/include/sys/ft.h
header file for the floppy tape driver (ft)

/usr/include/sys/ir.h
header file for the Irwin mini-cartridge tape driver (mc)

/usr/include/sys/Stp.h
header file for the SCSI tape driver (Stp)

/usr/include/sys/tape.h
general header file for tape drivers

See also

cartridge(HW), cpqs(HW), floppytape(HW), ioctl(S), irwin(HW), mcart(C), mcconfig(F), mkdev(ADM), scsitape(HW), st01(HW), tape(C)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005