ht(4) [v7 man page]
HT(4) Kernel Interfaces Manual HT(4) NAME
ht - RH-11/TU-16 magtape interface DESCRIPTION
The files mt0, mt1, ... refer to the DEC RH/TM/TU16 magtape. When opened for reading or writing, the tape is not rewound. When closed, it is rewound (unless the 0200 bit is on, see below). If the tape was open for writing, a double end-of-file is written. If the tape is not to be rewound the tape is backspaced to just between the two tapemarks. A standard tape consists of a series of 512 byte records terminated by a double end-of-file. To the extent possible, the system makes it possible, if inefficient, to treat the tape like any other file. Seeks have their usual meaning and it is possible to read or write a byte at a time. Writing in very small units is inadvisable, however, because it tends to create monstrous record gaps. The last octal digit of the minor device number selects the drive. The middle digit selects a controller. The initial digit is even to select 800 BPI, odd to select 1600 BPI. If the 0200 bit is on (initial digit 2 or 3), the tape is not rewound on close. Note that the minor device number has no necessary connection with the file name, and in fact tp(1) turns the short name x into `/dev/mtx'. The mt files discussed above are useful when it is desired to access the tape in a way compatible with ordinary files. When foreign tapes are to be dealt with, and especially when long records are to be read or written, the `raw' interface is appropriate. The associated files may be named rmt0, ..., rmt7, but the same minor-device considerations as for the regular files still apply. Each read or write call reads or writes the next record on the tape. In the write case the record has the same length as the buffer given. During a read, the record size is passed back as the number of bytes read, provided it is no greater than the buffer size; if the record is long, an error is indicated. In raw tape I/O, the buffer must begin on a word boundary and the count must be even. Seeks are ignored. A zero count is returned when a tape mark is read; another read will fetch the first record of the next tape file. FILES
/dev/mt?, /dev/rmt? SEE ALSO
tp(1) BUGS
The magtape system is supposed to be able to take 64 drives. Such addressing has never been tried. Taking a drive off line, or running off the end of tape, while writing have been known to hang the system. If any non-data error is encountered, it refuses to do anything more until closed. In raw I/O, there should be a way to perform forward and backward record and file spacing and to write an EOF mark explicitly. HT(4)
Check Out this Related Man Page
mt(1) General Commands Manual mt(1) Name mt - magnetic tape manipulating program Syntax mt [-f tapename] command [count] Description The command permits the operation of a magnetic tape drive. Options The -f flag option uses the specified tape device (next argument) in place of either that tape device defined by your TAPE environment variable (.login or .profile) or /dev/nrmt0h. Some operations may be performed multiple times by specifying count. By default, performs the requested operation once. The command argument defines the operation to be performed. Only as many characters as are required to uniquely identify a command need be specified. The following is a list of commands: bsf Backspace count files. bsr Backspace count records. cache Allows to use the cache buffer on a tape drive that has the cache buffer feature. clhrdsf Clear hardware/software problem. Works with tape drives which use the TMSCP tape controller interface This command is restricted to root access only. clserex Clear serious exception. Works with tape drives which use the TMSCP tape controller interface clsub Clear subsystem. Works with tape drives which use the TMSCP tape controller interface This command is restricted to root access only. eof, weof Write count end-of-file marks at the current position on the tape. eotdis Disable end-of-tape detection. When the end of tape is reached, the tape will run off the reel. Only the superuser can issue this command. The command remains in effect for the device until end-of-tape detection is enabled with the eoten command. eoten Enable end-of-tape detection. When the end-of-tape markers are reached, the tape is halted on the reel, between the two end-of-tape markers. Only the superuser can issue this command. The command remains in effect for the device until end-of-tape detection is disabled with the eotdis command. This is the default mode after a system boot. fsf Forward-space count files. fsr Forward-space count records. nocache Disables the use of the cache buffer for any tape drive that has the cache buffer feature. offline, rewoffl Rewind the tape and place the tape unit off-line. retension Retensions the tape. Retension means moving the tape one complete pass between EOT and BOT. rewind Rewind the tape. status Print status information about the tape unit. Examples This example shows how to rewind the tape mt -f /dev/rmt0l rewind This example shows how to backspace the tape nmt1h three files: mt -f /dev/nrmt1h bsf 3 This example shows how to write two end-of-file marks at the current position on tape nmt6h: mt -f /dev/nrmt6h eof 2 Return Values In shell scripts, returns a 0 exit status when the operation(s) were successful, 1 if the command was unrecognized, and 2 if an operation failed. Files /dev/rmt?h or /dev/rmt?l Raw magnetic tape interface with rewind when closed /dev/nmt?h or /dev/nmt?l Raw magnetic tape interface with no rewind when closed See Also dd(1), tar(1), ioctl(2), mtio(4), tms(4), environ(7) mt(1)