]> git.sur5r.net Git - bacula/docs/blob - docs/manual-de/storedconf.tex
- Create French and Italian translation files (fr.po, it.po).
[bacula/docs] / docs / manual-de / storedconf.tex
1 %%
2 %%
3
4 \section*{Storage Daemon Configuration}
5 \label{_ChapterStart31}
6 \index[general]{Storage Daemon Configuration }
7 \index[general]{Configuration!Storage Daemon }
8 \addcontentsline{toc}{section}{Storage Daemon Configuration}
9
10 \subsection*{General}
11 \index[general]{General }
12 \addcontentsline{toc}{subsection}{General}
13
14 The Storage Daemon configuration file has relatively few resource definitions.
15 However, due to the great variation in backup media and system capabilities,
16 the storage daemon must be highly configurable. As a consequence, there are
17 quite a large number of directives in the Device Resource definition that
18 allow you to define all the characteristics of your Storage device (normally a
19 tape drive). Fortunately, with modern storage devices, the defaults are
20 sufficient, and very few directives are actually needed. 
21
22 Examples of {\bf Device} resource directives that are known to work for a
23 number of common tape drives can be found in the {\bf
24 \lt{}bacula-src\gt{}/examples/devices} directory, and most will also be listed
25 here. 
26
27 For a general discussion of configuration file and resources including the
28 data types recognized by {\bf Bacula}, please see the 
29 \ilink{Configuration}{_ChapterStart16} chapter of this manual. The
30 following Storage Resource definitions must be defined: 
31
32 \begin{itemize}
33 \item 
34    \ilink{Storage}{StorageResource} -- to define the  name of the
35    Storage daemon.  
36 \item 
37    \ilink{Director}{DirectorResource1} -- to  define the Director's
38    name and his access password.  
39 \item 
40    \ilink{Device}{DeviceResource} -- to define  the
41    characteristics of your storage device (tape  drive).  
42 \item 
43    \ilink{Messages}{_ChapterStart15} -- to define where error  and
44    information messages are to be sent. 
45 \end{itemize}
46
47 \subsection*{Storage Resource}
48 \label{StorageResource}
49 \index[general]{Resource!Storage }
50 \index[general]{Storage Resource }
51 \addcontentsline{toc}{subsection}{Storage Resource}
52
53 In general, the properties specified under the Storage resource define global
54 properties of the Storage daemon. Each Storage daemon configuration file must
55 have one and only one Storage resource definition. 
56
57 \begin{description}
58
59 \item [Name = \lt{}Storage-Daemon-Name\gt{}]
60    \index[sd]{Name  }
61    Specifies the Name of the Storage daemon. This  directive is required. 
62
63 \item [Working Directory = \lt{}Directory\gt{}]
64    \index[sd]{Working Directory  }
65    This directive  is mandatory and specifies a directory in which the Storage
66    daemon  may put its status files. This directory should be used only  by {\bf
67    Bacula}, but may be shared by other Bacula daemons. This  directive is
68    required  
69
70 \item [Pid Directory = \lt{}Directory\gt{}]
71    \index[sd]{Pid Directory  }
72    This directive  is mandatory and specifies a directory in which the Director 
73    may put its process Id file files. The process Id file is used to  shutdown
74    Bacula and to prevent multiple copies of  Bacula from running simultaneously. 
75    This directive is required. Standard shell expansion of the {\bf Directory} 
76    is done when the configuration file is read so that values such  as {\bf
77    \$HOME} will be properly expanded.  
78
79    Typically on Linux systems, you will set this to:  {\bf /var/run}. If you are
80    not installing Bacula in the  system directories, you can use the {\bf Working
81    Directory} as  defined above. 
82
83 \item [Heartbeat Interval = \lt{}time-interval\gt{}]
84    \index[sd]{Heartbeat Interval  }
85    This directive defines an interval of time.  When the Storage daemon is
86    waiting for the operator to mount a tape, each time interval, it will
87    send a heartbeat signal to the File daemon.  The default interval is
88    zero which disables the heartbeat.  This feature is particularly useful
89    if you have a router such as 3Com that does not follow Internet
90    standards and times out an inactive connection after a short duration.
91
92 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
93    \index[sd]{Maximum Concurrent Jobs  }
94    where \lt{}number\gt{} is the maximum number of Jobs that should run
95    concurrently.  The default is set to 10, but you may set it to a larger
96    number.  Each contact from the Director (e.g.  status request, job start
97    request) is considered as a Job, so if you want to be able to do a {\bf
98    status} request in the console at the same time as a Job is running, you
99    will need to set this value greater than 1.  To run simultaneous Jobs,
100    you will need to set a number of other directives in the Director's
101    configuration file.  Which ones you set depend on what you want, but you
102    will almost certainly need to set the {\bf Maximum Concurrent Jobs} in
103    the Storage resource in the Director's configuration file and possibly
104    those in the Job and Client resources.
105
106 \item [SDAddresses = \lt{}IP-address-specification\gt{}]
107    \index[sd]{SDAddresses  }
108    Specify the ports and addresses on which the Storage daemon will listen
109    for Director connections.  Normally, the default is sufficient and you
110    do not need to specify this directive.  Probably the simplest way to
111    explain how this directive works is to show an example:
112
113 \footnotesize
114 \begin{verbatim}
115  SDAddresses  = { ip = {
116         addr = 1.2.3.4; port = 1205; }
117     ipv4 = {
118         addr = 1.2.3.4; port = http; }
119     ipv6 = {
120         addr = 1.2.3.4;
121         port = 1205;
122     }
123     ip = {
124         addr = 1.2.3.4
125         port = 1205
126     }
127     ip = {
128         addr = 1.2.3.4
129     }
130     ip = {
131         addr = 201:220:222::2
132     }
133     ip = {
134         addr = bluedot.thun.net
135     }
136  }
137 \end{verbatim}
138 \normalsize
139
140 where ip, ip4, ip6, addr, and port are all keywords. Note, that  the address
141 can be specified as either a dotted quadruple, or  IPv6 colon notation, or as
142 a symbolic name (only in the ip specification).  Also, port can be specified
143 as a number or as the mnemonic value from  the /etc/services file.  If a port
144 is not specified, the default will be used. If an ip  section is specified,
145 the resolution can be made either by IPv4 or  IPv6. If ip4 is specified, then
146 only IPv4 resolutions will be permitted,  and likewise with ip6.  
147
148 Using this directive, you can replace both the SDPort and SDAddress 
149 directives shown below. 
150
151 \item [SDPort = \lt{}port-number\gt{}]
152    \index[sd]{SDPort  }
153    Specifies port number on which the Storage daemon  listens for Director
154    connections. The default is 9103.  
155    
156 \item [SDAddress = \lt{}IP-Address\gt{}]
157    \index[sd]{SDAddress  }
158    This directive is optional,  and if it is specified, it will cause the Storage
159    daemon server (for  Director and File daemon connections) to bind to the
160    specified  {\bf IP-Address}, which is either a domain name or an IP address 
161    specified as a dotted quadruple. If this directive is not specified,  the
162    Storage daemon will bind to any available address (the default).
163
164 \end{description}
165
166 The following is a typical Storage daemon Storage definition. 
167
168 \footnotesize
169 \begin{verbatim}
170 #
171 # "Global" Storage daemon configuration specifications appear
172 # under the Storage resource.
173 #
174 Storage {
175   Name = "Storage daemon"
176   Address = localhost
177   WorkingDirectory = "~/bacula/working"
178   Pid    Directory = "~/bacula/working"
179 }
180 \end{verbatim}
181 \normalsize
182
183 \subsection*{Director Resource}
184 \label{DirectorResource1}
185 \index[general]{Director Resource }
186 \index[general]{Resource!Director }
187 \addcontentsline{toc}{subsection}{Director Resource}
188
189 The Director resource specifies the Name of the Director which is permitted
190 to use the services of the Storage daemon.  There may be multiple Director
191 resources.  The Director Name and Password must match the corresponding
192 values in the Director's configuration file.
193
194 \begin{description}
195
196 \item [Name = \lt{}Director-Name\gt{}]
197    \index[sd]{Name  }
198    Specifies the Name of the Director allowed to connect  to the Storage daemon.
199    This directive is required.  
200
201 \item [Password = \lt{}Director-password\gt{}]
202    \index[sd]{Password  }
203    Specifies the password that must be supplied by the above named  Director.
204    This directive is required.  
205
206 \item [Monitor = \lt{}yes|no\gt{}]
207    \index[sd]{Monitor  }
208    If Monitor is set to {\bf no} (default), this director will have full
209    access to this Storage daemon.  If Monitor is set to {\bf yes}, this
210    director will only be able to fetch the current status of this Storage
211    daemon.
212
213    Please note that if this director is being used by a Monitor, we highly 
214    recommend to set this directive to {\bf yes} to avoid serious security 
215    problems. 
216
217 \end{description}
218
219 The following is an example of a valid Director resource definition: 
220
221 \footnotesize
222 \begin{verbatim}
223 Director {
224   Name = MainDirector
225   Password = my_secret_password
226 }
227 \end{verbatim}
228 \normalsize
229
230 \label{DeviceResource}
231 \subsection*{Device Resource}
232 \index[general]{Resource!Device }
233 \index[general]{Device Resource }
234 \addcontentsline{toc}{subsection}{Device Resource}
235
236 The Device Resource specifies the details of each device (normally a tape
237 drive) that can be used by the Storage daemon.  There may be multiple
238 Device resources for a single Storage daemon.  In general, the properties
239 specified within the Device resource are specific to the Device.
240
241 \begin{description}
242
243 \item [Name = {\it Device-Name}]
244    \index[sd]{Name  }
245    Specifies the Name that the Director will use when asking to backup or
246    restore to or from to this device. This is the logical  Device name, and may
247    be any string up to 127 characters in length.  It is generally a good idea to
248    make it correspond to the English  name of the backup device. The physical
249    name of the device is  specified on the {\bf Archive Device} directive
250    described below.  The name you specify here is also used in your Director's
251    conf  file on the 
252    \ilink{Device directive}{StorageResource2}  in its Storage
253    resource. 
254
255 \item [Archive Device = {\it name-string}]
256    \index[sd]{Archive Device  }
257    The specified {\bf name-string} gives the system file name of the  storage
258    device managed by this storage daemon. This will usually be  the device file
259    name of a removable storage device (tape drive),  for example ``{\bf
260    /dev/nst0}'' or ``{\bf /dev/rmt/0mbn}''.  For a DVD-writer, it will be for
261    example {\bf /dev/hdc}.  It may also be a directory name if you are archiving
262    to disk storage.  In this case, you must supply the full absolute path to the
263    directory.  When specifying a tape device, it is preferable that the 
264    ``non-rewind'' variant of the device file name be given.  In addition, on
265    systems such as Sun, which have multiple tape  access methods, you must be
266    sure to specify to use  Berkeley I/O conventions with the device. The {\bf b}
267    in the Solaris (Sun)  archive specification {\bf /dev/rmt/0mbn} is what is
268    needed in  this case. Bacula does not support SysV tape drive behavior.  
269    
270    As noted above, normally the Archive Device is the name of a  tape drive, but
271    you may also specify an absolute path to  an existing directory. If the Device
272    is a directory  Bacula will write to file storage in the specified directory,
273    and  the filename used will be the Volume name as specified in the  Catalog.
274    If you want to write into more than one directory (i.e.  to spread the load to
275    different disk drives), you will need to define  two Device resources, each
276    containing an Archive Device with a  different directory.  
277    
278    In addition to a tape device name or a directory name, Bacula will  accept the
279    name of a FIFO. A FIFO is a special kind of file that  connects two programs
280    via kernel memory. If a FIFO device is specified  for a backup operation, you
281    must have a program that reads what Bacula  writes into the FIFO. When the
282    Storage daemon starts the job, it  will wait for {\bf MaximumOpenWait} seconds
283    for the read program to start reading, and then time it out and  terminate
284    the job. As a consequence, it is best to start the read  program at the
285    beginning of the job perhaps with the {\bf RunBeforeJob}  directive. For this
286    kind of device, you never want to specify  {\bf AlwaysOpen}, because you want
287    the Storage daemon to open it only  when a job starts, so you must explicitly
288    set it to {\bf No}.  Since a FIFO is a one way device, Bacula will not attempt
289    to read  a label of a FIFO device, but will simply write on it. To create a 
290    FIFO Volume in the catalog, use the {\bf add} command rather than  then {\bf
291    label} command to avoid attempting to write a label.  
292    
293    During a restore operation, if the Archive Device is a FIFO, Bacula  will
294    attempt to read from the FIFO, so you must have an external program  that
295    writes into the FIFO. Bacula will wait {\bf MaximumOpenWait} seconds  for the
296    program to begin writing and will then time it out and  terminate the job. As
297    noted above, you may use the {\bf RunBeforeJob}  to start the writer program
298    at the beginning of the job.  
299    
300    The Archive Device directive is required. 
301
302 \item [Media Type = {\it name-string}]
303    \index[sd]{Media Type  }
304    The specified {\bf name-string} names the type of media supported  by this
305    device, for example, ``DLT7000''. Media type names  are arbitrary in that you
306    set it to anything you want, but  must be known to the volume database to keep
307    track of which  storage daemons can read which volumes. The same  {\bf
308    name-string} must appear in the appropriate Storage  resource definition in
309    the Director's configuration file.  
310    
311    Even though the names you assign are arbitrary (i.e. you  choose the name you
312    want), you should take care in specifying  them because the Media Type is used
313    to determine which  storage device Bacula will select during restore. Thus you
314    should probably use the same Media Type specification for all  drives where
315    the Media can be freely interchanged. This is  not generally an issue if you
316    have a single Storage daemon,  but it is with multiple Storage daemons,
317    especially if they  have incompatible media.  
318    
319    For example, if you specify a Media  Type of ``DDS-4'' then during the
320    restore, Bacula  will be able to choose any Storage Daemon that handles 
321    ``DDS-4''. If you have an autochanger, you might  want to name the Media Type
322    in a way that is unique to the  autochanger, unless you wish to possibly use
323    the Volumes in  other drives. You should also ensure to have unique Media 
324    Type names if the Media is not compatible between drives.  This specification
325    is required for all devices. 
326
327 \label{Autochanger}
328 \item [Autochanger = {\it Yes|No}]
329    \index[sd]{Autochanger  }
330    If {\bf Yes}, this device is an automatic tape changer, and  you should also
331    specify a {\bf Changer Device} as well as  a {\bf Changer Command}.  If {\bf
332    No} (default), the volume must be manually changed.  You might also want to
333    add an identical directive to the  
334    \ilink{ Storage resource}{Autochanger1}  in the Director's
335    configuration file so that  when labeling tapes you are prompted for the slot.
336  
337
338 \item [Changer Device = {\it name-string}]
339    \index[sd]{Changer Device  }
340    The specified {\bf name-string} gives the system file name of the  autochanger
341    device name that corresponds to the {\bf Archive Device}  specified. This
342    device name is specified if you have an autochanger  or if you want to use the
343    {\bf Alert Command} (see below).  Normally you will specify the {\bf generic
344    SCSI} device  name in this directive. For example, on Linux systems, for 
345    archive device {\bf /dev/nst0}, This directive is optional.  See the 
346    \ilink{ Using Autochangers}{_ChapterStart18}  chapter of this
347    manual for more details of using this and the  following autochanger
348    directives. 
349
350 \item [Changer Command = {\it name-string}]
351    \index[sd]{Changer Command  }
352    The {\bf name-string} specifies an external program to be called  that will
353    automatically change volumes as required by {\bf Bacula}.  Most frequently,
354    you will specify the Bacula supplied {\bf mtx-changer}  script as follows:  
355
356 \footnotesize
357 \begin{verbatim}
358 Changer Command = "/path/mtx-changer %c %o %S %a %d"
359 \end{verbatim}
360 \normalsize
361
362    and you will install the {\bf mtx} on your system (found  in the {\bf depkgs}
363    release). An example of this command is in the default bacula-sd.conf file. 
364    For more details on the substitution characters that may be specified  to
365    configure your autochanger please see  the 
366    \ilink{Autochangers}{_ChapterStart18} chapter of this  manual.
367    For FreeBSD users, you might want to see one of the  several {\bf chio}
368    scripts in {\bf examples/autochangers}.  
369
370 \item [Alert Command = {\it name-string}]
371    \index[sd]{Alert Command  }
372    The {\bf name-string} specifies an external program to be called  at the
373    completion of each Job after the device is released.  The purpose of this
374    command is to check for Tape Alerts, which  are present when something is
375    wrong with your tape drive  (at least for most modern tape drives).  The same
376    substitution characters that may be specified  in the Changer Command may also
377    be used in this string.  For more information, please see  the 
378    \ilink{Autochangers}{_ChapterStart18} chapter of this  manual. 
379    
380    
381    Note, it is not necessary to have an autochanger to use this  command. The
382    example below uses the {\bf tapeinfo} program  that comes with the {\bf mtx}
383    package, but it can be used  on any tape drive. However, you will need to
384    specify  a {\bf Changer Device} directive in your Device resource  (see above)
385    so that the generic SCSI device name can be  edited into the command (with the
386    \%c).  
387    
388    An example of the use of this command to print Tape Alerts  in the Job report
389    is:  
390
391 \footnotesize
392 \begin{verbatim}
393 Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
394       
395 \end{verbatim}
396 \normalsize
397
398 and an example output when there is a problem could be:  
399
400 \footnotesize
401 \begin{verbatim}
402 bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
403                   between tape drive and initiator.
404       
405 \end{verbatim}
406 \normalsize
407
408 \item [Drive Index = {\it number}]
409    \index[sd]{Drive Index  }
410    The {\bf Drive Index} that you specify is passed to the  {\bf mtx-changer}
411    script and is thus passed to the {\bf mtx}  program. By default, the Drive
412    Index is zero, so if you have only  one drive in your autochanger, everything
413    will work normally.  However, if you have multiple drives, you may specify two
414    Bacula  Device resources. The first will either set Drive Index to zero,  or
415    leave it unspecified, and the second Device Resource should  contain a Drive
416    Index set to 1. This will then permit you to  use two or more drives in your
417    autochanger. However, you must ensure  that Bacula does not request the same
418    Volume on both drives  at the same time. You may also need to modify the
419    mtx-changer  script to do locking so that two jobs don't attempt to use  the
420    autochanger at the same time. An example script can  be found in {\bf
421    examples/autochangers/locking-mtx-changer}.  
422
423 \item [Maximum Changer Wait = {\it time}]
424    \index[sd]{Maximum Changer Wait  }
425    This directive specifies the maximum time for Bacula to wait  for an
426    autochanger to change the volume. If this time is exceeded,  Bacula will
427    invalidate the Volume slot number stored in  the catalog and try again. If no
428    additional changer volumes exist,  Bacula will ask the operator to intervene.
429    The default time  out is 5 minutes.
430
431 \item [Always Open = {\it Yes|No}]
432    \index[sd]{Always Open  }
433    If {\bf Yes} (default), Bacula will always keep the device  open unless
434    specifically {\bf unmounted} by the Console program.  This permits Bacula to
435    ensure that the tape drive is always  available. If you set {\bf AlwaysOpen}
436    to {\bf no} {\bf Bacula}  will only open the drive when necessary, and at the
437    end of the Job  if no other Jobs are using the drive, it will be freed. The
438    next time Bacula wants to append to a tape on a drive that was freed, Bacula
439    must rewind the tape and position to the end. To avoid unnecessary tape positioning 
440    and to minimize unnecessary operator intervention, it is highly recommended  that
441    {\bf Always Open = yes}. This also ensures that the drive  is available when
442    Bacula needs it.  
443    
444    If you have {\bf Always Open = yes} (recommended) and you want  to use the
445    drive for something else, simply use the {\bf unmount}  command in the Console
446    program to release the drive. However, don't  forget to remount the drive with
447    {\bf mount} when the drive is  available or the next Bacula job will block.  
448    
449    For File storage, this directive is ignored. For a FIFO storage  device, you
450    must set this to {\bf No}.  
451    
452    Please note that if you set this directive to {\bf No} Bacula  will release
453    the tape drive between each job, and thus the next job  will rewind the tape
454    and position it to the end of the data. This  can be a very time consuming
455    operation. 
456
457 \item [Volume Poll Interval = {\it time}]
458    \index[sd]{Volume Poll Interval  }
459    If the time  specified on this directive is non-zero, after  asking the
460    operator to mount a new volume Bacula will  periodically poll (or read) the
461    drive at the specified  interval to see if a new volume has been mounted. If
462    the  time interval is zero (the default), no polling will occur.  This
463    directive can be useful if you want to avoid operator  intervention via the
464    console. Instead, the operator can  simply remove the old volume and insert
465    the requested one,  and Bacula on the next poll will recognize the new tape
466    and  continue. Please be aware that if you set this interval  too small, you
467    may excessively wear your tape drive if the  old tape remains in the drive,
468    since Bacula will read it on  each poll. This can be avoided by ejecting the
469    tape using  the {\bf Offline On Unmount} and the {\bf Close on Poll} 
470    directives. 
471
472 \item [Close on Poll= {\it Yes|No}]
473    \index[sd]{Close on Poll }
474    If {\bf Yes}, Bacula close the device (equivalent to  an unmount except no
475    mount is required) and reopen it at each  poll. Normally this is not too
476    useful unless you have the  {\bf Offline on Unmount} directive set, in which
477    case the  drive will be taken offline preventing wear on the tape  during any
478    future polling. Once the operator inserts a new  tape, Bacula will recognize
479    the drive on the next poll and  automatically continue with the backup. 
480
481 \item [Maximum Open Wait = {\it time}]
482    \index[sd]{Maximum Open Wait  }
483    This directive specifies the maximum amount of time that  Bacula will wait for
484    a device that is busy. The default is  5 minutes. If the device cannot be
485    obtained, the current Job will  be terminated in error. Bacula will re-attempt
486    to open the  drive the next time a Job starts that needs the the drive.
487
488 \item [Removable media = {\it Yes|No}]
489    \index[sd]{Removable media  }
490    If {\bf Yes}, this device supports removable media (for  example, tapes or
491    CDs). If {\bf No}, media cannot be removed  (for example, an intermediate
492    backup area on a hard disk).  
493
494 \item [Random access = {\it Yes|No}]
495    \index[sd]{Random access  }
496    If {\bf Yes}, the archive device is assumed to be a random  access medium
497    which supports the {\bf lseek} (or  {\bf lseek64} if Largefile is enabled
498    during configuration) facility.  
499
500 \item [Minimum block size = {\it size-in-bytes}]
501    \index[sd]{Minimum block size  }
502    On most modern tape drives, you will not need or wamt to  specify this directive, and
503    if you do so, it will be  to make Bacula use fixed block sizes.  This
504    statement applies only to non-random access devices (e.g.  tape drives).
505    Blocks written by the storage daemon to a non-random  archive device will
506    never be smaller than the given  {\bf size-in-bytes}. The Storage daemon will
507    attempt to  efficiently fill blocks with data received from active sessions
508    but  will, if necessary, add padding to a block to achieve the required 
509    minimum size.  
510    
511    To force the block size to be fixed, as is  the case for some non-random
512    access devices (tape drives), set  the {\bf Minimum block size} and the {\bf
513    Maximum block size} to  the same value (zero included). The default is that
514    both the  minimum and maximum block size are zero and the default block size 
515    is 64,512 bytes. If you wish the block size to be fixed and  different from
516    the default, specify the same value for both  {\bf Minimum block size} and
517    {\bf Maximum block size}.  
518    
519    For  example, suppose you want a fixed block size of 100K bytes, then you 
520    would specify:  
521
522 \footnotesize
523 \begin{verbatim}
524  
525     Minimum block size = 100K
526     Maximum block size = 100K
527     
528 \end{verbatim}
529 \normalsize
530
531    Please note that if you specify a fixed block size as shown above,  the tape
532    drive must either be in variable block size mode, or  if it is in fixed block
533    size mode, the block size (generally  defined by {\bf mt}) {\bf must} be
534    identical to the size specified  in Bacula -- otherwise when you attempt to
535    re-read your Volumes,  you will get an error.  
536    
537    If you want the  block size to be variable but with a 64K minimum and 200K
538    maximum (and  default as well), you would specify:  
539
540 \footnotesize
541 \begin{verbatim}
542  
543     Minimum block size = 64K
544     Maximum blocksize = 200K
545    
546 \end{verbatim}
547 \normalsize
548
549 \item [Maximum block size = {\it size-in-bytes}]
550    \index[sd]{Maximum block size  }
551    On most modern tape drives, you will not need to specify  this directive. If
552    you do so, it will most likely be to  use fixed block sizes (see Minimum block
553    size above).  The Storage daemon will aways attempt to write blocks of the 
554    specified {\bf size-in-bytes} to the archive device. As a  consequence, this
555    statement specifies both the default block size  and the maximum block size.
556    The size written never exceed the given  {\bf size-in-bytes}. If adding data
557    to a block would cause it to  exceed the given maximum size, the block will be
558    written to the  archive device, and the new data will begin a new block. 
559    
560    If no  value is specified or zero is specified, the Storage daemon will use  a
561    default block size of 64,512 bytes (126 * 512). 
562
563 \item [Hardware End of Medium = {\it Yes|No}]
564    \index[sd]{Hardware End of Medium  }
565    If {\bf No}, the archive device is not required to support end  of medium
566    ioctl request, and the storage daemon will use the forward  space file
567    function to find the end of the recorded data. If  {\bf Yes}, the archive
568    device must support the {\tt ioctl}  {\tt MTEOM} call, which will position the
569    tape to the end of the  recorded data. In addition, your SCSI driver must keep
570    track  of the file number on the tape and report it back correctly by  the
571    {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly  forward space to
572    the end of the recorded data, but they do not  keep track of the file number.
573    On Linux machines, the SCSI driver  has a {\bf fast-eod} option, which if set
574    will cause the driver  to lose track of the file number. You should ensure
575    that this  option is always turned off using the {\bf mt} program.  
576    
577    Default setting for Hardware End of Medium is {\bf Yes}. This  function is
578    used before appending to a tape to ensure that no  previously written data is
579    lost. We recommend if you have a non  standard or unusual tape drive that you
580    use the {\bf btape} program  to test your drive to see whether or not it
581    supports this function.  All modern (after 1998) tape drives support this
582    feature.  
583    
584    If you set Hardware End of Medium = no, you should also set  {\bf Fast Forward
585    Space File = no}. If you do not, Bacula will  most likely be unable to
586    correctly find the end of data on the  tape.  
587
588 \item [Fast Forward Space File = {\it Yes|No}]
589    \index[sd]{Fast Forward Space File  }
590    If {\bf No}, the archive device is not required to support  keeping track of
591    the file number ({\bf MTIOCGET} ioctl) during  forward space file. If {\bf
592    Yes}, the archive device must support  the {\tt ioctl} {\tt MTFSF} call, which
593    virtually all drivers  support, but in addition, your SCSI driver must keep
594    track of the  file number on the tape and report it back correctly by the 
595    {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly  forward space,
596    but they do not keep track of the file number or more  seriously, they do not
597    report end of meduim.  
598    
599    Default setting for Fast Forward Space File is {\bf Yes}. If  you disable
600    Hardware End of Medium, most likely you should also  disable Fast Forward
601    Space file. The {\bf test} command in the  program {\bf btape} will test this
602    feature and advise you if  it should be turned off.  
603    
604 \item [Use MTIOCGET = {\it Yes|No}]
605    \index[sd]{Fast Forward Space File  }
606    If {\bf No}, the operating system is not required to support keeping track of
607    the file number and reporting it in the ({\bf MTIOCGET} ioctl). The default
608    is {\bf Yes}. If you must set this to No, Bacula will do the proper file
609    position determination, but it is very unfortunate because it means that 
610    tape movement is very inefficient.
611    Fortunately, this operation system deficiency seems to be the case only on 
612    a few *BSD systems. Operating systems known to work correctly are Solaris, Linux 
613    and FreeBSD.
614
615 \item [BSF at EOM = {\it Yes|No}]
616    \index[sd]{BSF at EOM  }
617    If {\bf No}, the default, no special action is taken by  Bacula with the End
618    of Medium (end of tape) is reached because  the tape will be positioned after
619    the last EOF tape mark, and  Bacula can append to the tape as desired.
620    However, on some  systems, such as FreeBSD, when Bacula reads the End of
621    Medium  (end of tape), the tape will be positioned after the second  EOF tape
622    mark (two successive EOF marks indicated End of  Medium). If Bacula appends
623    from that point, all the appended  data will be lost. The solution for such
624    systems is to  specify {\bf BSF at EOM} which causes Bacula to backspace  over
625    the second EOF mark. Determination of whether or not  you need this directive
626    is done using the {\bf test} command  in the {\bf btape} program.
627
628 \item [TWO EOF = {\it Yes|No}]
629    \index[sd]{TWO EOF  }
630    If {\bf Yes}, Bacula will write two end of file marks when  terminating a tape
631 -- i.e. after the last job or at the end of  the medium. If {\bf No}, the
632 default, Bacula will only write  one end of file to terminate the tape. 
633
634 \item [Backward Space Record = {\it Yes|No}]
635    \index[sd]{Backward Space Record}
636    If {\it Yes}, the archive device supports the {\tt MTBSR  ioctl} to backspace
637    records. If {\it No}, this call is not  used and the device must be rewound
638    and advanced forward to the  desired position. Default is {\bf Yes} for non
639    random-access  devices. This function if enabled is used at the end of a 
640    Volume after writing the end of file and any ANSI/IBM labels to determine whether
641    or not the last block was written correctly. If you turn this function off,
642    the test will not be done. This causes no harm as the re-read process is
643    precautionary rather than required.
644
645 \item [Backward Space File = {\it Yes|No}]
646    \index[sd]{Backward Space File  }
647    If {\it Yes}, the archive device supports the {\bf MTBSF} and  {\bf MTBSF
648   ioctl}s to backspace over an end of file mark and to the  start of a file. If
649   {\it No}, these calls are not used and the  device must be rewound and
650   advanced forward to the desired position.  Default is {\bf Yes} for non
651   random-access devices. 
652
653 \item [Forward Space Record = {\it Yes|No}]
654    \index[sd]{Forward Space Record  }
655    If {\it Yes}, the archive device must support the {\bf MTFSR  ioctl} to
656    forward space over records. If {\bf No}, data must  be read in order to
657    advance the position on the device. Default is  {\bf Yes} for non
658    random-access devices. 
659
660 \item [Forward Space File = {\it Yes|No}]
661    \index[sd]{Forward Space File  }
662    If {\bf Yes}, the archive device must support the {\tt MTFSF  ioctl} to
663    forward space by file marks. If {\it No}, data  must be read to advance the
664    position on the device. Default is  {\bf Yes} for non random-access devices. 
665
666 \item [Offline On Unmount = {\it Yes|No}]
667    \index[sd]{Offline On Unmount  }
668    The default for this directive is {\bf No}. If {\bf Yes} the  archive device
669    must support the {\tt MTOFFL ioctl} to rewind and  take the volume offline. In
670    this case, Bacula will issue the  offline (eject) request before closing the
671    device during the {\bf unmount}  command. If {\bf No} Bacula will not attempt
672    to offline the  device before unmounting it. After an offline is issued,  the
673    cassette will be ejected thus {\bf requiring operator intervention}  to
674    continue, and on some systems require an explicit load command  to be issued
675    ({\bf mt -f /dev/xxx load}) before the system will recognize  the tape. If you
676    are using an autochanger, some devices  require an offline to be issued prior
677    to changing the volume. However,  most devices do not and may get very
678    confused.  
679
680 \item [Maximum Volume Size = {\it size}]
681    \index[sd]{Maximum Volume Size  }
682    No more than {\bf size} bytes will be written onto a given  volume on the
683    archive device. This directive is used mainly in  testing Bacula to simulate a
684    small Volume. It can also  be useful if you wish to limit the size of a File
685    Volume to say  less than 2GB of data. In some rare cases of really antiquated 
686    tape drives that do not properly indicate when the end of a  tape is reached
687    during writing (though I have read about such  drives, I have never personally
688    encountered one). Please note,  this directive is deprecated (being phased
689    out) in favor of the  {\bf Maximum Volume Bytes} defined in the Director's
690    configuration  file.  
691
692 \item [Maximum File Size = {\it size}]
693    \index[sd]{Maximum File Size  }
694    No more than {\bf size} bytes will be written into a given  logical file on
695    the volume. Once this size is reached, an end of  file mark is written on the
696    volume and subsequent data are written  into the next file. Breaking long
697    sequences of data blocks with  file marks permits quicker positioning to the
698    start of a given  stream of data and can improve recovery from read errors on
699    the  volume. The default is one Gigabyte.
700
701 \item [Block Positioning = {\it yes|no}]
702    \index[sd]{Block Positioning  }
703    This directive is not normally used (and has not yet been  tested). It will
704    tell Bacula not to use block positioning when  it is reading tapes. This can
705    cause Bacula to be {\bf extremely}  slow when restoring files. You might use
706    this directive if you  wrote your tapes with Bacula in variable block mode
707    (the default),  but your drive was in fixed block mode. If it then works as  I
708    hope, Bacula will be able to re-read your tapes. 
709
710 \item [Maximum Network Buffer Size = {\it bytes}]
711    \index[sd]{Maximum Network Buffer Size  }
712    where {\it bytes} specifies the initial network buffer  size to use with the
713 File daemon. This size will be adjusted down  if it is too large until it is
714 accepted by the OS. Please use  care in setting this value since if it is too
715 large, it will  be trimmed by 512 bytes until the OS is happy, which may
716 require  a large number of system calls. The default value is 32,768 bytes. 
717
718 \item [Maximum Spool Size = {\it bytes}]
719    \index[sd]{Maximum Spool Size  }
720    where the bytes specify the maximum spool size for all jobs  that are running.
721 The default is no limit. 
722
723 \item [Maximum Job Spool Size = {\it bytes}]
724    \index[sd]{Maximum Job Spool Size  }
725    where the bytes specify the maximum spool size for any one job  that is
726    running. The default is no limit. 
727    This directive is implemented only in version 1.37 and later.
728
729 \item [Spool Directory = {\it directory}]
730    \index[sd]{Spool Directory  }
731    specifies the name of the directory to be used to store  the spool files for
732 this device. This directory is also used to store  temporary part files when
733 writing to a device that requires mount (DVD).  The default is to use the
734 working directory. 
735
736 \item [Maximum Part Size = {\it bytes}]
737    \index[sd]{Maximum Part Size  }
738    This is the maximum size of a volume part file. The default is no limit.
739    This directive is implemented only in version 1.37 and later.
740
741    If the device requires  mount, it is transfered to the device when this size
742    is reached.  In this case, you must take care to have enough disk space left
743    in  the spool directory.  
744
745    Otherwise, it is left on the hard disk.  
746
747    It is ignored for tape and FIFO devices.  
748
749
750 \end{description}
751
752 \subsection*{Devices that require a mount (DVD)}
753 \index[general]{Devices that require a mount (DVD) }
754 \index[general]{DVD!Devices that require a mount }
755 \addcontentsline{toc}{subsection}{Devices that require a mount (DVD)}
756
757 All the directives in this section are implemented only in
758 Bacula version 1.37 and later.
759
760 \begin{description}
761
762 \item [Requires Mount = {\it Yes|No}]
763    \index[sd]{Requires Mount  }
764    You must set this directive to {\bf yes} for DVD-writers,  and to {\bf no} for
765    all other devices (tapes/files).  This directive indicates if the device
766    requires to be mounted to be read,  and if it must be written in a special way.
767    If it set, {\bf Mount Point},  {\bf Mount Command}, {\bf Unmount Command} and
768    {\bf Write Part Command}  directives must also be defined. 
769
770 \item [Mount Point = {\it directory}]
771    \index[sd]{Mount Point  }
772    Directory where the device must be mounted. 
773
774 \item [Mount Command = {\it name-string}]
775    \index[sd]{Mount Command  }
776    Command that must be executed to mount the device. Before the command is 
777    executed, \%a is replaced with the Archive Device, and \%m with the Mount 
778    Point.
779
780    Most frequently, you will define it as follows:  
781
782 \footnotesize
783 \begin{verbatim}
784 Mount Command = "/bin/mount -t iso9660 -o ro %a %m"
785     
786 \end{verbatim}
787 \normalsize
788
789 \item [Unmount Command = {\it name-string}]
790    \index[sd]{Unmount Command  }
791    Command that must be executed to unmount the device. Before the command  is
792    executed, \%a is replaced with the Archive Device, and \%m with the  Mount
793    Point.
794
795    Most frequently, you will define it as follows:  
796
797 \footnotesize
798 \begin{verbatim}
799 Unmount Command = "/bin/umount %m"
800     
801 \end{verbatim}
802 \normalsize
803
804 \item [Write Part Command = {\it name-string}]
805    \index[sd]{Write Part Command  }
806    Command that must be executed to write a part to the device. Before the 
807    command is executed, \%a is replaced with the Archive Device, \%m with the 
808    Mount Point, \%n with the current part number (0-based), and \%v with the 
809    current part filename.
810
811    For a DVD, you will most frequently specify the Bacula supplied  {\bf
812    dvd-writepart} script as follows:  
813
814 \footnotesize
815 \begin{verbatim}
816 Write Part Command = "/path/dvd-writepart %n %a %v"
817     
818 \end{verbatim}
819 \normalsize
820
821 \item [Free Space Command = {\it name-string}]
822    \index[sd]{Free Space Command  }
823    Command that must be executed to check how much free space is left on the 
824    device. Before the command is executed, \%a is replaced with the Archive 
825    Device, \%m with the Mount Point, \%n with the current part number (0-based), 
826    and \%v with the current part filename.
827
828    For a DVD, you will most frequently specify the Bacula supplied  {\bf
829    dvd-freespace} script as follows:  
830
831 \footnotesize
832 \begin{verbatim}
833 Free Space Command = "/path/dvd-freespace %n %a"
834     
835 \end{verbatim}
836 \normalsize
837
838 If you want to specify your own command, please look at the code of
839 dvd-freespace to see what output Bacula expects from this command.
840
841 If you do not set it, Bacula will expect there is always free space on the
842 device. 
843
844 \end{description}
845
846 \label{AutochangerRes}
847 \label{AutochangerResource1}
848 \input{autochangerres}
849
850 \subsection*{Capabilities}
851 \index[general]{Capabilities }
852 \addcontentsline{toc}{subsection}{Capabilities}
853
854 \begin{description}
855
856 \item [Label media = {\it Yes|No}]
857    \index[sd]{Label media  }
858    If {\bf Yes}, permits this device to automatically  label blank media without
859    an explicit operator command.  It does so by using an internal algorithm as
860    defined  on the 
861    \ilink{Label Format }{Label} record in each Pool resource.  If
862    this is {\bf No} as by default,  Bacula will label tapes only by specific
863    operator  command ({\bf label} in the Console) or when the tape has been
864    recycled.  The automatic labeling feature is most useful when writing to disk 
865    rather than tape volumes.  
866
867 \item [Automatic mount = {\it Yes|No}]
868    \index[sd]{Automatic mount  }
869    If {\bf Yes} (the default), permits the daemon to examine the  device to
870    determine if it contains a Bacula labeled  volume. This is done initially when
871    the daemon is started,  and then at the beginning of each job. This directive
872    is particularly  important if you have set {\bf Always Open = no} because it 
873    permits Bacula to attempt to read the device before asking  the system
874    operator to mount a tape.  
875
876 \end{description}
877
878 \subsection*{Messages Resource}
879 \label{MessagesResource1}
880 \index[general]{Resource!Messages }
881 \index[general]{Messages Resource }
882 \addcontentsline{toc}{subsection}{Messages Resource}
883
884 For a description of the Messages Resource, please see the 
885 \ilink{Messages Resource}{_ChapterStart15} Chapter of this
886 manual. 
887
888 \subsection*{Sample Storage Daemon Configuration File}
889 \label{SampleConfiguration}
890 \index[general]{File!Sample Storage Daemon Configuration }
891 \index[general]{Sample Storage Daemon Configuration File }
892 \addcontentsline{toc}{subsection}{Sample Storage Daemon Configuration File}
893
894 A example Storage Daemon configuration file might be the following: 
895
896 \footnotesize
897 \begin{verbatim}
898 #
899 # Default Bacula Storage Daemon Configuration file
900 #
901 #  For Bacula release 1.35.2 (16 August 2004) -- gentoo 1.4.16
902 #
903 # You may need to change the name of your tape drive
904 #   on the "Archive Device" directive in the Device
905 #   resource.  If you change the Name and/or the
906 #   "Media Type" in the Device resource, please ensure
907 #   that bacula-dir.conf has corresponding changes.
908 #
909 Storage {                               # definition of myself
910   Name = rufus-sd
911   Address = rufus
912   WorkingDirectory = "$HOME/bacula/bin/working"
913   Pid Directory = "$HOME/bacula/bin/working"
914   Maximum Concurrent Jobs = 20
915 }
916 #
917 # List Directors who are permitted to contact Storage daemon
918 #
919 Director {
920   Name = rufus-dir
921   Password = "ZF9Ctf5PQoWCPkmR3s4atCB0usUPg+vWWyIo2VS5ti6k"
922 }
923 #
924 # Restricted Director, used by tray-monitor to get the
925 #   status of the storage daemon
926 #
927 Director {
928   Name = rufus-mon
929   Password = "9usxgc307dMbe7jbD16v0PXlhD64UVasIDD0DH2WAujcDsc6"
930   Monitor = yes
931 }
932 #
933 # Devices supported by this Storage daemon
934 # To connect, the Director's bacula-dir.conf must have the
935 #  same Name and MediaType.
936 #
937 Device {
938   Name = "HP DLT 80"
939   Media Type = DLT8000
940   Archive Device = /dev/nst0
941   AutomaticMount = yes;                 # when device opened, read it
942   AlwaysOpen = yes;
943   RemovableMedia = yes;
944 }
945 #Device {
946 #  Name = SDT-7000                     #
947 #  Media Type = DDS-2
948 #  Archive Device = /dev/nst0
949 #  AutomaticMount = yes;               # when device opened, read it
950 #  AlwaysOpen = yes;
951 #  RemovableMedia = yes;
952 #}
953 #Device {
954 #  Name = Floppy
955 #  Media Type = Floppy
956 #  Archive Device = /mnt/floppy
957 #  RemovableMedia = yes;
958 #  Random Access = Yes;
959 #  AutomaticMount = yes;               # when device opened, read it
960 #  AlwaysOpen = no;
961 #}
962 #Device {
963 #  Name = FileStorage
964 #  Media Type = File
965 #  Archive Device = /tmp
966 #  LabelMedia = yes;                   # lets Bacula label unlabeled media
967 #  Random Access = Yes;
968 #  AutomaticMount = yes;               # when device opened, read it
969 #  RemovableMedia = no;
970 #  AlwaysOpen = no;
971 #}
972 #Device {
973 #  Name = "NEC ND-1300A"
974 #  Media Type = DVD
975 #  Archive Device = /dev/hda
976 #  LabelMedia = yes;                   # lets Bacula label unlabeled media
977 #  Random Access = Yes;
978 #  AutomaticMount = yes;               # when device opened, read it
979 #  RemovableMedia = yes;
980 #  AlwaysOpen = no;
981 #  MaximumPartSize = 800M;
982 #  RequiresMount = yes;
983 #  MountPoint = /mnt/cdrom;
984 #  MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
985 #  UnmountCommand = "/bin/umount %m";
986 #  SpoolDirectory = /tmp/backup;
987 #  WritePartCommand = "/etc/bacula/dvd-writepart %n %a %v"
988 #  FreeSpaceCommand = "/etc/bacula/dvd-freespace %a %n"
989 #}
990 #
991 # A very old Exabyte with no end of media detection
992 #
993 #Device {
994 #  Name = "Exabyte 8mm"
995 #  Media Type = "8mm"
996 #  Archive Device = /dev/nst0
997 #  Hardware end of medium = No;
998 #  AutomaticMount = yes;               # when device opened, read it
999 #  AlwaysOpen = Yes;
1000 #  RemovableMedia = yes;
1001 #}
1002 #
1003 # Send all messages to the Director,
1004 # mount messages also are sent to the email address
1005 #
1006 Messages {
1007   Name = Standard
1008   director = rufus-dir = all
1009   operator = root = mount
1010 }
1011 \end{verbatim}
1012 \normalsize