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