1.\" Copyright (c) 1983, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)mtio.4 6.5 (Berkeley) 03/27/91 7.\" 8.Dd 9.Dt MTIO 4 vax 10.Os BSD 4.2 11.Sh NAME 12.Nm mtio 13.Nd 14.Tn UNIX 15magtape interface 16.Sh DESCRIPTION 17The special files 18named 19.Pa /dev/mt0 20and 21.Pa /dev/rmt0 22through 23.Pa /dev/mt23 24and 25.Pa /dev/rmt23 26refer to 27.Tn UNIX 28magtape drives, 29which may be on the 30.Tn MASSBUS 31using the 32.Tn TM03 33formatter 34.Xr ht 4 , 35or 36.Tn TM78 37formatter, 38.Xr mt 4 , 39or on the 40.Tn UNIBUS 41using either the 42.Tn TM11 43or 44.Tn TS11 45formatters 46.Xr tm 4 , 47.Tn TU45 48compatible formatters, 49.Xr ut 4 , 50or 51.Xr ts 4 . 52These devices are typical tape block devices, 53see 54.Xr physio 4 . 55.Pp 56The following table of the converntional device names 57is applicable to any of the transport/controller pairs. 58(But note that only 1600 59.Tn BPI 60is available with the 61.Tn TS11 . ) 62.Bl -column "no-rewindxxx" "or lowest densityxx" "or lowest densityxx" "or lowest densityxx" -offset indent 63 800 BPI 1600 BPI 6500 BPI 64.Em or lowest density or second density or third density 65 66Rewind mt0/rmt0 mt8/rmt8 mt16/rmt16 67Rewind mt1/rmt1 mt9/rmt9 mt17/rmt17 68Rewind mt2/rmt2 mt10/rmt10 mt18/rmt18 69Rewind mt3/rmt3 mt11/rmt11 mt19/rmt19 70No-rewind nmt4/nrmt4 nmt12/nrmt12 nmt20/nrmt20 71No-rewind nmt5/nrmt5 nmt13/nrmt13 nmt21/nrmt21 72No-rewind nmt6/nrmt6 nmt14/nrmt14 nmt22/nrmt22 73No-rewind nmt7/nrmt7 nmt15/nrmt15 nmt23/nrmt32 74.El 75.Pp 76The rewind devices automatically rewind 77when the last requested read, write or seek has finished, or the end of the tape 78has been reached. The letter 79.Ql n 80is usually prepended to 81the name of the no-rewind devices. 82.Pp 83Unix tapes are written in multiples of 1024 byte block 84records. Two end-of-file markers mark the end of a tape, and 85one end-of-file marker marks the end of a tape file. 86If the tape is not to be rewound it is positioned with the 87head in between the two tape marks, where the next write 88will over write the second end-of-file marker. 89.Pp 90All of the magtape devices may be manipulated with the 91.Xr mt 1 92command. 93.Pp 94A number of 95.Xr ioctl 2 96operations are available 97on raw magnetic tape. 98The following definitions are from 99.Aq Pa sys/mtio.h : 100.Bd -literal 101/* 102 * Structures and definitions for mag tape io control commands 103 */ 104 105/* structure for MTIOCTOP - mag tape op command */ 106struct mtop { 107 short mt_op; /* operations defined below */ 108 daddr_t mt_count; /* how many of them */ 109}; 110 111/* operations */ 112#define MTWEOF 0 /* write an end-of-file record */ 113#define MTFSF 1 /* forward space file */ 114#define MTBSF 2 /* backward space file */ 115#define MTFSR 3 /* forward space record */ 116#define MTBSR 4 /* backward space record */ 117#define MTREW 5 /* rewind */ 118#define MTOFFL 6 /* rewind and put the drive offline */ 119#define MTNOP 7 /* no operation, sets status only */ 120#define MTCACHE 8 /* enable controller cache */ 121#define MTNOCACHE 9 /* disable controller cache */ 122 123/* structure for MTIOCGET - mag tape get status command */ 124 125struct mtget { 126 short mt_type; /* type of magtape device */ 127/* the following two registers are grossly device dependent */ 128 short mt_dsreg; /* ``drive status'' register */ 129 short mt_erreg; /* ``error'' register */ 130/* end device-dependent registers */ 131 short mt_resid; /* residual count */ 132/* the following two are not yet implemented */ 133 daddr_t mt_fileno; /* file number of current position */ 134 daddr_t mt_blkno; /* block number of current position */ 135/* end not yet implemented */ 136}; 137 138/* 139 * Constants for mt_type byte. These are the same 140 * for controllers compatible with the types listed. 141 */ 142#define MT_ISTS 0x01 /* TS-11 */ 143#define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */ 144#define MT_ISTM 0x03 /* TM11/TE10 Unibus */ 145#define MT_ISMT 0x04 /* TM78/TU78 Massbus */ 146#define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */ 147#define MT_ISCPC 0x06 /* SUN */ 148#define MT_ISAR 0x07 /* SUN */ 149#define MT_ISTMSCP 0x08 /* DEC TMSCP protocol (TU81, TK50) */ 150#define MT_ISCY 0x09 /* CCI Cipher */ 151#define MT_ISCT 0x0a /* HP 1/4 tape */ 152#define MT_ISFHP 0x0b /* HP 7980 1/2 tape */ 153#define MT_ISEXABYTE 0x0c /* Exabyte */ 154#define MT_ISEXA8200 0x0c /* Exabyte EXB-8200 */ 155#define MT_ISEXA8500 0x0d /* Exabyte EXB-8500 */ 156#define MT_ISVIPER1 0x0e /* Archive Viper-150 */ 157#define MT_ISPYTHON 0x0f /* Archive Python (DAT) */ 158#define MT_ISHPDAT 0x10 /* HP 35450A DAT drive */ 159 160/* mag tape io control commands */ 161#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */ 162#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */ 163#define MTIOCIEOT _IO('m', 3) /* ignore EOT error */ 164#define MTIOCEEOT _IO('m', 4) /* enable EOT error */ 165 166#ifndef KERNEL 167#define DEFTAPE "/dev/rmt12" 168#endif 169 170#ifdef KERNEL 171/* 172 * minor device number 173 */ 174 175#define T_UNIT 003 /* unit selection */ 176#define T_NOREWIND 004 /* no rewind on close */ 177#define T_DENSEL 030 /* density select */ 178#define T_800BPI 000 /* select 800 bpi */ 179#define T_1600BPI 010 /* select 1600 bpi */ 180#define T_6250BPI 020 /* select 6250 bpi */ 181#define T_BADBPI 030 /* undefined selection */ 182#endif 183.Ed 184.Pp 185.Sh FILES 186.Bl -tag -width /dev/rmt? -compact 187.It Pa /dev/mt? 188.It Pa /dev/rmt? 189.El 190.Sh SEE ALSO 191.Xr mt 1 , 192.Xr tar 1 , 193.Xr tp 1 , 194.Xr ht 4 , 195.Xr tm 4 , 196.Xr ts 4 , 197.Xr mt 4 , 198.Xr ut 4 199.Sh HISTORY 200The 201.Nm mtio 202manual appeared in 203.Bx 4.2 . 204.Sh BUGS 205The status should be returned in a device independent format. 206.Pp 207The special file naming should be redone in a more consistent and 208understandable manner. 209