tape(C) 06 January 1993 tape(C) Name tape - magnetic tape maintenance program Syntax tape [ -8cfis ] [ -a arg ] command [ device ] Description The tape command sends commands to, and receives status from, the tape subsystem. tape can communicate with QIC-02 cartridge, SCSI (including HP DAT) tape drives, and QIC-40, QIC-80, and Irwin mini-cartridge tape drives. (The Irwin specific program mcart is invoked automatically by tape when options specific to the Irwin driver are used. Refer to the mcart(C) manual page for more information.) The tape command reads /etc/default/tape to find the default device name for sending commands and receiving status. For example, the following line in /etc/default/tape will cause tape to communicate with the QIC-02 cartridge tape device: device = /dev/xct0 If a device name is specified on the command line, it overrides the default device. tape queries the device to determine its device type. If the device does not respond to the query, tape will print a warning message and assume the device is a QIC-02 cartridge tape. The tape drive type may be specified using the following flags: -8 QIC-80 mini-cartridge tape -c QIC-02 cartridge tape -f QIC-40 mini-cartridge tape -i Irwin mini-cartridge tape -s SCSI tape (including HP DAT) See tape(HW) and the Release Notes for a list of supported tape drives. The -a flag allows an argument arg to be passed to the format, partition, and setblk commands. The following commands can be used with the various tape drivers sup- ported under UNIX. The letters following each command indicate which drivers support the command: A All drivers C QIC-02 cartridge tape driver F QIC-40 and QIC-80 mini-cartridge tape drivers H HP DAT tape driver only I Irwin mini-cartridge tape driver S SCSI tape driver (including HP DAT) The amount and reset commands can be used while the tape is busy with other operations. All other commands (including status) wait until the currently executing command has been completed before proceeding. When you are using the non-rewinding tape device or the tape commands rfm and wfm, the tape drive light remains on after the command has been com- pleted. Use the command tape rewind to clear this condition. amount (C,S,F) Report amount of data in current or last transfer. drive (I) Display information about the Irwin driver and the tape drive. See the mcart(C) manual page for more details. eod (H) Position the tape to the EOD, the end of written data. (See the dat(HW) manual page for more information.) erase (C,S,F) Erase and retension the tape cartridge. format (F,I) Format the tape cartridge. Floppy controller-based tapes must be for- matted before they can be used. This command takes approximately one minute per megabyte of tape capacity. For QIC-40 and QIC-80 tape drives only, the argument to the -a flag can be used to specify the number of tracks to be formatted. Only even numbers less than or equal to the number of tracks on the tape are allowed. See tape(HW) for more information. If no argument is given, the entire tape will be format- ted. Preformatted tapes are available which are more reliable than user- formatted tapes. Before reformatting a used tape, you must erase it with a bulk eraser. Proper use of a bulk eraser is not trivial; refer to the documentation for your bulk eraser. getbb (F) Print a list of bad tape blocks detected during the last tape opera- tion. This listing can be saved in a file for use by the putbb com- mand. info (I) Display Irwin cartridge information. See the mcart(C) manual page for more details. kapacity (I) Report Irwin cartridge capacity in 1024-byte blocks. See the mcart(C) manual page for more details. load (S) Load the tape cartridge. map (F) Print out a map of the bad blocks on the tape. The format is a series of lines of the format: track n: -------------X------... Each ``-'' represents a good block on the track; an ``X'' represents a block marked as bad. partition (H) Partition an HP DAT tape into logical partitions 1 and 2. The size (in megabytes) of partition 2 is specified on the command line. The size of partition 1 is the remainder of the tape. For example: tape -a 200 partition creates a 200-megabyte partition (in partition 2) while partition 1 comprises the rest of the tape. For a 1300 megabyte unformatted DAT tape, partition 1 would able to hold approximately 1100 megabytes of data. (See dat(HW) for additional information.) putbb (F) Read a list of bad tape blocks from the standard input and add them to the bad block table on the tape. The format expected by putbb is the same as generated by the getbb command. reset (C,S,F) Reset tape controller and tape drive. Clears error conditions and returns tape subsystem to power-up state. reten (A) Retension tape cartridge. Should be used periodically to remedy slack tape problems. Tape slack can cause an unusually large number of tape errors. rewind (A) Rewind to beginning of tape (BOT). (For HP DAT tapes: if the tape is partitioned, the logical partition is rewound to the logical BOT. See dat(HW) for details.) rfm (C,S) Wind tape forward to the next file mark. rsm (H) Position tape forward to the next setmark. (See the dat(HW) manual page for more information.) setblk (S) Set the tape block size to a specified byte size. For example, the following command sets the tape block size to 512 Bytes: tape -a 512 setblk Select variable block size by specifying a block size of 0 (zero). status (C,S,F) The status output looks like this: status: status message soft errors: n underruns: m Status is a report of the current status of the drive; ``no car- tridge'', ``write protected'', or ``beginning of tape'' are typical status messages. Soft errors is the number of recoverable errors that occurred during the last tape operation. A recoverable error is one which is correct- able by the drive or controller. An example of a non-recoverable ``hard'' error is an attempt to write to a write-protected cartridge. Note that if the number of soft errors greatly exceeds the manufactur- er's specifications, the drive may require service or replacement, or you may be using a defective tape. Underruns is the number of times the tape drive had to stop and res- tart due to tape buffer underflows. Underruns are not an error indica- tion; they mean that the data transfer did not occur at the drive's maximum data transfer rate. The number of underruns can be affected by system load. If you use the status command while the tape drive is busy, no message is displayed until the drive is free. unload (S) Unload the tape cartridge. wfm (C,S) Write a file mark at the current tape position. wsm (H) Write a setmark at the current tape position. (See the dat(HW) manual page for more information.) Exit values The following exit values may be returned by tape (for Irwin drives, refer to the exit codes listed on the mcart(C) manual page): 0 Normal exit with no error. 1 Faulty cables, or no cartridge in drive. 2 Incorrect command syntax, unknown or bad tape format, unknown drive type, or device special file not found. 3 Cartridge write protected, or no data on cartridge. 4 Device in use by another process. Files Device special files: /dev/rStp0 /dev/rct0 /dev/erct0 /dev/rmc1 /dev/nrStp0 /dev/nrct0 /dev/xct0 /dev/xStp0 /dev/rct2 /dev/rctmini /dev/rft0 /dev/nrct2 /dev/xctmini /dev/xft0 /dev/xct0 /dev/rmc0 Device special files for DAT tapes: /dev/urStp0.0 /dev/urStp0.1 /dev/nurStp0.0 /dev/nurStp0.1 /dev/nrStp0.0 /dev/nrStp0.1 /dev/xStp0.0 /dev/xStp0.1 The DAT partition 1 is linked to the default SCSI tape device locations: /dev/rStp0 linked to /dev/nurStp0.0 /dev/rStp0.0 linked to /dev/nurStp0.0 /dev/nrStp0 linked to /dev/nrStp0.0 /dev/xStp0 linked to /dev/xStp0.0 /dev/urStp0 linked to /dev/urStp0.0 /dev/rStp0.1 linked to /dev/nurStp0.1 Note that if you have not installed a cartridge tape on your system, SCSI tapes device are linked to /dev/rct0. For more information on device files, see the tape(HW) manual page. Default configuration files: /etc/default/mcconfig configuration file used by mcart(C) /etc/default/tape configuration file used by tape Executable files: /etc/mcdaemon background service program used by mcart(C) /usr/bin/mcart mcart(C) executable file /usr/bin/tape tape executable file Include files: /usr/include/sys/tape.h /usr/include/sys/ct.h /usr/include/sys/ft.h /usr/include/sys/ir.h See also backup(ADM), cpio(C), dd(C), mcart(C), mcconfig(F), restore(ADM), tape(HW), tar(C), xbackup(ADM), xrestore(ADM) Standards conformance tape is not part of any currently supported standard; it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.