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