]> git.sur5r.net Git - bacula/docs/blob - docs/manual/tapetesting.tex
faede97ab076caa61ea5f5d1de9772fb00549383
[bacula/docs] / docs / manual / tapetesting.tex
1 %%
2 %%
3
4 \section*{Testing Your Tape Drive With Bacula}
5 \label{_ChapterStart27}
6 \index[general]{Testing Your Tape Drive With Bacula}
7 \addcontentsline{toc}{section}{Testing Your Tape Drive With Bacula}
8
9 This chapter is concerned with testing and configuring your tape drive to make
10 sure that it will work properly with Bacula using the {\bf btape} program. 
11 \label{summary}
12
13 \subsection*{Summary of Steps to Take to Get Your Tape Drive Working}
14 \index[general]{Working!Summary of Steps to Take to Get Your Tape Drive}
15 \index[general]{Summary of Steps to Take to Get Your Tape Drive Working}
16 \addcontentsline{toc}{subsection}{Summary of Steps to Take to Get Your Tape
17 Drive Working}
18
19 In general, you should follow the following steps to get your tape drive to
20 work with Bacula. Start with a tape mounted in your drive. If you have an
21 autochanger, load a tape into the drive. We use {\bf /dev/nst0} as the tape
22 drive name, you will need to adapt it according to your system. 
23
24 Do not proceed to the next item until you have succeeded with the previous
25 one. 
26
27 \begin{enumerate}
28 \item Use tar to write to, then read from your drive:  
29
30    \footnotesize
31 \begin{verbatim}
32    mt -f /dev/nst0 rewind
33    tar cvf /dev/nst0 .
34    mt -f /dev/nst0 rewind
35    tar tvf /dev/nst0
36    
37 \end{verbatim}
38 \normalsize
39
40 \item Make sure you have a valid and correct Device resource  corresponding to
41    your drive. For Linux users, generally,  the default one works. For FreeBSD
42    users, there are two  possible Device configurations (see below). 
43 \item Run the btape {\bf test} command:  
44
45    \footnotesize
46 \begin{verbatim}
47    ./btape -c bacula-sd.conf /dev/nst0
48    test
49    
50 \end{verbatim}
51 \normalsize
52
53 It isn't necessary to run the autochanger part of the  test at this time,  but
54 do not go past this point until the basic test succeeds. If you do have 
55 an autochanger, please be sure to read the
56 \ilink{Autochanger chapter}{_ChapterStart18} of this manual.
57
58 \item Run the btape {\bf fill} command, preferably with two volumes.  This
59    can take a long time. If you have an autochanger and it  is configured, Bacula
60    will automatically use it. If you do  not have it configured, you can manually
61    issue the appopriate  {\bf mtx} command, or press the autochanger buttons to
62    change  the tape when requested to do so. 
63 \item FreeBSD users, if you have a pre-5.0 system run the {\bf tapetest}
64    program, and make sure your system is patched if necessary. The tapetest
65    program can be found in the platform/freebsd directory. The instructions
66    for its use are at the top of the file.
67 \item Run Bacula, and backup a reasonably small directory,  say 60 Megabytes.
68    Do three successive backups of this  directory. 
69 \item Stop Bacula, then restart it. Do another full backup  of the same
70    directory. Then stop and restart Bacula. 
71 \item Do a restore of the directory backed up, by entering the  following
72    restore command, being careful to restore it to  an alternate location:  
73
74 \footnotesize
75 \begin{verbatim}
76    restore select all done
77    yes
78    
79 \end{verbatim}
80 \normalsize
81
82 Do a {\bf diff} on the restored directory to ensure it is identical  to the
83 original directory.  
84 \item If you have an autochanger, you should now go back to the  btape program
85    and run the autochanger test:  
86
87 \footnotesize
88 \begin{verbatim}
89      ./btape -c bacula-sd.conf /dev/nst0
90      auto
91      
92 \end{verbatim}
93 \normalsize
94
95 Adjust your autochanger as necessary to ensure that it works  correctly. See
96 the Autochanger chapter of this manual  for a complete discussion of testing
97 your autochanger.  
98 \end{enumerate}
99
100 If you have reached this point, you stand a good chance of having everything
101 work. If you get into trouble at any point, {\bf carefully} read the
102 documentation given below. If you cannot get past some point, ask the {\bf
103 bacula-users} email list, but specify which of the steps you have successfully
104 completed. In particular, you may want to look at the 
105 \ilink{ Tips for Resolving Problems}{problems1} section below. 
106
107 \label{NoTapeInDrive}
108 \subsubsection*{Problems When no Tape in Drive}
109 \index[general]{Problems When no Tape in Drive}
110 \addcontentsline{toc}{subsubsection}{Problems When no Tape in Drive}
111 When Bacula was first written the Linux 2.4 kernel permitted opening the
112 drive whether or not there was a tape in the drive. Thus the Bacula code is
113 based on the concept that if the drive cannot be opened, there is a serious
114 problem, and the job is failed.
115
116 With version 2.6 of the Linux kernel, if there is no tape in the drive, the
117 OS will wait 2 minutes (default) then return a failure, and consequently,
118 Bacula version 1.36 and below will fail the job.  This is important to keep
119 in mind, because if you use and option such as {\bf Offline on Unmount =
120 yes}, there will be a point when there is no tape in the drive, and if
121 another job starts or if Bacula asks the operator to mount a tape, when
122 Bacula attempts to open the drive (about a 20 minute delay), it will fail
123 and Bacula will fail the job.
124
125 In version 1.38.x, the Bacula code partially gets around this problem -- at
126 least in the initial open of the drive.  However, functions like Polling
127 the drive do not work correctly if there is no tape in the drive.
128 Providing you do not use {\bf Offline on Unmount = yes}, you should not
129 experience job failures as mentioned above.  If you do experience such
130 failures, you can also increase the {\bf Maximum Open Wait} time interval,
131 which will give you more time to mount the next tape before the job is
132 failed.
133
134 \subsubsection*{Specifying the Configuration File}
135 \index[general]{File!Specifying the Configuration}
136 \index[general]{Specifying the Configuration File}
137 \addcontentsline{toc}{subsubsection}{Specifying the Configuration File}
138
139 Starting with version 1.27, each of the tape utility programs including the
140 {\bf btape} program requires a valid Storage daemon configuration file
141 (actually, the only part of the configuration file that {\bf btape} needs is
142 the {\bf Device} resource definitions). This permits {\bf btape} to find the
143 configuration parameters for your archive device (generally a tape drive).
144 Without those parameters, the testing and utility programs do not know how to
145 properly read and write your drive. By default, they use {\bf bacula-sd.conf}
146 in the current directory, but you may specify a different configuration file
147 using the {\bf -c} option. 
148
149 \subsubsection*{Specifying a Device Name For a Tape}
150 \index[general]{Tape!Specifying a Device Name For a}
151 \index[general]{Specifying a Device Name For a Tape}
152 \addcontentsline{toc}{subsubsection}{Specifying a Device Name For a Tape}
153
154 {\bf btape} {\bf device-name} where the Volume can be found. In the case of a
155 tape, this is the physical device name such as {\bf /dev/nst0} or {\bf
156 /dev/rmt/0ubn} depending on your system that you specify on the Archive Device
157 directive. For the program to work, it must find the identical name in the
158 Device resource of the configuration file. If the name is not found in the
159 list of phsical names, the utility program will compare the name you entered
160 to the Device names (rather than the Archive device names). 
161
162 When specifying a tape device, it is preferable that the "non-rewind"
163 variant of the device file name be given.  In addition, on systems such as
164 Sun, which have multiple tape access methods, you must be sure to specify
165 to use Berkeley I/O conventions with the device.  The
166 {\bf b} in the Solaris (Sun) archive specification {\bf /dev/rmt/0mbn} is
167 what is needed in this case.  Bacula does not support SysV tape drive
168 behavior.
169
170 See below for specifying Volume names. 
171
172 \subsubsection*{Specifying a Device Name For a File}
173 \index[general]{File!Specifying a Device Name For a}
174 \index[general]{Specifying a Device Name For a File}
175 \addcontentsline{toc}{subsubsection}{Specifying a Device Name For a File}
176
177 If you are attempting to read or write an archive file rather than a tape, the
178 {\bf device-name} should be the full path to the archive location including
179 the filename. The filename (last part of the specification) will be stripped
180 and used as the Volume name, and the path (first part before the filename)
181 must have the same entry in the configuration file. So, the path is equivalent
182 to the archive device name, and the filename is equivalent to the volume name.
183
184
185 \subsection*{btape}
186 \label{btape1}
187 \index[general]{Btape}
188 \addcontentsline{toc}{subsection}{btape}
189
190 This program permits a number of elementary tape operations via a tty command
191 interface. The {\bf test} command, described below, can be very useful for
192 testing tape drive compatibility problems. Aside from initial testing of tape
193 drive compatibility with {\bf Bacula}, {\bf btape} will be mostly used by
194 developers writing new tape drivers. 
195
196 {\bf btape} can be dangerous to use with existing {\bf Bacula} tapes because
197 it will relabel a tape or write on the tape if so requested regardless of
198 whether or not the tape contains valuable data, so please be careful and use
199 it only on blank tapes. 
200
201 To work properly, {\bf btape} needs to read the Storage daemon's configuration
202 file. As a default, it will look for {\bf bacula-sd.conf} in the current
203 directory. If your configuration file is elsewhere, please use the {\bf -c}
204 option to specify where. 
205
206 The physical device name or the Device resource name must be specified on the
207 command line, and this same device name must be present in the Storage
208 daemon's configuration file read by {\bf btape} 
209
210 \footnotesize
211 \begin{verbatim}
212 Usage: btape [options] device_name
213        -b <file>   specify bootstrap file
214        -c <file>   set configuration file to file
215        -d <nn>     set debug level to nn
216        -p          proceed inspite of I/O errors
217        -s          turn off signals
218        -v          be verbose
219        -?          print this message.
220 \end{verbatim}
221 \normalsize
222
223 \subsubsection*{Using btape to Verify your Tape Drive}
224 \index[general]{Using btape to Verify your Tape Drive}
225 \index[general]{Drive!Using btape to Verify your Tape}
226 \addcontentsline{toc}{subsubsection}{Using btape to Verify your Tape Drive}
227
228 An important reason for this program is to ensure that a Storage daemon
229 configuration file is defined so that Bacula will correctly read and write
230 tapes. 
231
232 It is highly recommended that you run the {\bf test} command before running
233 your first Bacula job to ensure that the parameters you have defined for your
234 storage device (tape drive) will permit {\bf Bacula} to function properly. You
235 only need to mount a blank tape, enter the command, and the output should be
236 reasonably self explanatory. For example: 
237
238 \footnotesize
239 \begin{verbatim}
240 (ensure that Bacula is not running)
241 ./btape -c /usr/bin/bacula/bacula-sd.conf /dev/nst0
242 \end{verbatim}
243 \normalsize
244
245 The output will be: 
246
247 \footnotesize
248 \begin{verbatim}
249 Tape block granularity is 1024 bytes.
250 btape: btape.c:376 Using device: /dev/nst0
251 *
252 \end{verbatim}
253 \normalsize
254
255 Enter the test command: 
256
257 \footnotesize
258 \begin{verbatim}
259 test
260 \end{verbatim}
261 \normalsize
262
263 The output produced should be something similar to the following: I've cut the
264 listing short because it is frequently updated to have new tests. 
265
266 \footnotesize
267 \begin{verbatim}
268 === Append files test ===
269 This test is essential to Bacula.
270 I'm going to write one record  in file 0,
271                    two records in file 1,
272              and three records in file 2
273 btape: btape.c:387 Rewound /dev/nst0
274 btape: btape.c:855 Wrote one record of 64412 bytes.
275 btape: btape.c:857 Wrote block to device.
276 btape: btape.c:410 Wrote EOF to /dev/nst0
277 btape: btape.c:855 Wrote one record of 64412 bytes.
278 btape: btape.c:857 Wrote block to device.
279 btape: btape.c:855 Wrote one record of 64412 bytes.
280 btape: btape.c:857 Wrote block to device.
281 btape: btape.c:410 Wrote EOF to /dev/nst0
282 btape: btape.c:855 Wrote one record of 64412 bytes.
283 btape: btape.c:857 Wrote block to device.
284 btape: btape.c:855 Wrote one record of 64412 bytes.
285 btape: btape.c:857 Wrote block to device.
286 btape: btape.c:855 Wrote one record of 64412 bytes.
287 btape: btape.c:857 Wrote block to device.
288 btape: btape.c:410 Wrote EOF to /dev/nst0
289 btape: btape.c:387 Rewound /dev/nst0
290 btape: btape.c:693 Now moving to end of media.
291 btape: btape.c:427 Moved to end of media
292 We should be in file 3. I am at file 3. This is correct!
293 Now the important part, I am going to attempt to append to the tape.
294 ...
295 === End Append files test ===
296 \end{verbatim}
297 \normalsize
298
299 If you do not successfully complete the above test, please resolve the
300 problem(s) before attempting to use {\bf Bacula}. Depending on your tape
301 drive, the test may recommend that you add certain records to your
302 configuration. We strongly recommend that you do so and then re-run the above
303 test to insure it works the first time. 
304
305 Some of the suggestions it provides for resolving the problems may or may not
306 be useful. If at all possible avoid using fixed blocking. If the test suddenly
307 starts to print a long series of: 
308
309 \footnotesize
310 \begin{verbatim}
311 Got EOF on tape.
312 Got EOF on tape.
313 ...
314 \end{verbatim}
315 \normalsize
316
317 then almost certainly, you are running your drive in fixed block mode rather
318 than variable block mode. See below for more help of resolving fix
319 versus variable block problems.
320
321 It is also possible that you have your drive
322 set in SysV tape drive mode. The drive must use BSD tape conventions.
323 See the section above on setting your {\bf Archive device} correctly.
324
325 For FreeBSD users, please see the notes below for doing further testing of
326 your tape drive. 
327
328 \subsubsection*{Linux SCSI Tricks}
329 \index[general]{Tricks!Linux SCSI}
330 \index[general]{Linux SCSI Tricks}
331 \addcontentsline{toc}{subsubsection}{Linux SCSI Tricks}
332
333 You can find out what SCSI devices you have by doing: 
334
335 \footnotesize
336 \begin{verbatim}
337 cat /proc/scsi/scsi
338 \end{verbatim}
339 \normalsize
340
341 For example, I get the following: 
342
343 \footnotesize
344 \begin{verbatim}
345 Attached devices:
346 Host: scsi2 Channel: 00 Id: 01 Lun: 00
347   Vendor: HP       Model: C5713A           Rev: H107
348   Type:   Sequential-Access                ANSI SCSI revision: 02
349 Host: scsi2 Channel: 00 Id: 04 Lun: 00
350   Vendor: SONY     Model: SDT-10000        Rev: 0110
351   Type:   Sequential-Access                ANSI SCSI revision: 02
352 \end{verbatim}
353 \normalsize
354
355 The above represents first an autochanger and second a simple
356 tape drive. The HP changer (the first entry) uses the same SCSI channel
357 for data and for control, so in Bacula, you would use: 
358 \footnotesize
359 \begin{verbatim}
360 Archive Device = /dev/nst0
361 Changer Device = /dev/sg0
362 \end{verbatim}
363 \normalsize
364
365 If you want to remove the SDT-10000 device, you can do so as root with: 
366
367 \footnotesize
368 \begin{verbatim}
369 echo "scsi remove-single-device 2 0 4 0">/proc/scsi/scsi
370 \end{verbatim}
371 \normalsize
372
373 and you can put add it back with: 
374
375 \footnotesize
376 \begin{verbatim}
377 echo "scsi add-single-device 2 0 4 0">/proc/scsi/scsi
378 \end{verbatim}
379 \normalsize
380
381 where the 2 0 4 0 are the Host, Channel, Id, and Lun as seen on the output
382 from {\bf cat /proc/scsi/scsi}. Note, the Channel must be specified as
383 numeric. 
384
385 Below is a slightly more complicated output, which is a single autochanger
386 with two drives, and which operates the changer on a different channel
387 from from the drives:
388
389 \footnotesize
390 \begin{verbatim}
391 Attached devices:
392 Host: scsi0 Channel: 00 Id: 00 Lun: 00
393   Vendor: ATA      Model: WDC WD1600JD-75H Rev: 08.0
394   Type:   Direct-Access                    ANSI SCSI revision: 05
395 Host: scsi2 Channel: 00 Id: 04 Lun: 00
396   Vendor: HP       Model: Ultrium 2-SCSI   Rev: F6CH
397   Type:   Sequential-Access                ANSI SCSI revision: 03
398 Host: scsi2 Channel: 00 Id: 05 Lun: 00
399   Vendor: HP       Model: Ultrium 2-SCSI   Rev: F6CH
400   Type:   Sequential-Access                ANSI SCSI revision: 03
401 Host: scsi2 Channel: 00 Id: 06 Lun: 00
402   Vendor: OVERLAND Model: LXB              Rev: 0106
403   Type:   Medium Changer                   ANSI SCSI revision: 02
404 \end{verbatim}
405 \normalsize
406
407 The above tape drives are accessed on /dev/nst0 and /dev/nst1, while
408 the control channel for those two drives is /dev/sg3.
409
410
411
412 \label{problems1}
413 \subsection*{Tips for Resolving Problems}
414 \index[general]{Problems!Tips for Resolving}
415 \index[general]{Tips for Resolving Problems}
416 \addcontentsline{toc}{subsection}{Tips for Resolving Problems}
417
418 \label{CannotRestore}
419 \subsubsection*{Bacula Saves But Cannot Restore Files}
420 \index[general]{Files!Bacula Saves But Cannot Restore}
421 \index[general]{Bacula Saves But Cannot Restore Files}
422 \addcontentsline{toc}{subsubsection}{Bacula Saves But Cannot Restore Files}
423
424 If you are getting error messages such as: 
425
426 \footnotesize
427 \begin{verbatim}
428 Volume data error at 0:1! Wanted block-id: "BB02", got "". Buffer discarded
429 \end{verbatim}
430 \normalsize
431
432 It is very likely that Bacula has tried to do block positioning and ended up
433 at an invalid block. This can happen if your tape drive is in fixed block mode
434 while Bacula's default is variable blocks. Note that in such cases, Bacula is
435 perfectly able to write to your Volumes (tapes), but cannot position to read
436 them. 
437
438 There are two possible solutions. 
439
440 \begin{enumerate}
441 \item The first and  best is to always ensure that your drive is in  variable
442    block mode. Note, it can switch back to  fixed block mode on a reboot or if
443    another program  uses the drive. So on such systems you  need to modify the
444    Bacula startup files  to explicitly set: 
445
446 \footnotesize
447 \begin{verbatim}
448 mt -f /dev/nst0 defblksize 0
449 \end{verbatim}
450 \normalsize
451
452 or whatever is appropriate on your system.  
453 \item The second possibility, especially, if Bacula wrote  while the drive was
454    in fixed block mode, is to turn  off block positioning in Bacula. This is done
455    by  adding: 
456
457 \footnotesize
458 \begin{verbatim}
459 Block Positioning = no
460 \end{verbatim}
461 \normalsize
462
463 to the Device resource. This is not the recommended  procedure because it can
464 enormously slow down  recovery of files, but it may help where all else 
465 fails. This directive is available in version 1.35.5  or later (and not yet
466 tested).  
467 \end{enumerate}
468
469 If you are getting error messages such as:
470 \footnotesize
471 \begin{verbatim}
472 Volume data error at 0:0!
473 Block checksum mismatch in block=0 len=32625 calc=345678 blk=123456
474 \end{verbatim}
475 \normalsize
476
477 You are getting tape read errors, and this is most likely due to 
478 one of the following things:
479 \begin{enumerate}
480 \item An old or bad tape.
481 \item A dirty drive that needs cleaning (particularly for DDS drives).
482 \item A loose SCSI cable.
483 \item Old firmware in your drive. Make sure you have the latest firmware
484       loaded.
485 \item Computer memory errors.
486 \item Over-clocking your CPU.
487 \item A bad SCSI card.
488 \end{enumerate}
489
490
491 \label{opendevice}
492 \subsubsection*{Bacula Cannot Open the Device}
493 \index[general]{Device!Bacula Cannot Open the}
494 \index[general]{Bacula Cannot Open the Device}
495 \addcontentsline{toc}{subsubsection}{Bacula Cannot Open the Device}
496
497 If you get an error message such as: 
498
499 \footnotesize
500 \begin{verbatim}
501 dev open failed: dev.c:265 stored: unable to open
502 device /dev/nst0:> ERR=No such device or address
503 \end{verbatim}
504 \normalsize
505
506 the first time you run a job, it is most likely due to the fact that you
507 specified the incorrect device name on your {\bf Archive Device}. 
508
509 If Bacula works fine with your drive, then all off a sudden you get error
510 messages similar to the one shown above, it is quite possible that your driver
511 module is being removed because the kernel deems it idle. This is done via
512 {\bf crontab} with the use of {\bf rmmod -a}. To fix the problem, you can
513 remove this entry from {\bf crontab}, or you can manually {\bf modprob} your
514 driver module (or add it to the local startup script). Thanks to Alan Brown
515 for this tip. 
516 \label{IncorrectFiles}
517
518 \subsubsection*{Incorrect File Number}
519 \index[general]{Number!Incorrect File}
520 \index[general]{Incorrect File Number}
521 \addcontentsline{toc}{subsubsection}{Incorrect File Number}
522
523 When Bacula moves to the end of the medium, it normally uses the {\bf
524 ioctl(MTEOM)} function. Then Bacula uses the {\bf ioctl(MTIOCGET)} function to
525 retrieve the current file position from the {\bf mt\_fileno} field. Some SCSI
526 tape drivers will use a fast means of seeking to the end of the medium and in
527 doing so, they will not know the current file position and hence return a {\bf
528 -1}. As a consequence, if you get {\bf "This is NOT correct!"} in the
529 positioning tests, this may be the cause. You must correct this condition in
530 order for Bacula to work. 
531
532 There are two possible solutions to the above problem of incorrect file
533 number: 
534
535 \begin{itemize}
536 \item Figure out how to configure your SCSI driver to  keep track of the file
537    position during the MTEOM  request. This is the preferred solution.  
538 \item Modify the {\bf Device} resource of your {\bf bacula-sd.conf} file  to
539    include:  
540
541 \footnotesize
542 \begin{verbatim}
543 Hardware End of File = no
544 \end{verbatim}
545 \normalsize
546
547 This will cause Bacula to use the MTFSF request to  seek to the end of the
548 medium, and Bacula will keep  track of the file number itself. 
549 \end{itemize}
550
551 \label{IncorrectBlocks}
552 \subsubsection*{Incorrect Number of Blocks or Positioning Errors during btape
553 Testing}
554 \index[general]{Testing!Incorrect Number of Blocks or Positioning Errors
555 during btape}
556 \index[general]{Incorrect Number of Blocks or Positioning Errors during btape
557 Testing}
558 \addcontentsline{toc}{subsubsection}{Incorrect Number of Blocks or Positioning
559 Errors during btape Testing}
560
561 {\bf Bacula's} preferred method of working with tape drives (sequential
562 devices) is to run in variable block mode, and this is what is set by default.
563 You should first ensure that your tape drive is set for variable block mode
564 (see below). 
565
566 If your tape drive is in fixed block mode and you have told Bacula to use
567 different fixed block sizes or variable block sizes (default), you will get
568 errors when Bacula attempts to forward space to the correct block (the kernel
569 driver's idea of tape blocks will not correspond to Bacula's). 
570
571 All modern tape drives support variable tape blocks, but some older drives (in
572 particular the QIC drives) as well as the ATAPI ide-scsi driver run only in
573 fixed block mode. The Travan tape drives also apparently must run in fixed
574 block mode (to be confirmed). 
575
576 Even in variable block mode, with the exception of the first record on the
577 second or subsequent volume of a multi-volume backup, Bacula will write blocks
578 of a fixed size. However, in reading a tape, Bacula will assume that for each
579 read request, exactly one block from the tape will be transferred. This the
580 most common way that tape drives work and is well supported by {\bf Bacula}. 
581
582 Drives that run in fixed block mode can cause serious problems for Bacula if
583 the drive's block size does not correspond exactly to {\bf Bacula's} block
584 size. In fixed block size mode, drivers may transmit a partial block or
585 multiple blocks for a single read request. From {\bf Bacula's} point of view,
586 this destroys the concept of tape blocks. It is much better to run in variable
587 block mode, and almost all modern drives (the OnStream is an exception) run in
588 variable block mode. In order for Bacula to run in fixed block mode, you must
589 include the following records in the Storage daemon's Device resource
590 definition: 
591
592 \footnotesize
593 \begin{verbatim}
594 Minimum Block Size = nnn
595 Maximum Block Size = nnn
596 \end{verbatim}
597 \normalsize
598
599 where {\bf nnn} must be the same for both records and must be identical to the
600 driver's fixed block size. 
601
602 We recommend that you avoid this configuration if at all possible by using
603 variable block sizes. 
604
605 If you must run with fixed size blocks, make sure they are not 512 bytes. This
606 is too small and the overhead that Bacula has with each record will become
607 excessive. If at all possible set any fixed block size to something like
608 64,512 bytes or possibly 32,768 if 64,512 is too large for your drive. See
609 below for the details on checking and setting the default drive block size. 
610
611 To recover files from tapes written in fixed block mode, see below. 
612
613 \label{TapeModes}
614 \subsubsection*{Ensuring that the Tape Modes Are Properly Set -- {\bf Linux
615 Only}}
616 \index[general]{Ensuring that the Tape Modes Are Properly Set -- Linux Only}
617 \index[general]{Only!Ensuring that the Tape Modes Are Properly Set -- Linux}
618 \addcontentsline{toc}{subsubsection}{Ensuring that the Tape Modes Are Properly
619 Set -- Linux Only}
620
621 If you have a modern SCSI tape drive and you are having problems with the {\bf
622 test} command as noted above, it may be that some program has set one or more
623 of your SCSI driver's options to non-default values. For example, if your
624 driver is set to work in SysV manner, Bacula will not work correctly because
625 it expects BSD behavior. To reset your tape drive to the default values, you
626 can try the following, but {\bf ONLY} if you have a SCSI tape drive on a {\bf
627 Linux} system: 
628
629 \footnotesize
630 \begin{verbatim}
631 become super user
632 mt -f /dev/nst0 rewind
633 mt -f /dev/nst0 stoptions buffer-writes async-writes read-ahead
634 \end{verbatim}
635 \normalsize
636
637 The above commands will clear all options and then set those specified. None
638 of the specified options are required by Bacula, but a number of other options
639 such as SysV behavior must not be set. Bacula does not support SysV tape
640 behavior. On systems other than Linux, you will need to consult your {\bf mt}
641 man pages or documentation to figure out how to do the same thing. This should
642 not really be necessary though -- for example, on both Linux and Solaris
643 systems, the default tape driver options are compatible with Bacula. 
644 On Solaris systems, you must take care to specify the correct device
645 name on the {\bf Archive device} directive. See above for more details.
646
647 You may also want to ensure that no prior program has set the default block
648 size, as happened to one user, by explicitly turning it off with: 
649
650 \footnotesize
651 \begin{verbatim}
652 mt -f /dev/nst0 defblksize 0
653 \end{verbatim}
654 \normalsize
655
656 If you would like to know what options you have set before making any of the
657 changes noted above, you can now view them on Linux systems, thanks to a tip
658 provided by Willem Riede. Do the following: 
659
660 \footnotesize
661 \begin{verbatim}
662 become super user
663 mt -f /dev/nst0 stsetoptions 0
664 grep st0 /var/log/messages
665 \end{verbatim}
666 \normalsize
667
668 and you will get output that looks something like the following: 
669
670 \footnotesize
671 \begin{verbatim}
672 kernel: st0: Mode 0 options: buffer writes: 1, async writes: 1, read ahead: 1
673 kernel: st0:    can bsr: 0, two FMs: 0, fast mteom: 0, auto lock: 0,
674 kernel: st0:    defs for wr: 0, no block limits: 0, partitions: 0, s2 log: 0
675 kernel: st0:    sysv: 0 nowait: 0
676 \end{verbatim}
677 \normalsize
678
679 Note, I have chopped off the beginning of the line with the date and machine
680 name for presentation purposes. 
681
682 Some people find that the above settings only last until the next reboot, so
683 please check this otherwise you may have unexpected problems. 
684
685 Beginning with Bacula version 1.35.8, if Bacula detects that you are running
686 in variable block mode, it will attempt to set your drive appropriately. All
687 OSes permit setting variable block mode, but some OSes do not permit setting
688 the other modes that Bacula needs to function properly. 
689
690 \label{compression}
691 \subsubsection*{Checking and Setting Tape Hardware Compression and Blocking
692 Size}
693 \index[general]{Checking and Setting Tape Hardware Compression and Blocking
694 Size}
695 \index[general]{Size!Checking and Setting Tape Hardware Compression and
696 Blocking}
697 \addcontentsline{toc}{subsubsection}{Checking and Setting Tape Hardware
698 Compression and Blocking Size}
699
700 As far as I can tell, there is no way with the {\bf mt} program to check if
701 your tape hardware compression is turned on or off. You can, however, turn it
702 on by using (on Linux): 
703
704 \footnotesize
705 \begin{verbatim}
706 become super user
707 mt -f /dev/nst0 defcompression 1
708 \end{verbatim}
709 \normalsize
710
711 and of course, if you use a zero instead of the one at the end, you will turn
712 it off. 
713
714 If you have built the {\bf mtx} program in the {\bf depkgs} package, you can
715 use tapeinfo to get quite a bit of information about your tape drive even if
716 it is not an autochanger. This program is called using the SCSI control
717 device. On Linux for tape drive /dev/nst0, this is usually /dev/sg0, while on
718 FreeBSD for /dev/nsa0, the control device is often /dev/pass2. For example on
719 my DDS-4 drive (/dev/nst0), I get the following: 
720
721 \footnotesize
722 \begin{verbatim}
723 tapeinfo -f /dev/sg0
724 Product Type: Tape Drive
725 Vendor ID: 'HP      '
726 Product ID: 'C5713A          '
727 Revision: 'H107'
728 Attached Changer: No
729 MinBlock:1
730 MaxBlock:16777215
731 SCSI ID: 5
732 SCSI LUN: 0
733 Ready: yes
734 BufferedMode: yes
735 Medium Type: Not Loaded
736 Density Code: 0x26
737 BlockSize: 0             
738 \end{verbatim}
739 \normalsize
740
741 where the {\bf DataCompEnabled: yes} means that tape hardware compression is
742 turned on. You can turn it on and off (yes|no) by using the {\bf mt}
743 commands given above. Also, this output will tell you if the {\bf BlockSize}
744 is non-zero and hence set for a particular block size. Bacula is not likely to
745 work in such a situation because it will normally attempt to write blocks of
746 64,512 bytes, except the last block of the job which will generally be
747 shorter. The first thing to try is setting the default block size to zero
748 using the {\bf mt -f /dev/nst0 defblksize 0} command as shown above.
749 On FreeBSD, this would be something like: {\bf mt -f /dev/nsa0 blocksize 0}. 
750
751 On some operating systems with some tape drives, the amount of data that
752 can be written to the tape and whether or not compression is enabled is
753 determined by the density usually the {\bf mt -f /dev/nst0 setdensity xxx} command.
754 Often  {\bf mt -f /dev/nst0 status} will print out the current
755 density code that is used with the drive.  Most systems, but unfortunately
756 not all, set the density to the maximum by default. On some systems, you
757 can also get a list of all available density codes with:
758 {\bf mt -f /dev/nst0 densities} or a similar {\bf mt} command.
759 Note, for DLT and SDLT devices, no-compression versus compression is very 
760 often controlled by the density code.  On FreeBSD systems, the compression
761 mode is set using {\bf mt -f /dev/nsa0 comp xxx} where xxx is the
762 mode you want.  In general, see {\bf man mt}  for the options available on
763 your system.
764
765 Note, some of the above {\bf mt} commands may not be persistent depending
766 on your system configuration. That is they may be reset if a program  
767 other than Bacula uses the drive or, as is frequently the case, on reboot
768 of your system.
769                    
770 If your tape drive requires fixed block sizes (very unusual), you can use the
771 following records: 
772
773 \footnotesize
774 \begin{verbatim}
775 Minimum Block Size = nnn
776 Maximum Block Size = nnn
777 \end{verbatim}
778 \normalsize
779
780 in your Storage daemon's Device resource to force Bacula to write fixed size
781 blocks (where you sent nnn to be the same for both of the above records). This
782 should be done only if your drive does not support variable block sizes, or
783 you have some other strong reasons for using fixed block sizes. As mentioned
784 above, a small fixed block size of 512 or 1024 bytes will be very inefficient.
785 Try to set any fixed block size to something like 64,512 bytes or larger if
786 your drive will support it. 
787
788 Also, note that the {\bf Medium Type} field of the output of {\bf tapeinfo}
789 reports {\bf Not Loaded}, which is not correct. As a consequence, you should
790 ignore that field as well as the {\bf Attached Changer} field. 
791
792 To recover files from tapes written in fixed block mode, see below. 
793 \label{FreeBSDTapes}
794
795 \subsubsection*{Tape Modes on FreeBSD}
796 \index[general]{FreeBSD!Tape Modes on}
797 \index[general]{Tape Modes on FreeBSD}
798 \addcontentsline{toc}{subsubsection}{Tape Modes on FreeBSD}
799
800 On most FreeBSD systems such as 4.9 and most tape drives, Bacula should run
801 with: 
802
803 \footnotesize
804 \begin{verbatim}
805 mt  -f  /dev/nsa0  seteotmodel  2
806 mt  -f  /dev/nsa0  blocksize   0
807 mt  -f  /dev/nsa0  comp  enable
808 \end{verbatim}
809 \normalsize
810
811 You might want to put those commands in a startup script to make sure your
812 tape driver is properly initialized before running Bacula, because
813 depending on your system configuration, these modes may be reset if a      
814 program other than Bacula uses the drive or when your system is rebooted.
815
816 Then according to what the {\bf btape test} command returns, you will probably
817 need to set the following (see below for an alternative): 
818
819 \footnotesize
820 \begin{verbatim}
821   Hardware End of Medium = no
822   BSF at EOM = yes
823   Backward Space Record = no
824   Backward Space File = no
825   Fast Forward Space File = no
826   TWO EOF = yes
827 \end{verbatim}
828 \normalsize
829
830 Then be sure to run some append tests with Bacula where you start and stop
831 Bacula between appending to the tape, or use {\bf btape} version 1.35.1 or
832 greater, which includes simulation of stopping/restarting Bacula. 
833
834 Please see the file {\bf platforms/freebsd/pthreads-fix.txt} in the main
835 Bacula directory concerning {\bf important} information concerning
836 compatibility of Bacula and your system. A much more optimal Device
837 configuration is shown below, but does not work with all tape drives. Please
838 test carefully before putting either into production. 
839
840 Note, for FreeBSD 4.10-RELEASE, using a Sony TSL11000 L100 DDS4 with an
841 autochanger set to variable block size and DCLZ compression, Brian McDonald
842 reports that to get Bacula to append correctly between Bacula executions,
843 the correct values to use are:
844
845 \footnotesize
846 \begin{verbatim}
847 mt  -f  /dev/nsa0  seteotmodel  1
848 mt  -f  /dev/nsa0  blocksize  0
849 mt  -f /dev/nsa0  comp  enable
850 \end{verbatim}
851 \normalsize
852
853 and 
854
855 \footnotesize
856 \begin{verbatim}
857   Hardware End of Medium = no
858   BSF at EOM = no
859   Backward Space Record = no
860   Backward Space File = no
861   Fast Forward Space File = yes
862   TWO EOF = no
863 \end{verbatim}
864 \normalsize
865
866 This has been confirmed by several other people using different hardware. This
867 configuration is the preferred one because it uses one EOF and no backspacing
868 at the end of the tape, which works much more efficiently and reliably with
869 modern tape drives. 
870
871 Finally, here is a Device configuration that Danny Butroyd reports to work
872 correctly with the Overland Powerloader tape library using LT0-2 and
873 FreeBSD 5.4-Stable:
874
875 \footnotesize
876 \begin{verbatim}
877 # Overland Powerloader LT02 - 17 slots single drive
878 Device {
879   Name = Powerloader
880   Media Type = LT0-2
881   Archive Device = /dev/nsa0
882   AutomaticMount = yes;              
883   AlwaysOpen = yes;
884   RemovableMedia = yes;
885   RandomAccess = no;
886   Changer Command = "/usr/local/sbin/mtx-changer %c %o %S %a %d"
887   Changer Device = /dev/pass2
888   AutoChanger = yes
889   Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
890
891   # FreeBSD Specific Settings
892   Offline On Unmount = no
893   Hardware End of Medium = no
894   BSF at EOM = yes
895   Backward Space Record = no
896   Fast Forward Space File = no
897   TWO EOF = yes
898 }
899 \end{verbatim}
900 \normalsize
901
902
903 \subsubsection*{Finding your Tape Drives and Autochangers on FreeBSD}
904 \index[general]{FreeBSD!Finding your Tape Drives and Autochangers}
905 \index[general]{Finding your Tape Drives and Autochangers on FreeBSD}
906 \addcontentsline{toc}{subsubsection}{Finding your Tape Drives and
907 Autochangers on FreeBSD}
908
909 On FreeBSD, you can do a {\bf camcontrol devlist} as root to determine what
910 drives and autochangers you have. For example, 
911
912 \footnotesize
913 \begin{verbatim}
914 undef# camcontrol devlist
915     at scbus0 target 2 lun 0 (pass0,sa0)
916     at scbus0 target 4 lun 0 (pass1,sa1)
917     at scbus0 target 4 lun 1 (pass2)
918 \end{verbatim}
919 \normalsize
920
921 from the above, you can determine that there is a tape drive on {\bf /dev/sa0}
922 and another on {\bf /dev/sa1} in addition since there is a second line for the
923 drive on {\bf /dev/sa1}, you know can assume that it is the control device for
924 the autochanger (i.e. {\bf /dev/pass2}). It is also the control device name to
925 use when invoking the tapeinfo program. E.g. 
926
927 \footnotesize
928 \begin{verbatim}
929 tapeinfo -f /dev/pass2
930 \end{verbatim}
931 \normalsize
932
933 \label{onstream}
934
935 \subsubsection*{Using the OnStream driver on Linux Systems}
936 \index[general]{Using the OnStream driver on Linux Systems}
937 \index[general]{Systems!Using the OnStream driver on Linux}
938 \addcontentsline{toc}{subsubsection}{Using the OnStream driver on Linux
939 Systems}
940
941 Bacula version 1.33 (not 1.32x) is now working and ready for testing with the
942 OnStream kernel osst driver version 0.9.14 or above. Osst is available from: 
943 \elink{http://sourceforge.net/projects/osst/}
944 {http://sourceforge.net/projects/osst/}. 
945
946 To make Bacula work you must first load the new driver then, as root, do: 
947
948 \footnotesize
949 \begin{verbatim}
950   mt -f /dev/nosst0 defblksize 32768
951 \end{verbatim}
952 \normalsize
953
954 Also you must add the following to your Device resource in your Storage
955 daemon's conf file: 
956
957 \footnotesize
958 \begin{verbatim}
959  Minimum Block Size = 32768
960  Maximum Block Size = 32768
961 \end{verbatim}
962 \normalsize
963
964 Here is a Device specification provided by Michel Meyers that is known to
965 work: 
966
967 \footnotesize
968 \begin{verbatim}
969 Device {
970   Name = "Onstream DI-30"
971   Media Type = "ADR-30"
972   Archive Device = /dev/nosst0
973   Minimum Block Size = 32768
974   Maximum Block Size = 32768
975   Hardware End of Medium = yes
976   BSF at EOM = no
977   Backward Space File = yes
978   Fast Forward Space File = yes
979   Two EOF = no
980   AutomaticMount = yes
981   AlwaysOpen = yes
982   Removable Media = yes
983 }
984 \end{verbatim}
985 \normalsize
986
987 \subsection*{Hardware Compresson on EXB-8900}
988 \index[general]{Hardware Compression on EXB-8900}
989 \index[general]{EXB-8900!Hardware Compression}
990 \addcontentsline{to}{subsection}{Hardware Compression on EXB-8900}
991 To active, check, or disable the hardware compression feature
992 on an EXB-8900, use the exabyte MammothTool. You can get it here:
993 \elink{http://www.exabyte.com/support/online/downloads/index.cfm}
994 {http://www.exabyte.com/support/online/downloads/index.cfm}.
995 There is a solaris version of this tool. With option -C 0 or 1 you
996 can disable or activate compression. Start this tool without any
997 options for a small reference.
998
999 \label{fill}
1000 \subsubsection*{Using btape to Simulate Filling a Tape}
1001 \index[general]{Using btape to Simulate Filling a Tape}
1002 \index[general]{Tape!Using btape to Simulate Filling a}
1003 \addcontentsline{toc}{subsubsection}{Using btape to Simulate Filling a
1004 Tape}
1005
1006 Because there are often problems with certain tape drives or systems when end
1007 of tape conditions occur, {\bf btape} has a special command {\bf fill} that
1008 causes it to write random data to a tape until the tape fills. It then writes
1009 at least one more Bacula block to a second tape. Finally, it reads back both
1010 tapes to ensure that the data has been written in a way that Bacula can
1011 recover it. Note, there is also a single tape option as noted below, which you
1012 should use rather than the two tape test. See below for more details. 
1013
1014 This can be an extremely time consuming process (here it is about 6 hours) to
1015 fill a full tape. Note, that btape writes random data to the tape when it is
1016 filling it. This has two consequences: 1. it takes a bit longer to generate
1017 the data, especially on slow CPUs. 2. the total amount of data is
1018 approximately the real physical capacity of your tape, regardless of whether
1019 or not the tape drive compression is on or off. This is because random data
1020 does not compress very much. 
1021
1022 To begin this test, you enter the {\bf fill} command and follow the
1023 instructions. There are two options: the simple single tape option and the
1024 multiple tape option. Please use only the simple single tape option because
1025 the multiple tape option still doesn't work totally correctly. If the single
1026 tape option does not succeed, you should correct the problem before using
1027 Bacula. 
1028 \label{RecoveringFiles}
1029
1030 \subsection*{Recovering Files Written to Tape With Fixed Block Sizes}
1031 \index[general]{Recovering Files Written to Tape With Fixed Block Sizes}
1032 \index[general]{Sizes!Recovering Files Written to Tape With Fixed Block}
1033 \addcontentsline{toc}{subsection}{Recovering Files Written to Tape With Fixed
1034 Block Sizes}
1035
1036 If you have been previously running your tape drive in fixed block mode
1037 (default 512) and Bacula with variable blocks (default), then in version
1038 1.32f-x and 1.34 and above, Bacula will fail to recover files because it does
1039 block spacing, and because the block sizes don't agree between your tape drive
1040 and Bacula it will not work. 
1041
1042 The long term solution is to run your drive in variable block mode as
1043 described above. However, if you have written tapes using fixed block sizes,
1044 this can be a bit of a pain. The solution to the problem is: while you are
1045 doing a restore command using a tape written in fixed block size, ensure that
1046 your drive is set to the fixed block size used while the tape was written.
1047 Then when doing the {\bf restore} command in the Console program, do not
1048 answer the prompt {\bf yes/mod/no}. Instead, edit the bootstrap file (the
1049 location is listed in the prompt) using any ASCII editor. Remove all {\bf
1050 VolBlock} lines in the file. When the file is re-written, answer the question,
1051 and Bacula will run without using block positioning, and it should recover
1052 your files. 
1053
1054 \label{BlockModes}
1055 \subsection*{Tape Blocking Modes}
1056 \index[general]{Modes!Tape Blocking}
1057 \index[general]{Tape Blocking Modes}
1058 \addcontentsline{toc}{subsection}{Tape Blocking Modes}
1059
1060 SCSI tapes may either be written in {\bf variable} or {\bf fixed} block sizes.
1061 Newer drives support both modes, but some drives such as the QIC devices
1062 always use fixed block sizes. Bacula attempts to fill and write complete
1063 blocks (default 65K), so that in normal mode (variable block size), Bacula
1064 will always write blocks of the same size except the last block of a Job. If
1065 Bacula is configured to write fixed block sizes, it will pad the last block of
1066 the Job to the correct size. Bacula expects variable tape block size drives to
1067 behave as follows: Each write to the drive results in a single record being
1068 written to the tape. Each read returns a single record. If you request less
1069 bytes than are in the record, only those number of bytes will be returned, but
1070 the entire logical record will have been read (the next read will retrieve the
1071 next record). Thus data from a single write is always returned in a single
1072 read, and sequentially written records are returned by sequential reads. 
1073
1074 Bacula expects fixed block size tape drives to behave as follows: If a write
1075 length is greater than the physical block size of the drive, the write will be
1076 written as two blocks each of the fixed physical size. This single write may
1077 become multiple physical records on the tape. (This is not a good situation).
1078 According to the documentation, one may never write an amount of data that is
1079 not the exact multiple of the blocksize (it is not specified if an error
1080 occurs or if the the last record is padded). When reading, it is my
1081 understanding that each read request reads one physical record from the tape.
1082 Due to the complications of fixed block size tape drives, you should avoid
1083 them if possible with Bacula, or you must be ABSOLUTELY certain that you use
1084 fixed block sizes within Bacula that correspond to the physical block size of
1085 the tape drive. This will ensure that Bacula has a one to one correspondence
1086 between what it writes and the physical record on the tape. 
1087
1088 Please note that Bacula will not function correctly if it writes a block and
1089 that block is split into two or more physical records on the tape. Bacula
1090 assumes that each write causes a single record to be written, and that it can
1091 sequentially recover each of the blocks it has written by using the same
1092 number of sequential reads as it had written. 
1093
1094 \subsection*{Details of Tape Modes}
1095 \index[general]{Modes!Details}
1096 \index[general]{Details of Tape Modes}
1097 \addcontentsline{toc}{subsection}{Details of Tape Modes}
1098 Rudolf Cejka has provided the following information concerning
1099 certain tape modes and MTEOM.
1100
1101 \begin{description}
1102 \item[Tape level]
1103   It is always possible to position filemarks or blocks, whereas
1104   positioning to the end-of-data is only optional feature, however it is
1105   implemented very often.  SCSI specification also talks about optional
1106   sequential filemarks, setmarks and sequential setmarks, but these are not
1107   implemented so often.  Modern tape drives keep track of file positions in
1108   built-in chip (AIT, LTO) or at the beginning of the tape (SDLT), so there
1109   is not any speed difference, if end-of-data or filemarks is used (I have
1110   heard, that LTO-1 from all 3 manufacturers do not use its chip for file
1111   locations, but a tape as in SDLT case, and I'm not sure about LTO-2 and
1112   LTO-3 case).  However there is a big difference, that end-of-data ignores
1113   file position, whereas filemarks returns the real number of skipped
1114   files, so OS can track current file number just in filemarks case.
1115
1116 \item[OS level]
1117   Solaris does use just SCSI SPACE Filemarks, it does not support SCSI
1118   SPACE End-of-data.  When MTEOM is called, Solaris does use SCSI SPACE
1119   Filemarks with count = 1048576 for fast mode, and combination of SCSI
1120   SPACE Filemarks with count = 1 with SCSI SPACE Blocks with count = 1 for
1121   slow mode, so EOD mark on the tape on some older tape drives is not
1122   skipped.  File number is always tracked for MTEOM.
1123
1124   Linux does support both SCSI SPACE Filemarks and End-of-data: When MTEOM
1125   is called in MT_ST_FAST_MTEOM mode, SCSI SPACE End-of-data is used.
1126   In the other case, SCSI SPACE Filemarks with count =
1127   8388607 is used.  
1128   There is no real slow mode like in Solaris - I just expect, that for
1129   older tape drives Filemarks may be slower than End-of-data, but not so
1130   much as in Solaris slow mode.  File number is tracked for MTEOM just
1131   without MT_ST_FAST_MTEOM - when MT_ST_FAST_MTEOM is used, it is not.
1132
1133   FreeBSD does support both SCSI SPACE Filemarks and End-of-data, but when
1134   MTEOD (MTEOM) is called, SCSI SPACE End-of-data is always used.  FreeBSD
1135   never use SCSI SPACE Filemarks for MTEOD. File number is never tracked
1136   for MTEOD.
1137
1138 \item[Bacula level]
1139   When {\bf Hardware End of Medium = Yes} is used, MTEOM is called, but it
1140   does not mean, that hardware End-of-data must be used.  When Hardware End
1141   of Medium = No, if Fast Forward Space File = Yes, MTFSF with count =
1142   32767 is used, else Block Read with count = 1 with Forward Space File
1143   with count = 1 is used, which is really very slow.
1144
1145 \item [Hardware End of Medium = Yes|No]
1146   The name of this option is misleading and is the source of confusion,
1147   because it is not the hardware EOM, what is really switched here.
1148
1149   If I use Yes, OS must not use SCSI SPACE End-of-data, because Bacula
1150   expects, that there is tracked file number, which is not supported by
1151   SCSI specification.  Instead, the OS have to use SCSI SPACE Filemarks.
1152
1153   If I use No, an action depends on Fast Forward Space File.
1154
1155   When I set {\bf Hardware End of Medium = no}
1156   and {\bf Fast Forward Space File = no}
1157   file positioning was very slow
1158   on my LTO-3 (about 10 to 100 minutes), but
1159
1160   with {\bf Hardware End of Medium = no} and
1161 {\bf Fast Forward Space File = yes}, the time is 10 to
1162 100 times faster (about 1 to 2 minutes).
1163
1164 \end{description}
1165
1166 \subsection*{Autochanger Errors}
1167 \index[general]{Errors!Autochanger}
1168 \index[general]{Autochanger Errors}
1169 \addcontentsline{toc}{subsection}{Autochanger Errors}
1170
1171 If you are getting errors such as:
1172
1173 \footnotesize
1174 \begin{verbatim}
1175 3992 Bad autochanger "load slot 1, drive 1": ERR=Child exited with code 1.
1176 \end{verbatim}
1177 \normalsize
1178
1179 and you are running your Storage daemon as non-root, then most likely
1180 you are having permissions problems with the control channel. Running
1181 as root, set permissions on /dev/sgX so that the userid and group of
1182 your Storage daemon can access the device. You need to ensure that you
1183 all access to the proper control device, and if you don't have any
1184 SCSI disk drives (including SATA drives), you might want to change
1185 the permissions on /dev/sg*.
1186
1187 \subsection*{Syslog Errors}
1188 \index[general]{Errors!Syslog}
1189 \index[general]{Syslog Errors}
1190 \addcontentsline{toc}{subsection}{Syslog Errors}
1191
1192 If you are getting errors such as:
1193
1194 \footnotesize
1195 \begin{verbatim}
1196 : kernel: st0: MTSETDRVBUFFER only allowed for root
1197 \end{verbatim}
1198 \normalsize
1199
1200 you are most likely running your Storage daemon as non-root, and
1201 Bacula is attempting to set the correct OS buffering to correspond
1202 to your Device resource. Most OSes allow only root to issue this
1203 ioctl command. In general, the message can be ignored providing 
1204 you are sure that your OS parameters are properly configured as
1205 described earlier in this manual.  If you are running your Storage daemon 
1206 as root, you should not be getting these system log messages, and if
1207 you are, something is probably wrong.
1208