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