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}
11 \index[general]{General }
12 \addcontentsline{toc}{subsection}{General}
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.
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
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:
34 \ilink{Storage}{StorageResource} -- to define the name of the
37 \ilink{Director}{DirectorResource1} -- to define the Director's
38 name and his access password.
40 \ilink{Device}{DeviceResource} -- to define the
41 characteristics of your storage device (tape drive).
43 \ilink{Messages}{_ChapterStart15} -- to define where error and
44 information messages are to be sent.
47 \subsection*{Storage Resource}
48 \label{StorageResource}
49 \index[general]{Resource!Storage }
50 \index[general]{Storage Resource }
51 \addcontentsline{toc}{subsection}{Storage Resource}
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.
59 \item [Name = \lt{}Storage-Daemon-Name\gt{} ]
61 Specifies the Name of the Storage daemon. This directive is required.
63 \item [Working Directory = \lt{}Directory\gt{}]
64 \index[fd]{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
70 \item [Pid Directory = \lt{}Directory\gt{}]
71 \index[dir]{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.
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.
83 \item [Heartbeat Interval = \lt{}time-interval\gt{}]
84 \index[dir]{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 send a
87 heartbeat signal to the File daemon. The default interval is zero which
88 disables the heartbeat. This feature is particularly useful if you have a
89 router such as 3Com that does not follow Internet standards and times out an
90 inactive connection after a short duration.
92 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
93 \index[dir]{Maximum Concurrent Jobs }
94 where \lt{}number\gt{} is the maximum number of Jobs that should run
95 concurrently. The default is set to 2, but you may set it to a larger number.
96 Each contact from the Director (e.g. status request, job start request) is
97 considered as a Job, so if you want to be able to do a {\bf status} request
98 in the console at the same time as a Job is running, you will need to set
99 this value greater than 1.
101 \item [SDAddresses = \lt{}IP-address-specification\gt{}]
102 \index[console]{SDAddresses }
103 Specify the ports and addresses on which the Storage daemon will listen for
104 Director connections. Normally, the default is sufficient and you do not need
105 to specify this directive. Probably the simplest way to explain how this
106 directive works is to show an example:
110 SDAddresses = { ip = {
111 addr = 1.2.3.4; port = 1205; }
113 addr = 1.2.3.4; port = http; }
126 addr = 201:220:222::2
129 addr = bluedot.thun.net
135 where ip, ip4, ip6, addr, and port are all keywords. Note, that the address
136 can be specified as either a dotted quadruple, or IPv6 colon notation, or as
137 a symbolic name (only in the ip specification). Also, port can be specified
138 as a number or as the mnemonic value from the /etc/services file. If a port
139 is not specified, the default will be used. If an ip section is specified,
140 the resolution can be made either by IPv4 or IPv6. If ip4 is specified, then
141 only IPv4 resolutions will be permitted, and likewise with ip6.
143 Using this directive, you can replace both the SDPort and SDAddress
144 directives shown below.
146 \item [SDPort = \lt{}port-number\gt{} ]
147 \index[console]{SDPort }
148 Specifies port number on which the Storage daemon listens for Director
149 connections. The default is 9103.
151 \item [SDAddress = \lt{}IP-Address\gt{}]
152 \index[console]{SDAddress }
153 This directive is optional, and if it is specified, it will cause the Storage
154 daemon server (for Director and File daemon connections) to bind to the
155 specified {\bf IP-Address}, which is either a domain name or an IP address
156 specified as a dotted quadruple. If this directive is not specified, the
157 Storage daemon will bind to any available address (the default).
160 The following is a typical Storage daemon Storage definition.
165 # "Global" Storage daemon configuration specifications appear
166 # under the Storage resource.
169 Name = "Storage daemon"
171 WorkingDirectory = "~/bacula/working"
172 Pid Directory = "~/bacula/working"
177 \subsection*{Director Resource}
178 \label{DirectorResource1}
179 \index[general]{Director Resource }
180 \index[general]{Resource!Director }
181 \addcontentsline{toc}{subsection}{Director Resource}
183 The Director resource specifies the Name of the Director which is permitted to
184 use the services of the Storage daemon. There may be multiple Director
185 resources. The Director Name and Password must match the corresponding values
186 in the Director's configuration file.
190 \item [Name = \lt{}Director-Name\gt{} ]
191 \index[console]{Name }
192 Specifies the Name of the Director allowed to connect to the Storage daemon.
193 This directive is required.
195 \item [Password = \lt{}Director-password\gt{} ]
196 \index[console]{Password }
197 Specifies the password that must be supplied by the above named Director.
198 This directive is required.
200 \item [Monitor = \lt{}yes|no\gt{}]
201 \index[console]{Monitor }
202 If Monitor is set to {\bf no} (default), this director will have full access
203 to this Storage daemon. If Monitor is set to {\bf yes}, this director will
204 only be able to fetch the current status of this Storage daemon.
206 Please note that if this director is being used by a Monitor, we highly
207 recommend to set this directive to {\bf yes} to avoid serious security
211 The following is an example of a valid Director resource definition:
217 Password = my_secret_password
222 \label{DeviceResource}
224 \subsection*{Device Resource}
225 \index[general]{Resource!Device }
226 \index[general]{Device Resource }
227 \addcontentsline{toc}{subsection}{Device Resource}
229 The Device Resource specifies the details of each device (normally a tape
230 drive) that can be used by the Storage daemon. There may be multiple Device
231 resources for a single Storage daemon. In general, the properties specified
232 within the Device resource are specific to the Device.
236 \item [Name = {\it Device-Name} ]
238 Specifies the Name that the Director will use when asking to backup or
239 restore to or from to this device. This is the logical Device name, and may
240 be any string up to 127 characters in length. It is generally a good idea to
241 make it correspond to the English name of the backup device. The physical
242 name of the device is specified on the {\bf Archive Device} directive
243 described below. The name you specify here is also used in your Director's
245 \ilink{Device directive}{StorageResource2} in its Storage
248 \item [Archive Device = {\it name-string} ]
249 \index[fd]{Archive Device }
250 The specified {\bf name-string} gives the system file name of the storage
251 device managed by this storage daemon. This will usually be the device file
252 name of a removable storage device (tape drive), for example ``{\bf
253 /dev/nst0}'' or ``{\bf /dev/rmt/0mbn}''. For a DVD-writer, it will be for
254 example {\bf /dev/hdc}. It may also be a directory name if you are archiving
255 to disk storage. In this case, you must supply the full absolute path to the
256 directory. When specifying a tape device, it is preferable that the
257 ``non-rewind'' variant of the device file name be given. In addition, on
258 systems such as Sun, which have multiple tape access methods, you must be
259 sure to specify to use Berkeley I/O conventions with the device. The {\bf b}
260 in the Solaris (Sun) archive specification {\bf /dev/rmt/0mbn} is what is
261 needed in this case. Bacula does not support SysV tape drive behavior.
263 As noted above, normally the Archive Device is the name of a tape drive, but
264 you may also specify an absolute path to an existing directory. If the Device
265 is a directory Bacula will write to file storage in the specified directory,
266 and the filename used will be the Volume name as specified in the Catalog.
267 If you want to write into more than one directory (i.e. to spread the load to
268 different disk drives), you will need to define two Device resources, each
269 containing an Archive Device with a different directory.
271 In addition to a tape device name or a directory name, Bacula will accept the
272 name of a FIFO. A FIFO is a special kind of file that connects two programs
273 via kernel memory. If a FIFO device is specified for a backup operation, you
274 must have a program that reads what Bacula writes into the FIFO. When the
275 Storage daemon starts the job, it will wait for {\bf MaximumOpenWait} seconds
276 for the read program to start reading, and then time it out and terminate
277 the job. As a consequence, it is best to start the read program at the
278 beginning of the job perhaps with the {\bf RunBeforeJob} directive. For this
279 kind of device, you never want to specify {\bf AlwaysOpen}, because you want
280 the Storage daemon to open it only when a job starts, so you must explicitly
281 set it to {\bf No}. Since a FIFO is a one way device, Bacula will not attempt
282 to read a label of a FIFO device, but will simply write on it. To create a
283 FIFO Volume in the catalog, use the {\bf add} command rather than then {\bf
284 label} command to avoid attempting to write a label.
286 During a restore operation, if the Archive Device is a FIFO, Bacula will
287 attempt to read from the FIFO, so you must have an external program that
288 writes into the FIFO. Bacula will wait {\bf MaximumOpenWait} seconds for the
289 program to begin writing and will then time it out and terminate the job. As
290 noted above, you may use the {\bf RunBeforeJob} to start the writer program
291 at the beginning of the job.
293 The Archive Device directive is required.
295 \item [Media Type = {\it name-string} ]
296 \index[fd]{Media Type }
297 The specified {\bf name-string} names the type of media supported by this
298 device, for example, ``DLT7000''. Media type names are arbitrary in that you
299 set it to anything you want, but must be known to the volume database to keep
300 track of which storage daemons can read which volumes. The same {\bf
301 name-string} must appear in the appropriate Storage resource definition in
302 the Director's configuration file.
304 Even though the names you assign are arbitrary (i.e. you choose the name you
305 want), you should take care in specifying them because the Media Type is used
306 to determine which storage device Bacula will select during restore. Thus you
307 should probably use the same Media Type specification for all drives where
308 the Media can be freely interchanged. This is not generally an issue if you
309 have a single Storage daemon, but it is with multiple Storage daemons,
310 especially if they have incompatible media.
312 For example, if you specify a Media Type of ``DDS-4'' then during the
313 restore, Bacula will be able to choose any Storage Daemon that handles
314 ``DDS-4''. If you have an autochanger, you might want to name the Media Type
315 in a way that is unique to the autochanger, unless you wish to possibly use
316 the Volumes in other drives. You should also ensure to have unique Media
317 Type names if the Media is not compatible between drives. This specification
318 is required for all devices.
322 \item [Autochanger = {\it Yes|No} ]
323 \index[sd]{Autochanger }
324 If {\bf Yes}, this device is an automatic tape changer, and you should also
325 specify a {\bf Changer Device} as well as a {\bf Changer Command}. If {\bf
326 No} (default), the volume must be manually changed. You might also want to
327 add an identical directive to the
328 \ilink{ Storage resource}{Autochanger1} in the Director's
329 configuration file so that when labeling tapes you are prompted for the slot.
332 \item [Changer Device = {\it name-string} ]
333 \index[fd]{Changer Device }
334 The specified {\bf name-string} gives the system file name of the autochanger
335 device name that corresponds to the {\bf Archive Device} specified. This
336 device name is specified if you have an autochanger or if you want to use the
337 {\bf Alert Command} (see below). Normally you will specify the {\bf generic
338 SCSI} device name in this directive. For example, on Linux systems, for
339 archive device {\bf /dev/nst0}, This directive is optional. See the
340 \ilink{ Using Autochangers}{_ChapterStart18} chapter of this
341 manual for more details of using this and the following autochanger
344 \item [Changer Command = {\it name-string} ]
345 \index[fd]{Changer Command }
346 The {\bf name-string} specifies an external program to be called that will
347 automatically change volumes as required by {\bf Bacula}. Most frequently,
348 you will specify the Bacula supplied {\bf mtx-changer} script as follows:
352 Changer Command = "/path/mtx-changer %c %o %S %a %d"
357 and you will install the {\bf mtx} on your system (found in the {\bf depkgs}
358 release). An example of this command is in the default bacula-sd.conf file.
359 For more details on the substitution characters that may be specified to
360 configure your autochanger please see the
361 \ilink{Autochangers}{_ChapterStart18} chapter of this manual.
362 For FreeBSD users, you might want to see one of the several {\bf chio}
363 scripts in {\bf examples/autochangers}.
365 \item [Alert Command = {\it name-string} ]
366 \index[sd]{Alert Command }
367 The {\bf name-string} specifies an external program to be called at the
368 completion of each Job after the device is released. The purpose of this
369 command is to check for Tape Alerts, which are present when something is
370 wrong with your tape drive (at least for most modern tape drives). The same
371 substitution characters that may be specified in the Changer Command may also
372 be used in this string. For more information, please see the
373 \ilink{Autochangers}{_ChapterStart18} chapter of this manual.
376 Note, it is not necessary to have an autochanger to use this command. The
377 example below uses the {\bf tapeinfo} program that comes with the {\bf mtx}
378 package, but it can be used on any tape drive. However, you will need to
379 specify a {\bf Changer Device} directive in your Device resource (see above)
380 so that the generic SCSI device name can be edited into the command (with the
383 An example of the use of this command to print Tape Alerts in the Job report
388 Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
393 and an example output when there is a problem could be:
397 bacula-sd Alert: TapeAlert[32]: Interface: Problem with SCSI interface
398 between tape drive and initiator.
403 \item [Drive Index = {\it number} ]
404 \index[sd]{Drive Index }
405 The {\bf Drive Index} that you specify is passed to the {\bf mtx-changer}
406 script and is thus passed to the {\bf mtx} program. By default, the Drive
407 Index is zero, so if you have only one drive in your autochanger, everything
408 will work normally. However, if you have multiple drives, you may specify two
409 Bacula Device resources. The first will either set Drive Index to zero, or
410 leave it unspecified, and the second Device Resource should contain a Drive
411 Index set to 1. This will then permit you to use two or more drives in your
412 autochanger. However, you must ensure that Bacula does not request the same
413 Volume on both drives at the same time. You may also need to modify the
414 mtx-changer script to do locking so that two jobs don't attempt to use the
415 autochanger at the same time. An example script can be found in {\bf
416 examples/autochangers/locking-mtx-changer}.
418 \item [Maximum Changer Wait = {\it time} ]
419 \index[sd]{Maximum Changer Wait }
420 This directive specifies the maximum time for Bacula to wait for an
421 autochanger to change the volume. If this time is exceeded, Bacula will
422 invalidate the Volume slot number stored in the catalog and try again. If no
423 additional changer volumes exist, Bacula will ask the operator to intervene.
424 The default time out is 5 minutes.
426 \item [Always Open = {\it Yes|No} ]
427 \index[sd]{Always Open }
428 If {\bf Yes} (default), Bacula will always keep the device open unless
429 specifically {\bf unmounted} by the Console program. This permits Bacula to
430 ensure that the tape drive is always available. If you set {\bf AlwaysOpen}
431 to {\bf no} {\bf Bacula} will only open the drive when necessary, and at the
432 end of the Job if no other Jobs are using the drive, it will be freed. To
433 minimize unnecessary operator intervention, it is highly recommended that
434 {\bf Always Open = yes}. This also ensures that the drive is available when
437 If you have {\bf Always Open = yes} (recommended) and you want to use the
438 drive for something else, simply use the {\bf unmount} command in the Console
439 program to release the drive. However, don't forget to remount the drive with
440 {\bf mount} when the drive is available or the next Bacula job will block.
442 For File storage, this directive is ignored. For a FIFO storage device, you
443 must set this to {\bf No}.
445 Please note that if you set this directive to {\bf No} Bacula will release
446 the tape drive between each job, and thus the next job will rewind the tape
447 and position it to the end of the data. This can be a very time consuming
450 \item [Volume Poll Interval = {\it time} ]
451 \index[sd]{Volume Poll Interval }
452 If a non-zero time interval is specified, Bacula will poll the device after
453 asking the operator to mount a new volume to see if the new volume has been
454 mounted. If the time interval is zero (the default), no polling will occur.
455 This directive can be useful if you want to avoid operator intervention via
456 the console. The operator can simply remove the old volume and insert the
457 requested one, and Bacula will continue. Please be aware that if you set this
458 interval to small, you may excessively wear your tape drive if the old tape
459 remains in the drive since Bacula will read it on each poll. This could be
460 avoided by using the {\bf Offline On Unmount} and the {\bf Close on Poll}
463 \item [Close on Poll= {\it Yes|No} ]
464 \index[console]{Close on Poll }
465 If {\bf Yes}, Bacula close the device (equivalent to an unmount except no
466 mount is required) and reopen it at each poll. Normally this is not too
467 useful unless you have the {\bf Offline on Unmount} directive set, in which
468 case the drive will be taken offline preventing wear on the tape during any
469 future polling. Once the operator inserts a new tape, Bacula will recognize
470 the drive on the next poll and automatically continue with the backup.
472 \item [Maximum Open Wait = {\it time} ]
473 \index[console]{Maximum Open Wait }
474 This directive specifies the maximum amount of time that Bacula will wait for
475 a device that is busy. The default is 5 minutes. If the device cannot be
476 obtained, the current Job will be terminated in error. Bacula will re-attempt
477 to open the drive the next time a Job starts that needs the the drive.
479 \item [Removable media = {\it Yes|No} ]
480 \index[console]{Removable media }
481 If {\bf Yes}, this device supports removable media (for example, tapes or
482 CDs). If {\bf No}, media cannot be removed (for example, an intermediate
483 backup area on a hard disk).
485 \item [Random access = {\it Yes|No} ]
486 \index[console]{Random access }
487 If {\bf Yes}, the archive device is assumed to be a random access medium
488 which supports the {\bf lseek} (or {\bf lseek64} if Largefile is enabled
489 during configuration) facility.
491 \item [Minimum block size = {\it size-in-bytes} ]
492 \index[console]{Minimum block size }
493 On most modern tape drives, you will not need to specify this directive, and
494 if you do so, it will be to make Bacula use fixed block sizes. This
495 statement applies only to non-random access devices (e.g. tape drives).
496 Blocks written by the storage daemon to a non-random archive device will
497 never be smaller than the given {\bf size-in-bytes}. The Storage daemon will
498 attempt to efficiently fill blocks with data received from active sessions
499 but will, if necessary, add padding to a block to achieve the required
502 To force the block size to be fixed, as is the case for some non-random
503 access devices (tape drives), set the {\bf Minimum block size} and the {\bf
504 Maximum block size} to the same value (zero included). The default is that
505 both the minimum and maximum block size are zero and the default block size
506 is 64,512 bytes. If you wish the block size to be fixed and different from
507 the default, specify the same value for both {\bf Minimum block size} and
508 {\bf Maximum block size}.
510 For example, suppose you want a fixed block size of 100K bytes, then you
516 Minimum block size = 100K
517 Maximum block size = 100K
522 Please note that if you specify a fixed block size as shown above, the tape
523 drive must either be in variable block size mode, or if it is in fixed block
524 size mode, the block size (generally defined by {\bf mt}) {\bf must} be
525 identical to the size specified in Bacula -- otherwise when you attempt to
526 re-read your Volumes, you will get an error.
528 If you want the block size to be variable but with a 64K minimum and 200K
529 maximum (and default as well), you would specify:
534 Minimum block size = 64K
535 Maximum blocksize = 200K
540 \item [Maximum block size = {\it size-in-bytes} ]
541 \index[sd]{Maximum block size }
542 On most modern tape drives, you will not need to specify this directive. If
543 you do so, it will most likely be to use fixed block sizes (see Minimum block
544 size above). The Storage daemon will aways attempt to write blocks of the
545 specified {\bf size-in-bytes} to the archive device. As a consequence, this
546 statement specifies both the default block size and the maximum block size.
547 The size written never exceed the given {\bf size-in-bytes}. If adding data
548 to a block would cause it to exceed the given maximum size, the block will be
549 written to the archive device, and the new data will begin a new block.
551 If no value is specified or zero is specified, the Storage daemon will use a
552 default block size of 64,512 bytes (126 * 512).
554 \item [Hardware End of Medium = {\it Yes|No} ]
555 \index[sd]{Hardware End of Medium }
556 If {\bf No}, the archive device is not required to support end of medium
557 ioctl request, and the storage daemon will use the forward space file
558 function to find the end of the recorded data. If {\bf Yes}, the archive
559 device must support the {\tt ioctl} {\tt MTEOM} call, which will position the
560 tape to the end of the recorded data. In addition, your SCSI driver must keep
561 track of the file number on the tape and report it back correctly by the
562 {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly forward space to
563 the end of the recorded data, but they do not keep track of the file number.
564 On Linux machines, the SCSI driver has a {\bf fast-eod} option, which if set
565 will cause the driver to lose track of the file number. You should ensure
566 that this option is always turned off using the {\bf mt} program.
568 Default setting for Hardware End of Medium is {\bf Yes}. This function is
569 used before appending to a tape to ensure that no previously written data is
570 lost. We recommend if you have a non standard or unusual tape drive that you
571 use the {\bf btape} program to test your drive to see whether or not it
572 supports this function. All modern (after 1998) tape drives support this
575 If you set Hardware End of Medium = no, you should also set {\bf Fast Forward
576 Space File = no}. If you do not, Bacula will most likely be unable to
577 correctly find the end of data on the tape.
579 \item [Fast Forward Space File = {\it Yes|No} ]
580 \index[fd]{Fast Forward Space File }
581 If {\bf No}, the archive device is not required to support keeping track of
582 the file number ({\bf MTIOCGET} ioctl) during forward space file. If {\bf
583 Yes}, the archive device must support the {\tt ioctl} {\tt MTFSF} call, which
584 virtually all drivers support, but in addition, your SCSI driver must keep
585 track of the file number on the tape and report it back correctly by the
586 {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly forward space,
587 but they do not keep track of the file number or more seriously, they do not
588 report end of meduim.
590 Default setting for Fast Forward Space File is {\bf Yes}. If you disable
591 Hardware End of Medium, most likely you should also disable Fast Forward
592 Space file. The {\bf test} command in the program {\bf btape} will test this
593 feature and advise you if it should be turned off.
595 \item [BSF at EOM = {\it Yes|No} ]
596 \index[fd]{BSF at EOM }
597 If {\bf No}, the default, no special action is taken by Bacula with the End
598 of Medium (end of tape) is reached because the tape will be positioned after
599 the last EOF tape mark, and Bacula can append to the tape as desired.
600 However, on some systems, such as FreeBSD, when Bacula reads the End of
601 Medium (end of tape), the tape will be positioned after the second EOF tape
602 mark (two successive EOF marks indicated End of Medium). If Bacula appends
603 from that point, all the appended data will be lost. The solution for such
604 systems is to specify {\bf BSF at EOM} which causes Bacula to backspace over
605 the second EOF mark. Determination of whether or not you need this directive
606 is done using the {\bf test} command in the {\bf btape} program.
608 \item [TWO EOF = {\it Yes|No} ]
610 If {\bf Yes}, Bacula will write two end of file marks when terminating a tape
611 -- i.e. after the last job or at the end of the medium. If {\bf No}, the
612 default, Bacula will only write one end of file to terminate the tape.
614 \item [Backward Space Record = {\it Yes|No} ]
615 \index[fd]{Backward Space Record }
616 If {\it Yes}, the archive device supports the {\tt MTBSR ioctl} to backspace
617 records. If {\it No}, this call is not used and the device must be rewound
618 and advanced forward to the desired position. Default is {\bf Yes} for non
619 random-access devices.
621 \item [Backward Space File = {\it Yes|No} ]
622 \index[fd]{Backward Space File }
623 If {\it Yes}, the archive device supports the {\bf MTBSF} and {\bf MTBSF
624 ioctl}s to backspace over an end of file mark and to the start of a file. If
625 {\it No}, these calls are not used and the device must be rewound and
626 advanced forward to the desired position. Default is {\bf Yes} for non
627 random-access devices.
629 \item [Forward Space Record = {\it Yes|No} ]
630 \index[fd]{Forward Space Record }
631 If {\it Yes}, the archive device must support the {\bf MTFSR ioctl} to
632 forward space over records. If {\bf No}, data must be read in order to
633 advance the position on the device. Default is {\bf Yes} for non
634 random-access devices.
636 \item [Forward Space File = {\it Yes|No} ]
637 \index[fd]{Forward Space File }
638 If {\bf Yes}, the archive device must support the {\tt MTFSF ioctl} to
639 forward space by file marks. If {\it No}, data must be read to advance the
640 position on the device. Default is {\bf Yes} for non random-access devices.
642 \item [Offline On Unmount = {\it Yes|No} ]
643 \index[fd]{Offline On Unmount }
644 The default for this directive is {\bf No}. If {\bf Yes} the archive device
645 must support the {\tt MTOFFL ioctl} to rewind and take the volume offline. In
646 this case, Bacula will issue the offline (eject) request before closing the
647 device during the {\bf unmount} command. If {\bf No} Bacula will not attempt
648 to offline the device before unmounting it. After an offline is issued, the
649 cassette will be ejected thus {\bf requiring operator intervention} to
650 continue, and on some systems require an explicit load command to be issued
651 ({\bf mt -f /dev/xxx load}) before the system will recognize the tape. If you
652 are using an autochanger, some devices require an offline to be issued prior
653 to changing the volume. However, most devices do not and may get very
656 \item [Maximum Volume Size = {\it size} ]
657 \index[fd]{Maximum Volume Size }
658 No more than {\bf size} bytes will be written onto a given volume on the
659 archive device. This directive is used mainly in testing Bacula to simulate a
660 small Volume. It can also be useful if you wish to limit the size of a File
661 Volume to say less than 2GB of data. In some rare cases of really antiquated
662 tape drives that do not properly indicate when the end of a tape is reached
663 during writing (though I have read about such drives, I have never personally
664 encountered one). Please note, this directive is deprecated (being phased
665 out) in favor of the {\bf Maximum Volume Bytes} defined in the Director's
668 \item [Maximum File Size = {\it size} ]
669 \index[fd]{Maximum File Size }
670 No more than {\bf size} bytes will be written into a given logical file on
671 the volume. Once this size is reached, an end of file mark is written on the
672 volume and subsequent data are written into the next file. Breaking long
673 sequences of data blocks with file marks permits quicker positioning to the
674 start of a given stream of data and can improve recovery from read errors on
675 the volume. The default is one Gigabyte.
677 \item [Block Positioning = {\it yes|no} ]
678 \index[fd]{Block Positioning }
679 This directive is not normally used (and has not yet been tested). It will
680 tell Bacula not to use block positioning when it is reading tapes. This can
681 cause Bacula to be {\bf extremely} slow when restoring files. You might use
682 this directive if you wrote your tapes with Bacula in variable block mode
683 (the default), but your drive was in fixed block mode. If it then works as I
684 hope, Bacula will be able to re-read your tapes.
686 \item [Maximum Network Buffer Size = {\it bytes} ]
687 \index[fd]{Maximum Network Buffer Size }
688 where {\it bytes} specifies the initial network buffer size to use with the
689 File daemon. This size will be adjusted down if it is too large until it is
690 accepted by the OS. Please use care in setting this value since if it is too
691 large, it will be trimmed by 512 bytes until the OS is happy, which may
692 require a large number of system calls. The default value is 32,768 bytes.
694 \item [Maximum Spool Size = {\it bytes} ]
695 \index[fd]{Maximum Spool Size }
696 where the bytes specify the maximum spool size for all jobs that are running.
697 The default is no limit.
699 \item [Maximum Job Spool Size = {\it bytes} ]
700 \index[fd]{Maximum Job Spool Size }
701 where the bytes specify the maximum spool size for any one job that is
702 running. The default is no limit.
704 \item [Spool Directory = {\it directory} ]
705 \index[dir]{Spool Directory }
706 specifies the name of the directory to be used to store the spool files for
707 this device. This directory is also used to store temporary part files when
708 writing to a device that requires mount (DVD). The default is to use the
711 \item [Maximum Part Size = {\it bytes} ]
712 \index[dir]{Maximum Part Size }
713 This is the maximum size of a volume part file. The default is no limit.
715 If the device requires mount, it is transfered to the device when this size
716 is reached. In this case, you must take care to have enough disk space left
717 in the spool directory.
719 Otherwise, it is left on the hard disk.
721 It is ignored for tape and FIFO devices.
724 \subsection*{Devices that requires mount (DVD)}
725 \index[general]{Devices that requires mount (DVD) }
726 \index[general]{DVD!Devices that requires mount }
727 \addcontentsline{toc}{subsection}{Devices that requires mount (DVD)}
731 \item [Requires Mount = {\it Yes|No} ]
732 \index[dir]{Requires Mount }
733 You must set this directive to {\bf yes} for DVD-writers, and to {\bf no} for
734 all other devices (tapes/files). This directive indicates if the device
735 require to be mounted to be read, and if it must be written in a special way.
736 If it set, {\bf Mount Point}, {\bf Mount Command}, {\bf Unmount Command} and
737 {\bf Write Part Command} directives must be defined.
739 \item [Mount Point = {\it directory} ]
740 \index[dir]{Mount Point }
741 Directory where the device must be mounted.
743 \item [Mount Command = {\it name-string} ]
744 \index[dir]{Mount Command }
745 Command that must be executed to mount the device. Before the command is
746 executed, \%a is replaced with the Archive Device, and \%m with the Mount
749 Most frequently, you will define it as follows:
753 Mount Command = "/bin/mount -t iso9660 -o ro %a %m"
758 \item [Unmount Command = {\it name-string} ]
759 \index[dir]{Unmount Command }
760 Command that must be executed to unmount the device. Before the command is
761 executed, \%a is replaced with the Archive Device, and \%m with the Mount
764 Most frequently, you will define it as follows:
768 Unmount Command = "/bin/umount %m"
773 \item [Write Part Command = {\it name-string} ]
774 \index[dir]{Write Part Command }
775 Command that must be executed to write a part to the device. Before the
776 command is executed, \%a is replaced with the Archive Device, \%m with the
777 Mount Point, \%n with the current part number (0-based), and \%v with the
778 current part filename.
780 For DVD, you will most frequently specify the Bacula supplied {\bf
781 dvd-writepart} script as follows:
785 Write Part Command = "/path/dvd-writepart %n %a %v"
790 \item [Free Space Command = {\it name-string} ]
791 \index[dir]{Free Space Command }
792 Command that must be executed to check how much free space is left on the
793 device. Before the command is executed, \%a is replaced with the Archive
794 Device, \%m with the Mount Point, \%n with the current part number (0-based),
795 and \%v with the current part filename.
797 For DVD, you will most frequently specify the Bacula supplied {\bf
798 dvd-freespace} script as follows:
802 Free Space Command = "/path/dvd-freespace %n %a"
807 If you want to specify your own command, please look at the code of
808 dvd-freespace to see what output Bacula expects from this command.
810 If you do not set it, Bacula will expect there is always free space on the
815 \subsection*{Parallelism}
816 \index[general]{Parallelism }
817 \addcontentsline{toc}{subsection}{Parallelism}
821 \item [Maximum Concurrent Jobs = {\it positive integer} ]
822 \index[dir]{Maximum Concurrent Jobs }
823 The storage daemon will accept no more than the given {\bf positive integer}
824 of simultaneous connections. The default is 10. It is best to set this number
825 fairly large (e.g. 10 or 20) and control how many Jobs are running with the
826 {\bf Maximum Concurrent Jobs} in the Storage resource in the Director's
831 \subsection*{Capabilities}
832 \index[general]{Capabilities }
833 \addcontentsline{toc}{subsection}{Capabilities}
837 \item [Label media = {\it Yes|No} ]
838 \index[sd]{Label media }
839 If {\bf Yes}, permits this device to automatically label blank media without
840 an explicit operator command. It does so by using an internal algorithm as
842 \ilink{Label Format }{Label} record in each Pool resource. If
843 this is {\bf No} as by default, Bacula will label tapes only by specific
844 operator command ({\bf label} in the Console) or when the tape has been
845 recycled. The automatic labeling feature is most useful when writing to disk
846 rather than tape volumes.
848 \item [Automatic mount = {\it Yes|No} ]
849 \index[sd]{Automatic mount }
850 If {\bf Yes} (the default), permits the daemon to examine the device to
851 determine if it contains a Bacula labeled volume. This is done initially when
852 the daemon is started, and then at the beginning of each job. This directive
853 is particularly important if you have set {\bf Always Open = no} because it
854 permits Bacula to attempt to read the device before asking the system
855 operator to mount a tape.
859 \subsection*{Messages Resource}
860 \label{MessagesResource1}
861 \index[general]{Resource!Messages }
862 \index[general]{Messages Resource }
863 \addcontentsline{toc}{subsection}{Messages Resource}
865 For a description of the Messages Resource, please see the
866 \ilink{Messages Resource}{_ChapterStart15} Chapter of this
869 \subsection*{Sample Storage Daemon Configuration File}
870 \label{SampleConfiguration}
871 \index[general]{File!Sample Storage Daemon Configuration }
872 \index[general]{Sample Storage Daemon Configuration File }
873 \addcontentsline{toc}{subsection}{Sample Storage Daemon Configuration File}
875 A example Storage Daemon configuration file might be the following:
880 # Default Bacula Storage Daemon Configuration file
882 # For Bacula release 1.35.2 (16 August 2004) -- gentoo 1.4.16
884 # You may need to change the name of your tape drive
885 # on the "Archive Device" directive in the Device
886 # resource. If you change the Name and/or the
887 # "Media Type" in the Device resource, please ensure
888 # that bacula-dir.conf has corresponding changes.
890 Storage { # definition of myself
893 WorkingDirectory = "$HOME/bacula/bin/working"
894 Pid Directory = "$HOME/bacula/bin/working"
895 Maximum Concurrent Jobs = 1
898 # List Directors who are permitted to contact Storage daemon
902 Password = "ZF9Ctf5PQoWCPkmR3s4atCB0usUPg+vWWyIo2VS5ti6k"
905 # Restricted Director, used by tray-monitor to get the
906 # status of the storage daemon
910 Password = "9usxgc307dMbe7jbD16v0PXlhD64UVasIDD0DH2WAujcDsc6"
914 # Devices supported by this Storage daemon
915 # To connect, the Director's bacula-dir.conf must have the
916 # same Name and MediaType.
921 Archive Device = /dev/nst0
922 AutomaticMount = yes; # when device opened, read it
924 RemovableMedia = yes;
929 # Archive Device = /dev/nst0
930 # AutomaticMount = yes; # when device opened, read it
932 # RemovableMedia = yes;
936 # Media Type = Floppy
937 # Archive Device = /mnt/floppy
938 # RemovableMedia = yes;
939 # Random Access = Yes;
940 # AutomaticMount = yes; # when device opened, read it
946 # Archive Device = /tmp
947 # LabelMedia = yes; # lets Bacula label unlabeled media
948 # Random Access = Yes;
949 # AutomaticMount = yes; # when device opened, read it
950 # RemovableMedia = no;
954 # Name = "NEC ND-1300A"
956 # Archive Device = /dev/hda
957 # LabelMedia = yes; # lets Bacula label unlabeled media
958 # Random Access = Yes;
959 # AutomaticMount = yes; # when device opened, read it
960 # RemovableMedia = yes;
962 # MaximumPartSize = 800M;
963 # RequiresMount = yes;
964 # MountPoint = /mnt/cdrom;
965 # MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
966 # UnmountCommand = "/bin/umount %m";
967 # SpoolDirectory = /tmp/backup;
968 # WritePartCommand = "/etc/bacula/dvd-writepart %n %a %v"
969 # FreeSpaceCommand = "/etc/bacula/dvd-freespace %a %n"
972 # A very old Exabyte with no end of media detection
975 # Name = "Exabyte 8mm"
977 # Archive Device = /dev/nst0
978 # Hardware end of medium = No;
979 # AutomaticMount = yes; # when device opened, read it
981 # RemovableMedia = yes;
984 # Send all messages to the Director,
985 # mount messages also are sent to the email address
989 director = rufus-dir = all
990 operator = root = mount