File: scsitape.1

package info (click to toggle)
mtx 1.2.16rel-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 668 kB
  • ctags: 696
  • sloc: ansic: 4,382; sh: 2,489; python: 203; makefile: 126; perl: 117
file content (180 lines) | stat: -rw-r--r-- 6,693 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
.\" scsitape.1  Document Copyright 2001 Eric Lee Green
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
.\" USA.
.\"
.TH SCSITAPE 1 SCSITAPE1.0
.SH NAME
scsitape \- control SCSI tape devices 
.SH SYNOPSIS
scsitape [-f <scsi-generic-device>] commands
.SH DESCRIPTION
The 
.B scsitape
command controls SCSI tape drives in a platform-independent
manner. As long as 'mtx' works on the platform, so does 'scsitape'. 
.P
Note that 'scsitape' and your OS's native tape driver may stomp on each
other. In particular, if you use 'setblk' and your OS's native tape
driver has a different notion of the block size, you may get evil results.
It is recommended to use 'scsitape' only for software where you've written
your own low-level READ and WRITE routines that use the SCSI command set
to directly talk to tape drives (i.e., you do not use the OS's native tape
driver at all). 
.SH OPTIONS
The first argument, given following
.B -f
, is the SCSI generic device corresponding to your tape drive.
Consult your operating system's documentation for more information (for
example, under Linux these are generally /dev/sg0 through /dev/sg15, 
under FreeBSD these are /dev/pass0 through /dev/passX. Under Solaris
this is usually the same as your tape drive (Solaris has a SCSI passthrough
ioctl). You can set the STAPE or TAPE environment variable rather
than use -f.
.P
.SH COMMANDS
.TP 10
.B setblk <n>
Set the tape drive's SCSI block size to <n> bytes. (NOTE: if you are
using your OS's native tape driver, THIS IS EVIL!). 

.TP 10
.B fsf <n>
Go forward by <n> tapemarks.
.TP 10
.B bsf <n>
Go to immediately previous the <n>th previous tapemark. (WARNING: This
probably doesn't do what you expect -- e.g. if you are immediately
after a tapemark and type 'bfs 1', it moves to immediately *before*
that tape mark, for a sum total of zero effective movement!).
.TP 10
.B eod
Go to end of data. 
.TP 10
.B rewind
Rewind the tape drive.
.TP 10
.B eject
Eject the tape currently in the drive.
.TP 10
.B erase
Does a *short* erase (warning: does NOT work on all drives!). 
.TP 10
.B mark <n>
 write <n> filemarks ( 'mark 0' flushes the drive's buffers ). 
.TP 10
.B seek <n>
Seek to a logical position <n> that was reported by a previous 'tapeinfo'
command. 
.TP 10
.B write <blocksize> 
write blocks from stdin to the tape. Chunk the data into <blocksize>-sized
chunks. *DOES NOT WRITE OUT A TAPEMARK!* (you will need to use a 
subsequent
.B mark 1
command to write out a tape mark). 
.TP 10
.B read [<blocksize>] [ <#blocks/#bytes> ]
read blocks from the tape, write them to stdout. If we are in variable
block mode, <blocksize> should be zero (note: The maximum block size
we currently support in variable block mode is 128K, MAX_READ_SIZE will
need to be turned into a settable variable to allow bigger reads). If
<blocksize> is ommitted, we assume that we're in variable block mode, and
that we are going to read from tape until we hit a tapemark or end of
partition or end of tape. 


.SH AUTHORS
This program was written by Eric Lee Green <eric@estinc.com>. 
Major portions of the 'mtxl.c' library used herein were written by
Leonard Zubkoff. 
.P

The SCSI read and write routines are based upon those that Richard
Fish wrote for Enhanced Software Technology's BRU 16.1 product,
substantially modified to work in our particular environment (in
particular, all the variable block stuff is new since BRU only does
fixed block reads and writes, and the BRU code uses bitmasks rather
than bitfields for the various flags and such in return values, as
well as the BRU code having a different SCSI API and having variable
names considerably shorter than the rather sesquipedalian 'mtx'
identifiers). As required by 'mtxl.c', these routines are licensed
under the GNU General Public License.


.SH HINTS
Under Linux, 
.B cat /proc/scsi/scsi
will tell you what SCSI devices you have.
You can then refer to them as 
.B /dev/sga,
.B /dev/sgb, 
etc. by the order they
are reported.
.P
Under FreeBSD, 
.B camcontrol devlist
will tell you what SCSI devices you
have, along with which 
.B pass
device controls them.
.P
Under Solaris 7 and 8,
.B /usr/sbin/devfsadm -C
will clean up your /devices directory. Then
.B find /devices -name 'st@*' -print 
will return a list of all tape drives. /dev on Solaris is apparently only
of historical interest. 

.SH BUGS AND LIMITATIONS

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

.SH AVAILABILITY
This version of 
.B scsitape
is currently being maintained by Eric Lee Green <eric@badtux.org> formerly of
Enhanced Software Technologies Inc. as part of the 'mtx' suite of
programs. The 'mtx' home page is http://mtx.sourceforge.net and the
actual code is currently available there and via CVS from
http://sourceforge.net/projects/mtx . 

.SH SEE ALSO
.BR tapeinfo (1), mtx (1)