1*61599Sbostic.\" Copyright (c) 1983, 1991, 1993 2*61599Sbostic.\" The Regents of the University of California. All rights reserved. 320734Smckusick.\" 443582Strent.\" %sccs.include.redist.man% 520734Smckusick.\" 6*61599Sbostic.\" @(#)mtio.4 8.1 (Berkeley) 06/05/93 738804Sbostic.\" 847674Scael.Dd 947674Scael.Dt MTIO 4 vax 1047674Scael.Os BSD 4.2 1147674Scael.Sh NAME 1247674Scael.Nm mtio 1347674Scael.Nd 1447674Scael.Tn UNIX 1547674Scaelmagtape interface 1647674Scael.Sh DESCRIPTION 1747674ScaelThe special files 1847674Scaelnamed 1947674Scael.Pa /dev/mt0 2047674Scaeland 2147674Scael.Pa /dev/rmt0 2247674Scaelthrough 2347674Scael.Pa /dev/mt23 2447674Scaeland 2547674Scael.Pa /dev/rmt23 2647674Scaelrefer to 2747674Scael.Tn UNIX 2847674Scaelmagtape drives, 2947674Scaelwhich may be on the 3047674Scael.Tn MASSBUS 3147674Scaelusing the 3247674Scael.Tn TM03 3347674Scaelformatter 3447674Scael.Xr ht 4 , 3520734Smckusickor 3647674Scael.Tn TM78 3747674Scaelformatter, 3847674Scael.Xr mt 4 , 3947674Scaelor on the 4047674Scael.Tn UNIBUS 4147674Scaelusing either the 4247674Scael.Tn TM11 4347674Scaelor 4447674Scael.Tn TS11 4547674Scaelformatters 4647674Scael.Xr tm 4 , 4747674Scael.Tn TU45 4847674Scaelcompatible formatters, 4947674Scael.Xr ut 4 , 5047674Scaelor 5147674Scael.Xr ts 4 . 5247674ScaelThese devices are typical tape block devices, 5347674Scaelsee 5447674Scael.Xr physio 4 . 5547674Scael.Pp 5647674ScaelThe following table of the converntional device names 5747674Scaelis applicable to any of the transport/controller pairs. 5847674Scael(But note that only 1600 5947674Scael.Tn BPI 6047674Scaelis available with the 6147674Scael.Tn TS11 . ) 6247674Scael.Bl -column "no-rewindxxx" "or lowest densityxx" "or lowest densityxx" "or lowest densityxx" -offset indent 6347674Scael 800 BPI 1600 BPI 6500 BPI 6447674Scael.Em or lowest density or second density or third density 6547674Scael 6647674ScaelRewind mt0/rmt0 mt8/rmt8 mt16/rmt16 6747674ScaelRewind mt1/rmt1 mt9/rmt9 mt17/rmt17 6847674ScaelRewind mt2/rmt2 mt10/rmt10 mt18/rmt18 6947674ScaelRewind mt3/rmt3 mt11/rmt11 mt19/rmt19 7047674ScaelNo-rewind nmt4/nrmt4 nmt12/nrmt12 nmt20/nrmt20 7147674ScaelNo-rewind nmt5/nrmt5 nmt13/nrmt13 nmt21/nrmt21 7247674ScaelNo-rewind nmt6/nrmt6 nmt14/nrmt14 nmt22/nrmt22 7347674ScaelNo-rewind nmt7/nrmt7 nmt15/nrmt15 nmt23/nrmt32 7447674Scael.El 7547674Scael.Pp 7647674ScaelThe rewind devices automatically rewind 7747674Scaelwhen the last requested read, write or seek has finished, or the end of the tape 7847674Scaelhas been reached. The letter 7947674Scael.Ql n 8047674Scaelis usually prepended to 8147674Scaelthe name of the no-rewind devices. 8247674Scael.Pp 8347674ScaelUnix tapes are written in multiples of 1024 byte block 8447674Scaelrecords. Two end-of-file markers mark the end of a tape, and 8547674Scaelone end-of-file marker marks the end of a tape file. 8647674ScaelIf the tape is not to be rewound it is positioned with the 8747674Scaelhead in between the two tape marks, where the next write 8847674Scaelwill over write the second end-of-file marker. 8947674Scael.Pp 9047674ScaelAll of the magtape devices may be manipulated with the 9147674Scael.Xr mt 1 9247674Scaelcommand. 9347674Scael.Pp 9447674ScaelA number of 9547674Scael.Xr ioctl 2 9647674Scaeloperations are available 9720734Smckusickon raw magnetic tape. 9820734SmckusickThe following definitions are from 9947674Scael.Aq Pa sys/mtio.h : 10047674Scael.Bd -literal 10120734Smckusick/* 10220734Smckusick * Structures and definitions for mag tape io control commands 10320734Smckusick */ 10420734Smckusick 10520734Smckusick/* structure for MTIOCTOP - mag tape op command */ 10620734Smckusickstruct mtop { 10720734Smckusick short mt_op; /* operations defined below */ 10820734Smckusick daddr_t mt_count; /* how many of them */ 10920734Smckusick}; 11020734Smckusick 11120734Smckusick/* operations */ 11220734Smckusick#define MTWEOF 0 /* write an end-of-file record */ 11320734Smckusick#define MTFSF 1 /* forward space file */ 11420734Smckusick#define MTBSF 2 /* backward space file */ 11520734Smckusick#define MTFSR 3 /* forward space record */ 11620734Smckusick#define MTBSR 4 /* backward space record */ 11720734Smckusick#define MTREW 5 /* rewind */ 11820734Smckusick#define MTOFFL 6 /* rewind and put the drive offline */ 11920734Smckusick#define MTNOP 7 /* no operation, sets status only */ 12047674Scael#define MTCACHE 8 /* enable controller cache */ 12147674Scael#define MTNOCACHE 9 /* disable controller cache */ 12220734Smckusick 12320734Smckusick/* structure for MTIOCGET - mag tape get status command */ 12420734Smckusick 12520734Smckusickstruct mtget { 12620734Smckusick short mt_type; /* type of magtape device */ 12720734Smckusick/* the following two registers are grossly device dependent */ 12820734Smckusick short mt_dsreg; /* ``drive status'' register */ 12920734Smckusick short mt_erreg; /* ``error'' register */ 13020734Smckusick/* end device-dependent registers */ 13120734Smckusick short mt_resid; /* residual count */ 13220734Smckusick/* the following two are not yet implemented */ 13320734Smckusick daddr_t mt_fileno; /* file number of current position */ 13420734Smckusick daddr_t mt_blkno; /* block number of current position */ 13520734Smckusick/* end not yet implemented */ 13620734Smckusick}; 13720734Smckusick 13820734Smckusick/* 13928262Skarels * Constants for mt_type byte. These are the same 14047674Scael * for controllers compatible with the types listed. 14120734Smckusick */ 14228262Skarels#define MT_ISTS 0x01 /* TS-11 */ 14328262Skarels#define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */ 14428262Skarels#define MT_ISTM 0x03 /* TM11/TE10 Unibus */ 14528262Skarels#define MT_ISMT 0x04 /* TM78/TU78 Massbus */ 14628262Skarels#define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */ 14728262Skarels#define MT_ISCPC 0x06 /* SUN */ 14828262Skarels#define MT_ISAR 0x07 /* SUN */ 14928262Skarels#define MT_ISTMSCP 0x08 /* DEC TMSCP protocol (TU81, TK50) */ 15047674Scael#define MT_ISCY 0x09 /* CCI Cipher */ 15147674Scael#define MT_ISCT 0x0a /* HP 1/4 tape */ 15247674Scael#define MT_ISFHP 0x0b /* HP 7980 1/2 tape */ 15347674Scael#define MT_ISEXABYTE 0x0c /* Exabyte */ 15447674Scael#define MT_ISEXA8200 0x0c /* Exabyte EXB-8200 */ 15547674Scael#define MT_ISEXA8500 0x0d /* Exabyte EXB-8500 */ 15647674Scael#define MT_ISVIPER1 0x0e /* Archive Viper-150 */ 15747674Scael#define MT_ISPYTHON 0x0f /* Archive Python (DAT) */ 15847674Scael#define MT_ISHPDAT 0x10 /* HP 35450A DAT drive */ 15920734Smckusick 16020734Smckusick/* mag tape io control commands */ 16147674Scael#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */ 16247674Scael#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */ 16347674Scael#define MTIOCIEOT _IO('m', 3) /* ignore EOT error */ 16447674Scael#define MTIOCEEOT _IO('m', 4) /* enable EOT error */ 16520734Smckusick 16620734Smckusick#ifndef KERNEL 16720734Smckusick#define DEFTAPE "/dev/rmt12" 16820734Smckusick#endif 16947674Scael 17047674Scael#ifdef KERNEL 17147674Scael/* 17247674Scael * minor device number 17347674Scael */ 17447674Scael 17547674Scael#define T_UNIT 003 /* unit selection */ 17647674Scael#define T_NOREWIND 004 /* no rewind on close */ 17747674Scael#define T_DENSEL 030 /* density select */ 17847674Scael#define T_800BPI 000 /* select 800 bpi */ 17947674Scael#define T_1600BPI 010 /* select 1600 bpi */ 18047674Scael#define T_6250BPI 020 /* select 6250 bpi */ 18147674Scael#define T_BADBPI 030 /* undefined selection */ 18247674Scael#endif 18347674Scael.Ed 18447674Scael.Pp 18547674Scael.Sh FILES 18647674Scael.Bl -tag -width /dev/rmt? -compact 18747674Scael.It Pa /dev/mt? 18847674Scael.It Pa /dev/rmt? 18947674Scael.El 19047674Scael.Sh SEE ALSO 19147674Scael.Xr mt 1 , 19247674Scael.Xr tar 1 , 19347674Scael.Xr tp 1 , 19447674Scael.Xr ht 4 , 19547674Scael.Xr tm 4 , 19647674Scael.Xr ts 4 , 19747674Scael.Xr mt 4 , 19847674Scael.Xr ut 4 19947674Scael.Sh HISTORY 20047674ScaelThe 20147674Scael.Nm mtio 20247674Scaelmanual appeared in 20347674Scael.Bx 4.2 . 20447674Scael.Sh BUGS 20520734SmckusickThe status should be returned in a device independent format. 20647674Scael.Pp 20728262SkarelsThe special file naming should be redone in a more consistent and 20828262Skarelsunderstandable manner. 209