1SCSITAPE(1)                 General Commands Manual                SCSITAPE(1)
2
3
4

NAME

6       scsitape - control SCSI tape devices
7

SYNOPSIS

9       scsitape [-f <scsi-generic-device>] commands
10

DESCRIPTION

12       The  scsitape  command controls SCSI tape drives in a platform-indepen‐
13       dent manner. As long as 'mtx' works on the  platform,  so  does  'scsi‐
14       tape'.
15
16       Note that 'scsitape' and your OS's native tape driver may stomp on each
17       other. In particular, if you use 'setblk' and  your  OS's  native  tape
18       driver  has  a  different  notion  of  the block size, you may get evil
19       results.  It is recommended to use 'scsitape' only for  software  where
20       you've  written your own low-level READ and WRITE routines that use the
21       SCSI command set to directly talk to tape drives (i.e., you do not  use
22       the OS's native tape driver at all).
23

OPTIONS

25       The  first  argument,  given  following -f , is the SCSI generic device
26       corresponding to your tape drive.  Consult your operating system's doc‐
27       umentation  for  more  information  (for example, under Linux these are
28       generally  /dev/sg0  through  /dev/sg15,  under   FreeBSD   these   are
29       /dev/pass0  through  /dev/passX. Under Solaris this is usually the same
30       as your tape drive (Solaris has a SCSI passthrough ioctl). You can  set
31       the STAPE or TAPE environment variable rather than use -f.
32

COMMANDS

34       setblk <n>
35                 Set  the tape drive's SCSI block size to <n> bytes. (NOTE: if
36                 you are using your OS's native tape driver, THIS IS EVIL!).
37
38
39       fsf <n>   Go forward by <n> tapemarks.
40
41       bsf <n>   Go to  immediately  previous  the  <n>th  previous  tapemark.
42                 (WARNING: This probably doesn't do what you expect -- e.g. if
43                 you are immediately after a tapemark and  type  'bfs  1',  it
44                 moves to immediately *before* that tape mark, for a sum total
45                 of zero effective movement!).
46
47       eod       Go to end of data.
48
49       rewind    Rewind the tape drive.
50
51       eject     Eject the tape currently in the drive.
52
53       erase     Does a *short* erase (warning: does NOT work on all drives!).
54
55       mark <n>
56                  write <n> filemarks ( 'mark 0' flushes the  drive's  buffers
57                 ).
58
59       seek <n>  Seek  to a logical position <n> that was reported by a previ‐
60                 ous 'tapeinfo' command.
61
62       write <blocksize>
63                 write blocks from stdin to the  tape.  Chunk  the  data  into
64                 <blocksize>-sized  chunks.  *DOES  NOT WRITE OUT A TAPEMARK!*
65                 (you will need to use a subsequent mark 1  command  to  write
66                 out a tape mark).
67
68       read [<blocksize>] [ <#blocks/#bytes> ]
69                 read blocks from the tape, write them to stdout. If we are in
70                 variable block mode, <blocksize> should be  zero  (note:  The
71                 maximum  block  size  we  currently support in variable block
72                 mode is 128K, MAX_READ_SIZE will need to  be  turned  into  a
73                 settable  variable  to allow bigger reads). If <blocksize> is
74                 ommitted, we assume that we're in variable  block  mode,  and
75                 that  we  are going to read from tape until we hit a tapemark
76                 or end of partition or end of tape.
77
78
79

AUTHORS

81       This program was written by Eric Lee  Green  <eric@badtux.org>.   Major
82       portions  of  the  'mtxl.c' library used herein were written by Leonard
83       Zubkoff.
84
85       The SCSI read and write routines are based upon those that Richard Fish
86       wrote  for  Enhanced  Software  Technology's BRU 16.1 product, substan‐
87       tially modified to work in our particular environment  (in  particular,
88       all  the  variable  block  stuff is new since BRU only does fixed block
89       reads and writes, and the BRU code uses bitmasks rather than  bitfields
90       for  the  various  flags  and such in return values, as well as the BRU
91       code having a different SCSI API and having variable names considerably
92       shorter  than the rather sesquipedalian 'mtx' identifiers). As required
93       by 'mtxl.c', these routines are licensed under the GNU  General  Public
94       License.
95
96

HINTS

98       Under  Linux,  cat  /proc/scsi/scsi will tell you what SCSI devices you
99       have.  You can then refer to them as /dev/sga, /dev/sgb,  etc.  by  the
100       order they are reported.
101
102       Under  FreeBSD,  camcontrol devlist will tell you what SCSI devices you
103       have, along with which pass device controls them.
104
105       Under Solaris 7  and  8,  /usr/sbin/devfsadm  -C  will  clean  up  your
106       /devices  directory. Then find /devices -name 'st@*' -print will return
107       a list of all tape drives. /dev on Solaris is apparently only  of  his‐
108       torical interest.
109
110

BUGS AND LIMITATIONS

112       for  scsitape read 0 <n> where  you are doing variable-block-size reads
113       and wish for <n> bytes, it instead reads one and exactly one block from
114       tape  and prints that (no matter what its size). Use 'dd' on the output
115       of scsitape if you want finer control.
116
117       scsitape read 0 attempts reads of  MAX_READ_SIZE,  which  is  currently
118       128K.  If blocks on tape are larger than 128K, only the first 128K will
119       be read -- the remainder will be silently dumped in the toilet.
120
121       This program does not interact well (or  at  all  :-)  with  your  OS's
122       native  tape  driver.   You  will likely see weird things happen if you
123       attempt to intermingle scsitape commands with native tape driver opera‐
124       tions. Note that BRU 16.1 for Solaris (and possibly others, but Solaris
125       I know about) will have a 'scsi' keyword  to  bypass  the  native  tape
126       driver and write via direct uscsi commands, so if you use ´scsitape´ to
127       bypass the flaws of the native Solaris driver, you can use BRU 16.1  to
128       write  your  actual  tape  archives.  (Assuming  that BRU 16.1 has been
129       released at the time that you read this).
130
131

AVAILABILITY

133       This version of scsitape is currently being maintained by Robert Nelson
134       <robertnelson@users.sourceforge.net> as part of the 'mtx' suite of pro‐
135       grams. The 'mtx' home page is http://mtx.sourceforge.net and the actual
136       code  is  currently  available  there  and  via SVN from http://source
137       forge.net/projects/mtx.
138
139

SEE ALSO

141       loaderinfo(1),tapeinfo(1),mtx(1)
142
143
144
145                                  SCSITAPE1.0                      SCSITAPE(1)
Impressum