Imported Upstream version 2.5.2p1
[debian/amanda] / docs / chgscsi.txt
1
2                    Chapter 9. chg-scsi
3 Prev  Part II. About Tapes and Changers  Next
4
5 -------------------------------------------------------------------------------
6
7 Chapter 9. chg-scsi
8
9
10 Jason X (report real name to <sgw@amanda.org>)
11
12 Original version
13
14 Stefan G. Weichinger
15
16 XML-conversion;Updates
17 AMANDA Core Team
18 <sgw@amanda.org>
19 Table of Contents
20
21
22   Command_line_options
23
24   Notes_about_changer.conf
25
26   Amanda's_actual_usage_of_chg-scsi
27
28   Configuration_notes
29
30   Hacking_notes
31
32 Jason's new and improved chg-scsi documentation.
33 This documentation will also include an occasional reference to the mtx suite
34 as I have attempted to use chg-zd-mtx. I use mtx often as a fast query tool.
35 Please also refer to Amanda_Tape_Changer_Support for additional details.
36 My equipment list is as follows:
37
38 * Redhat 7.0 machine
39 *
40   o Dual Processor P-III
41   o Sony DDS3 tape drive
42   o lots of hard disk space
43
44 * Quantum/ATL L500 SCSI changer
45 * DLT tape drive (three possible)
46 * barcode reader fourteen tape slots
47
48 I base this documentation on the following:
49
50 * mtx version 1.2.16rel
51 * Amanda version 2.4.3b3
52 * SCSI2 specification: X3T9.2/375R revision 10L
53 * Quantum/ATL Field Service Manual 6321101-03 Ver.3, rel.0
54 * Quantum DLT800 Tape system product manual 02 April, 2001 81-60118-04
55 * the SCSI bus and IDE interface 2nd ed by Friedhelm Schmidt pub: Addison-
56   Wesley 1998
57
58 Note that Quantum/ATL's L-series changers follow the SCSI command set, and do
59 not use any proprietary commands. Thus, it was fairly simple to make this work.
60 I had to install Amanda --with-suffixes and setup my server's client side of
61 things using Amanda-2.4.2p2 --with-suffixes.
62 Please note that my usage of "barcode" and "barcode reader" throughout this
63 document really refers to "physical tape identification system". for example:
64 the EEPROM in the AIT cartridge.
65
66  Command line options
67
68 chg-scsi's command line options:
69
70   -slot <param>
71   -info
72   -reset
73   -eject
74   -clean
75   -label <param>
76   -search <param>
77   -status <param>
78   -trace <param>
79   -inventory
80   -dumpdb
81   -scan
82   -genconf
83
84 Note that chg-scsi is called by Amanda in the context of whatever Amanda
85 configuration Amanda is currently using. In short, to call chg-scsi by hand,
86 change to your Amanda configuration directory, then run chg-scsi.
87 -slot <param> command:
88 this command takes either a slot number, or any one of the following: current,
89 next, prev, first, last, advance
90 It then loads the appropriate tape into the drive.
91 Note that if the tape is already loaded, no changer motion will happen. No
92 reading of the tape is done here.
93 -info command:
94 four numbers are printed: <slot# loaded> <number of slots> <reversable>
95 <searchable>
96 with chg-scsi, the reversable number is always 1. Searchable is set based on if
97 a barcode reader is available and working correctly.
98 -reset command:
99 Tape is unloaded, and slot 0 is loaded. No actual reset command is sent to the
100 changer.
101 -eject command:
102 Tape is unloaded, and put back into its original slot.
103 -clean command:
104 Cleaning tape (if configured) is loaded into the tape. It is probably unloaded
105 when done. I haven't looked closely at this yet.
106 -label <param> command:
107 This appears to take the currently loaded tape's barcode and write it to the
108 labelfile with the given parameter as it's tape header. I have not tested this.
109 -search <param> command:
110 this only should be used if a barcode reader is present, or emulate barcode is
111 turned on.
112 the required parameter is an Amanda tape label. The label searched in the
113 labelfile. If a barcode is found, then that tape is loaded directly.
114 I believe the fallback is to search the entire magazine.
115 -status command:
116 The tape changer is queried, and the results are printed out. Values printed
117 are what slots exist, are they full or empty, and what volume labels (barcodes)
118 they are.
119 Q. what about changers that don't retain current slot? A. this is what the
120 "statfile" is for.
121 -trace command:
122 present only for a particular type of changer.
123 -inventory: (this takes a LONG time to do)
124 unloads tape back to its slot issues command to changer to do an inventory of
125 itself (read all barcodes...)
126 loads each tape, retrieves the barcode, and reads the Amanda
127 label off of the tape itself stores/updates the label database file
128 -dumpdb:
129 prints out in human readable form the label database contents from the
130 labelfile.
131 -scan: (aka scanbus)
132 scans the SCSI generic interfaces (eg: linux sg), and prints out the device
133 name and the device types. I found that linux didn't classify either of my tape
134 devices as generic, but this facility did.
135 USE THIS FOR FINDING VALUE OF SCSItapedev. Be certain though you have the
136 correct tape drive: I came close to wreaking havoc with my DDS3 drive while it
137 was flushing Amanda data...and my changer has a DLT drive! Please refer to my
138 configuration notes below.
139 -genconf:
140 prints out a SAMPLE changer.conf file. Note that I said sample. except for that
141 it also does a scanbus. if you have more than one tape drive, please be certain
142 it is correct as chg-scsi uses the first one it finds.
143 Please refer to my configuration notes below.
144
145  Notes about changer.conf
146
147 Here, I try to be a bit more clear on what these config values mean.
148 "number_configs" MUST be the first entry (not counting comments)
149 "emubarcode" will set this value in chg-scsi regardless of the value you try to
150 assign it. If you don't want "emubarcode" set, don't list it!
151 "havebarcode" have barcode is tempered by what devices chg-scsi is aware of. if
152 chg-scsi doesn't know about your changer explicitly, it will default to a
153 default changer. the default changer has no barcode reader.
154 In a patch I plan to post, I have added a generic changer that does use a
155 barcode. set "changerident" to "genericbarcode" to use this.
156 "sleep" number of seconds for chg-scsi to wait for a "tape drive ready" command
157 after loading a new tape. Mine is 140 as I have a DLT tape drive, and my tape
158 drive manual reports a max of 133 seconds to be ready.
159 "config" this is a header telling chg-scsi that all values following, up to the
160 next "config" line apply to this drive number. It is this number that is
161 refered to in your amanda.conf file as line tapedev
162 "drivenum" this is the tape drive number in your changer. For a single tape
163 drive, this is zero. Mine can handle up to three, so I expect I could make this
164 0, 1, or 2.
165 "dev" the SCSI device of your tape drive. under linux, in my case it is /dev/
166 nst1. This MUST be defined.
167 "SCSItapedev" The generic SCSI device of your tape drive. this is simply the
168 generic interface to the device "dev" above. This entry is optional. In my
169 case, it is /dev/sg2. If this entry exists and is legitimate, then SCSI
170 commands are formed directly instead of using ioctl commands.
171 "startuse" "enduse" The start and end slots of your changer. Note that these
172 also start with zero.
173 "eject" chg-scsi tells the tape changer to eject. You might need to explicitly
174 tell the tape drive to unload first. That's what this setting is for. Have you
175 ever removed a loaded VCR tape by hand?
176 "changerident" chg-scsi will first read the changer's identification from the
177 return of the SCSI "inquiry" command. If changerident is set in the
178 configuration file, the SCSI inquiry's value is overridden. chg-scsi will
179 attempt to match the value with its built-in changertypes.
180 "generic" is what the chg-scsi will default to "genericbarcode" is a hack of
181 mine that forces the changer's barcode reader to work. Note that if your
182 changer uses a superset of the SCSI command set, this probably won't work.
183 "L500" is another addition of mine that will enable a quantum/atl L500 to work
184 correctly. It might even work with an L200.
185 other values are (taken from the code)
186
187 * C1553A (HP Auto Loader)
188 * EXB-10e, EXB-120 (Exabyte Robot)
189 * EXB-85058HE-0000 (Exabyte Tape)
190 * TDS 1420 (Tandberg Robot)
191 * VLS DLT, VLS SDX (ADIC VLS DLT Library)
192 * FastStor DLT (ADIC FastStor DLT Library)
193 * Scalar DLT 448 (ADIC DLT 448)
194 * 215 (Spectra Logic TreeFrog)
195 * Quad 7 (Breece Hill)
196 * DLT7000, DLT4000 (DLT Tape)
197
198 "debuglevel" setting this to "9:0" is very informative.
199 "statfile" stores which "slot" that the tape in the drive came from
200 "labelfile" binary file that stores the tape header and barcode information
201 cleanmax cleancart cleanfile I have my changer set to autoclean, and the slot
202 the cleaning cartridge is in is not available for any other use.
203
204  Amanda's actual usage of chg-scsi
205
206 this should be brief: Amanda really only issues "slot next" type commands.
207 Currently Amanda doesn't ask chg-scsi to load "tape x with label Daily_set023".
208 the chg-scsi mechanism is there for use, and functions quite well for the user
209 to load a particular tape. I understand they (the Amanda team) are working on
210 this.
211
212  Configuration notes
213
214 (assuming one changer with one tape drive!)
215 in amanda.conf:
216 set tpchanger to chg-scsi set changerfile to <pathname>/changer.conf set
217 tapedev to 0 set changerdev to /dev/<changer generic device>
218
219 * this value is usually listed in the system boot messages or will be printed
220   via syslog when the appropriate kernel module is loaded. eg: linux modprobe
221   sg
222
223 in changer.conf: set number_configs to 1 set dev to <non-rewinding tape device
224 eg: /dev/nst1> set debug to 9:0
225 run "chg-scsi -scan" from your Amanda configuration directory I get: name /dev/
226 sg0 Tape Count 1 name /dev/sg1 Changer Count 2 name /dev/sg2 Tape Count 3
227 I set SCSItapedev to /dev/sg0 to test with, then ran chg-scsi -info. Check the
228 chg-scsi debug file for tapeidentification details. This is where I discoverd
229 that "sg0" was not the correct tape!
230 set SCSItapedev to "/dev/<generic device>"
231 if you have no barcode, try "changerident generic" if you have a barcode reader
232 try "changerident genericbarcode"
233
234  Hacking notes
235
236 My hacks are:
237
238 * adding printout of "emubarcode" values in the debug file
239 * added dlt8000 tape drive to ChangerIO[], and SenseType[]
240 * added genericbarcode to ChangerIO[], and SenseType[]
241 * added L500 to ChangerIO[], and SenseType[]
242 * added a couple of basic sensecodes listed in the SCSI specs for the generic
243   and genericbarcode tape changers.
244
245 My desires are:
246
247 * modify the sensecode code such that all SCSI devices inherit the standard
248   SCSI codes and may override or append to them as needed.
249
250
251 * modify the configuration reading code and the inquiry command to allow
252   spaces. eg: my changer displays the following ident data: "L500 6320000" but
253   I had to create a type called "L500" or else the spaces would throw off the
254   comparisons.
255
256
257 Note
258
259 Refer to http://www.amanda.org/docs/chgscsi.html for the current version of
260 this document.
261 -------------------------------------------------------------------------------
262
263 Prev                            Up                                   Next
264 Chapter 8. Amanda Tape Changer Home  Chapter 10. RAIT (Redundant Array of
265 Support                                         Inexpensive Tape) Support
266