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 \index[sd]{Directive!Name}
62 Specifies the Name of the Storage daemon. This directive is required.
64 \item [Working Directory = \lt{}Directory\gt{}]
65 \index[sd]{Working Directory}
66 \index[sd]{Directive!Working Directory}
67 This directive is mandatory and specifies a directory in which the Storage
68 daemon may put its status files. This directory should be used only by {\bf
69 Bacula}, but may be shared by other Bacula daemons provided the names
70 given to each daemon are unique. This directive is
73 \item [Pid Directory = \lt{}Directory\gt{}]
74 \index[sd]{Pid Directory}
75 \index[sd]{Directive!Pid Directory}
76 This directive is mandatory and specifies a directory in which the Director
77 may put its process Id file files. The process Id file is used to shutdown
78 Bacula and to prevent multiple copies of Bacula from running simultaneously.
79 This directive is required. Standard shell expansion of the {\bf Directory}
80 is done when the configuration file is read so that values such as {\bf
81 \$HOME} will be properly expanded.
83 Typically on Linux systems, you will set this to: {\bf /var/run}. If you are
84 not installing Bacula in the system directories, you can use the {\bf Working
85 Directory} as defined above.
87 \item [Heartbeat Interval = \lt{}time-interval\gt{}]
88 \index[sd]{Heartbeat Interval}
89 \index[sd]{Directive!Heartbeat Interval}
90 \index[general]{Heartbeat Interval}
91 \index[general]{Broken pipe}
92 This directive defines an interval of time. When the Storage daemon is
93 waiting for the operator to mount a tape, each time interval, it will
94 send a heartbeat signal to the File daemon. The default interval is
95 zero which disables the heartbeat. This feature is particularly useful
96 if you have a router such as 3Com that does not follow Internet
97 standards and times out an valid connection after a short duration
98 despite the fact that keepalive is set. This usually results
99 in a broken pipe error message.
101 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
102 \index[sd]{Maximum Concurrent Jobs}
103 \index[sd]{Directive!Maximum Concurrent Jobs}
104 where \lt{}number\gt{} is the maximum number of Jobs that should run
105 concurrently. The default is set to 10, but you may set it to a larger
106 number. Each contact from the Director (e.g. status request, job start
107 request) is considered as a Job, so if you want to be able to do a {\bf
108 status} request in the console at the same time as a Job is running, you
109 will need to set this value greater than 1. To run simultaneous Jobs,
110 you will need to set a number of other directives in the Director's
111 configuration file. Which ones you set depend on what you want, but you
112 will almost certainly need to set the {\bf Maximum Concurrent Jobs} in
113 the Storage resource in the Director's configuration file and possibly
114 those in the Job and Client resources.
116 \item [SDAddresses = \lt{}IP-address-specification\gt{}]
117 \index[sd]{SDAddresses}
118 \index[sd]{Directive!SDAddresses}
119 Specify the ports and addresses on which the Storage daemon will listen
120 for Director connections. Normally, the default is sufficient and you
121 do not need to specify this directive. Probably the simplest way to
122 explain how this directive works is to show an example:
126 SDAddresses = { ip = {
127 addr = 1.2.3.4; port = 1205; }
129 addr = 1.2.3.4; port = http; }
142 addr = 201:220:222::2
145 addr = bluedot.thun.net
151 where ip, ip4, ip6, addr, and port are all keywords. Note, that the address
152 can be specified as either a dotted quadruple, or IPv6 colon notation, or as
153 a symbolic name (only in the ip specification). Also, port can be specified
154 as a number or as the mnemonic value from the /etc/services file. If a port
155 is not specified, the default will be used. If an ip section is specified,
156 the resolution can be made either by IPv4 or IPv6. If ip4 is specified, then
157 only IPv4 resolutions will be permitted, and likewise with ip6.
159 Using this directive, you can replace both the SDPort and SDAddress
160 directives shown below.
162 \item [SDPort = \lt{}port-number\gt{}]
164 \index[sd]{Directive!SDPort}
165 Specifies port number on which the Storage daemon listens for Director
166 connections. The default is 9103.
168 \item [SDAddress = \lt{}IP-Address\gt{}]
169 \index[sd]{SDAddress}
170 \index[sd]{Directive!SDAddress}
171 This directive is optional, and if it is specified, it will cause the
172 Storage daemon server (for Director and File daemon connections) to bind
173 to the specified {\bf IP-Address}, which is either a domain name or an
174 IP address specified as a dotted quadruple. If this directive is not
175 specified, the Storage daemon will bind to any available address (the
180 The following is a typical Storage daemon Storage definition.
185 # "Global" Storage daemon configuration specifications appear
186 # under the Storage resource.
189 Name = "Storage daemon"
191 WorkingDirectory = "~/bacula/working"
192 Pid Directory = "~/bacula/working"
197 \subsection*{Director Resource}
198 \label{DirectorResource1}
199 \index[general]{Director Resource}
200 \index[general]{Resource!Director}
201 \addcontentsline{toc}{subsection}{Director Resource}
203 The Director resource specifies the Name of the Director which is permitted
204 to use the services of the Storage daemon. There may be multiple Director
205 resources. The Director Name and Password must match the corresponding
206 values in the Director's configuration file.
210 \item [Name = \lt{}Director-Name\gt{}]
212 \index[sd]{Directive!Name}
213 Specifies the Name of the Director allowed to connect to the Storage daemon.
214 This directive is required.
216 \item [Password = \lt{}Director-password\gt{}]
218 \index[sd]{Directive!Password}
219 Specifies the password that must be supplied by the above named Director.
220 This directive is required.
222 \item [Monitor = \lt{}yes|no\gt{}]
224 \index[sd]{Directive!Monitor}
225 If Monitor is set to {\bf no} (default), this director will have full
226 access to this Storage daemon. If Monitor is set to {\bf yes}, this
227 director will only be able to fetch the current status of this Storage
230 Please note that if this director is being used by a Monitor, we highly
231 recommend to set this directive to {\bf yes} to avoid serious security
236 The following is an example of a valid Director resource definition:
242 Password = my_secret_password
247 \label{DeviceResource}
248 \subsection*{Device Resource}
249 \index[general]{Resource!Device}
250 \index[general]{Device Resource}
251 \addcontentsline{toc}{subsection}{Device Resource}
253 The Device Resource specifies the details of each device (normally a tape
254 drive) that can be used by the Storage daemon. There may be multiple
255 Device resources for a single Storage daemon. In general, the properties
256 specified within the Device resource are specific to the Device.
260 \item [Name = {\it Device-Name}]
262 \index[sd]{Directive!Name}
263 Specifies the Name that the Director will use when asking to backup or
264 restore to or from to this device. This is the logical Device name, and may
265 be any string up to 127 characters in length. It is generally a good idea to
266 make it correspond to the English name of the backup device. The physical
267 name of the device is specified on the {\bf Archive Device} directive
268 described below. The name you specify here is also used in your Director's
270 \ilink{Device directive}{StorageResource2} in its Storage
273 \item [Archive Device = {\it name-string}]
274 \index[sd]{Archive Device}
275 \index[sd]{Directive!Archive Device}
276 The specified {\bf name-string} gives the system file name of the storage
277 device managed by this storage daemon. This will usually be the device file
278 name of a removable storage device (tape drive), for example "{\bf
279 /dev/nst0}" or "{\bf /dev/rmt/0mbn}". For a DVD-writer, it will be for
280 example {\bf /dev/hdc}. It may also be a directory name if you are archiving
281 to disk storage. In this case, you must supply the full absolute path to the
282 directory. When specifying a tape device, it is preferable that the
283 "non-rewind" variant of the device file name be given. In addition, on
284 systems such as Sun, which have multiple tape access methods, you must be
285 sure to specify to use Berkeley I/O conventions with the device. The {\bf b}
286 in the Solaris (Sun) archive specification {\bf /dev/rmt/0mbn} is what is
287 needed in this case. Bacula does not support SysV tape drive behavior.
289 As noted above, normally the Archive Device is the name of a tape drive, but
290 you may also specify an absolute path to an existing directory. If the Device
291 is a directory Bacula will write to file storage in the specified directory,
292 and the filename used will be the Volume name as specified in the Catalog.
293 If you want to write into more than one directory (i.e. to spread the load to
294 different disk drives), you will need to define two Device resources, each
295 containing an Archive Device with a different directory.
297 In addition to a tape device name or a directory name, Bacula will accept the
298 name of a FIFO. A FIFO is a special kind of file that connects two programs
299 via kernel memory. If a FIFO device is specified for a backup operation, you
300 must have a program that reads what Bacula writes into the FIFO. When the
301 Storage daemon starts the job, it will wait for {\bf MaximumOpenWait} seconds
302 for the read program to start reading, and then time it out and terminate
303 the job. As a consequence, it is best to start the read program at the
304 beginning of the job perhaps with the {\bf RunBeforeJob} directive. For this
305 kind of device, you never want to specify {\bf AlwaysOpen}, because you want
306 the Storage daemon to open it only when a job starts, so you must explicitly
307 set it to {\bf No}. Since a FIFO is a one way device, Bacula will not attempt
308 to read a label of a FIFO device, but will simply write on it. To create a
309 FIFO Volume in the catalog, use the {\bf add} command rather than then {\bf
310 label} command to avoid attempting to write a label.
312 During a restore operation, if the Archive Device is a FIFO, Bacula will
313 attempt to read from the FIFO, so you must have an external program that
314 writes into the FIFO. Bacula will wait {\bf MaximumOpenWait} seconds for the
315 program to begin writing and will then time it out and terminate the job. As
316 noted above, you may use the {\bf RunBeforeJob} to start the writer program
317 at the beginning of the job.
319 The Archive Device directive is required.
321 \item [Device Type = {\it type-specification}]
322 \index[sd]{Device Type}
323 \index[sd]{Directive!Device Type}
324 The Device Type specification allows you to explicitly tell Bacula
325 what kind of device you are defining. It the {\it type-specification}
326 may be one of the following:
329 Tells Bacula that the device is a file. It may either be a
330 file defined on fixed medium or a removable filesystem such as
331 USB. All files must be random access devices.
333 The device is a tape device and thus is sequential access. Tape devices
334 are controlled using ioctl() calls.
336 The device is a first-in-first out sequential access read-only
337 or write-only device.
339 The device is a DVD. DVDs are sequential access for writing, but
340 random access for reading.
343 The Device Type directive is not required, and if not specified, Bacula
344 will attempt to guess what kind of device has been specified using the
345 Archive Device specification supplied. There are several advantages to
346 explicitly specifying the Device Type. First, on some systems, block and
347 character devices have the same type, which means that on those systems,
348 Bacula is unlikely to be able to correctly guess that a device is a DVD.
349 Secondly, if you explicitly specify the Device Type, the mount point
350 need not be defined until the device is opened. This is the case with
351 most removable devices such as USB that are mounted by the HAL daemon.
352 If the Device Type is not explicitly specified, then the mount point
353 must exist when the Storage daemon starts.
355 This directive was implemented in Bacula version 1.39.5.
358 \item [Media Type = {\it name-string}]
359 \index[sd]{Media Type}
360 \index[sd]{Directive!Media Type}
361 The specified {\bf name-string} names the type of media supported by this
362 device, for example, "DLT7000". Media type names are arbitrary in that you
363 set them to anything you want, but they must be known to the volume
364 database to keep track of which storage daemons can read which volumes. In
365 general, each different storage type should have a unique Media Type
366 associated with it. The same {\bf name-string} must appear in the
367 appropriate Storage resource definition in the Director's configuration
370 Even though the names you assign are arbitrary (i.e. you choose the name
371 you want), you should take care in specifying them because the Media Type
372 is used to determine which storage device Bacula will select during
373 restore. Thus you should probably use the same Media Type specification
374 for all drives where the Media can be freely interchanged. This is not
375 generally an issue if you have a single Storage daemon, but it is with
376 multiple Storage daemons, especially if they have incompatible media.
378 For example, if you specify a Media Type of "DDS-4" then during the
379 restore, Bacula will be able to choose any Storage Daemon that handles
380 "DDS-4". If you have an autochanger, you might want to name the Media Type
381 in a way that is unique to the autochanger, unless you wish to possibly use
382 the Volumes in other drives. You should also ensure to have unique Media
383 Type names if the Media is not compatible between drives. This
384 specification is required for all devices.
386 In addition, if you are using disk storage, each Device resource will
387 generally have a different mount point or directory. In order for
388 Bacula to select the correct Device resource, each one must have a
392 \item [Autochanger = {\it Yes|No}]
393 \index[sd]{Autochanger}
394 \index[sd]{Directive!Autochanger}
395 If {\bf Yes}, this device belongs to an automatic tape changer, and you should also
396 specify a {\bf Changer Device} as well as a {\bf Changer Command}. If {\bf
397 No} (default), the volume must be manually changed. You should also
398 have an identical directive to the
399 \ilink{Storage resource}{Autochanger1} in the Director's
400 configuration file so that when labeling tapes you are prompted for the slot.
402 \item [Changer Device = {\it name-string}]
403 \index[sd]{Changer Device}
404 \index[sd]{Directive!Changer Device}
405 The specified {\bf name-string} must be the {\bf generic SCSI} device
406 name of the autochanger that corresponds to the normal read/write
407 {\bf Archive Device} specified in the Device resource. This
408 gemeric SCSI device name should be specified if you have an autochanger
409 or if you have a standard tape drive and want to use the
410 {\bf Alert Command} (see below). For example, on Linux systems, for
411 an Archive Device name of {\bf /dev/nst0}, you would specify {\bf
412 /dev/sg0} for the Changer Device name. Depending on your exact
413 configuration, and the number of autochangers or the type of
414 autochanger, what you specify here can vary. This directive is
415 optional. See the \ilink{ Using Autochangers}{_ChapterStart18} chapter
416 of this manual for more details of using this and the following
417 autochanger directives.
419 \item [Changer Command = {\it name-string}]
420 \index[sd]{Changer Command}
421 \index[sd]{Directive!Changer Command}
422 The {\bf name-string} specifies an external program to be called that will
423 automatically change volumes as required by {\bf Bacula}. Most frequently,
424 you will specify the Bacula supplied {\bf mtx-changer} script as follows:
428 Changer Command = "/path/mtx-changer %c %o %S %a %d"
432 and you will install the {\bf mtx} on your system (found in the {\bf depkgs}
433 release). An example of this command is in the default bacula-sd.conf file.
434 For more details on the substitution characters that may be specified to
435 configure your autochanger please see the
436 \ilink{Autochangers}{_ChapterStart18} chapter of this manual.
437 For FreeBSD users, you might want to see one of the several {\bf chio}
438 scripts in {\bf examples/autochangers}.
440 \item [Alert Command = {\it name-string}]
441 \index[sd]{Alert Command}
442 The {\bf name-string} specifies an external program to be called at the
443 \index[sd]{Directive!Changer Command}
444 completion of each Job after the device is released. The purpose of this
445 command is to check for Tape Alerts, which are present when something is
446 wrong with your tape drive (at least for most modern tape drives). The same
447 substitution characters that may be specified in the Changer Command may also
448 be used in this string. For more information, please see the
449 \ilink{Autochangers}{_ChapterStart18} chapter of this manual.
452 Note, it is not necessary to have an autochanger to use this command. The
453 example below uses the {\bf tapeinfo} program that comes with the {\bf mtx}
454 package, but it can be used on any tape drive. However, you will need to
455 specify a {\bf Changer Device} directive in your Device resource (see above)
456 so that the generic SCSI device name can be edited into the command (with the
459 An example of the use of this command to print Tape Alerts in the Job report
464 Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
469 and an example output when there is a problem could be:
473 bacula-sd Alert: TapeAlert[32]: Interface: Problem with SCSI interface
474 between tape drive and initiator.
479 \item [Drive Index = {\it number}]
480 \index[sd]{Drive Index}
481 \index[sd]{Directive!Drive Index}
482 The {\bf Drive Index} that you specify is passed to the {\bf mtx-changer}
483 script and is thus passed to the {\bf mtx} program. By default, the Drive
484 Index is zero, so if you have only one drive in your autochanger, everything
485 will work normally. However, if you have multiple drives, you may specify two
486 Bacula Device resources. The first will either set Drive Index to zero, or
487 leave it unspecified, and the second Device Resource should contain a Drive
488 Index set to 1. This will then permit you to use two or more drives in your
489 autochanger. However, you must ensure that Bacula does not request the same
490 Volume on both drives at the same time. You may also need to modify the
491 mtx-changer script to do locking so that two jobs don't attempt to use the
492 autochanger at the same time. An example script can be found in {\bf
493 examples/autochangers/locking-mtx-changer}.
495 \item [Autoselect = {\it Yes|No}]
496 \index[sd]{Autoselect}
497 \index[sd]{Directive!Autoselect}
498 If this directive is set to {\bf yes} (default), and the Device
499 belongs to an autochanger, then when the Autochanger is referenced
500 by the Director, this device can automatically be selected. If this
501 directive is set to {\bf no}, then the Device can only be referenced
502 by directly using the Device name in the Director. This is useful
503 for reserving a drive for something special such as a high priority
504 backup or restore operations.
506 \item [Maximum Changer Wait = {\it time}]
507 \index[sd]{Maximum Changer Wait}
508 \index[sd]{Directive!Maximum Changer Wait}
509 This directive specifies the maximum time in seconds for Bacula to wait
510 for an autochanger to change the volume. If this time is exceeded,
511 Bacula will invalidate the Volume slot number stored in the catalog and
512 try again. If no additional changer volumes exist, Bacula will ask the
513 operator to intervene. The default is 5 minutes.
515 \item [Maximum Rewind Wait = {\it time}]
516 \index[sd]{Maximum Rewind Wait}
517 \index[sd]{Directive!Maximum Rewind Wait}
518 This directive specifies the maximum time in seconds for Bacula to wait
519 for a rewind before timing out. If this time is exceeded,
520 Bacula will cancel the job. The default is 5 minutes.
522 \item [Maximum Open Wait = {\it time}]
523 \index[sd]{Maximum Open Wait}
524 \index[sd]{Directive!Maximum Open Wait}
525 This directive specifies the maximum time in seconds for Bacula to wait
526 for a open before timing out. If this time is exceeded,
527 Bacula will cancel the job. The default is 5 minutes.
529 \item [Always Open = {\it Yes|No}]
530 \index[sd]{Always Open}
531 \index[sd]{Directive!Always Open}
532 If {\bf Yes} (default), Bacula will always keep the device open unless
533 specifically {\bf unmounted} by the Console program. This permits
534 Bacula to ensure that the tape drive is always available. If you set
535 {\bf AlwaysOpen} to {\bf no} {\bf Bacula} will only open the drive when
536 necessary, and at the end of the Job if no other Jobs are using the
537 drive, it will be freed. The next time Bacula wants to append to a tape
538 on a drive that was freed, Bacula must rewind the tape and position to
539 the end. To avoid unnecessary tape positioning and to minimize
540 unnecessary operator intervention, it is highly recommended that {\bf
541 Always Open = yes}. This also ensures that the drive is available when
544 If you have {\bf Always Open = yes} (recommended) and you want to use the
545 drive for something else, simply use the {\bf unmount} command in the Console
546 program to release the drive. However, don't forget to remount the drive with
547 {\bf mount} when the drive is available or the next Bacula job will block.
549 For File storage, this directive is ignored. For a FIFO storage device, you
550 must set this to {\bf No}.
552 Please note that if you set this directive to {\bf No} Bacula will release
553 the tape drive between each job, and thus the next job will rewind the tape
554 and position it to the end of the data. This can be a very time consuming
557 \item [Volume Poll Interval = {\it time}]
558 \index[sd]{Volume Poll Interval}
559 \index[sd]{Directive!Volume Poll Interval}
560 If the time specified on this directive is non-zero, after asking the
561 operator to mount a new volume Bacula will periodically poll (or read) the
562 drive at the specified interval to see if a new volume has been mounted. If
563 the time interval is zero (the default), no polling will occur. This
564 directive can be useful if you want to avoid operator intervention via the
565 console. Instead, the operator can simply remove the old volume and insert
566 the requested one, and Bacula on the next poll will recognize the new tape
567 and continue. Please be aware that if you set this interval too small, you
568 may excessively wear your tape drive if the old tape remains in the drive,
569 since Bacula will read it on each poll. This can be avoided by ejecting the
570 tape using the {\bf Offline On Unmount} and the {\bf Close on Poll}
572 However, if you are using a Linux 2.6 kernel or other OSes
573 such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
574 with no tape, and Bacula will not be able to properly open the drive and
575 may fail the job. For more information on this problem, please see the
576 \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
579 \item [Close on Poll= {\it Yes|No}]
580 \index[sd]{Close on Poll}
581 \index[sd]{Directive!Close on Poll}
582 If {\bf Yes}, Bacula close the device (equivalent to an unmount except no
583 mount is required) and reopen it at each poll. Normally this is not too
584 useful unless you have the {\bf Offline on Unmount} directive set, in which
585 case the drive will be taken offline preventing wear on the tape during any
586 future polling. Once the operator inserts a new tape, Bacula will recognize
587 the drive on the next poll and automatically continue with the backup.
588 Please see above more more details.
590 \item [Maximum Open Wait = {\it time}]
591 \index[sd]{Maximum Open Wait}
592 \index[sd]{Directive!Maximum Open Wait}
593 This directive specifies the maximum amount of time in seconds that
594 Bacula will wait for a device that is busy. The default is 5 minutes.
595 If the device cannot be obtained, the current Job will be terminated in
596 error. Bacula will re-attempt to open the drive the next time a Job
597 starts that needs the the drive.
599 \item [Removable media = {\it Yes|No}]
600 \index[sd]{Removable media}
601 \index[sd]{Directive!Removable media}
602 If {\bf Yes}, this device supports removable media (for example, tapes
603 or CDs). If {\bf No}, media cannot be removed (for example, an
604 intermediate backup area on a hard disk).
606 \item [Random access = {\it Yes|No}]
607 \index[sd]{Random access}
608 \index[sd]{Directive!Random access}
609 If {\bf Yes}, the archive device is assumed to be a random access medium
610 which supports the {\bf lseek} (or {\bf lseek64} if Largefile is enabled
611 during configuration) facility.
613 \item [Minimum block size = {\it size-in-bytes}]
614 \index[sd]{Minimum block size}
615 \index[sd]{Directive!Minimum block size}
616 On most modern tape drives, you will not need or wamt to specify this
617 directive, and if you do so, it will be to make Bacula use fixed block
618 sizes. This statement applies only to non-random access devices (e.g.
619 tape drives). Blocks written by the storage daemon to a non-random
620 archive device will never be smaller than the given {\bf size-in-bytes}.
621 The Storage daemon will attempt to efficiently fill blocks with data
622 received from active sessions but will, if necessary, add padding to a
623 block to achieve the required minimum size.
625 To force the block size to be fixed, as is the case for some non-random
626 access devices (tape drives), set the {\bf Minimum block size} and the
627 {\bf Maximum block size} to the same value (zero included). The default
628 is that both the minimum and maximum block size are zero and the default
629 block size is 64,512 bytes. If you wish the block size to be fixed and
630 different from the default, specify the same value for both {\bf Minimum
631 block size} and {\bf Maximum block size}.
633 For example, suppose you want a fixed block size of 100K bytes, then you
639 Minimum block size = 100K
640 Maximum block size = 100K
645 Please note that if you specify a fixed block size as shown above, the tape
646 drive must either be in variable block size mode, or if it is in fixed block
647 size mode, the block size (generally defined by {\bf mt}) {\bf must} be
648 identical to the size specified in Bacula -- otherwise when you attempt to
649 re-read your Volumes, you will get an error.
651 If you want the block size to be variable but with a 64K minimum and 200K
652 maximum (and default as well), you would specify:
657 Minimum block size = 64K
658 Maximum blocksize = 200K
663 \item [Maximum block size = {\it size-in-bytes}]
664 \index[sd]{Maximum block size}
665 \index[sd]{Directive!Maximum block size}
666 On most modern tape drives, you will not need to specify this directive.
667 If you do so, it will most likely be to use fixed block sizes (see
668 Minimum block size above). The Storage daemon will aways attempt to
669 write blocks of the specified {\bf size-in-bytes} to the archive device.
670 As a consequence, this statement specifies both the default block size
671 and the maximum block size. The size written never exceed the given
672 {\bf size-in-bytes}. If adding data to a block would cause it to exceed
673 the given maximum size, the block will be written to the archive device,
674 and the new data will begin a new block.
676 If no value is specified or zero is specified, the Storage daemon will
677 use a default block size of 64,512 bytes (126 * 512).
679 \item [Hardware End of Medium = {\it Yes|No}]
680 \index[sd]{Hardware End of Medium}
681 \index[sd]{Directive!Hardware End of Medium}
682 If {\bf No}, the archive device is not required to support end of medium
683 ioctl request, and the storage daemon will use the forward space file
684 function to find the end of the recorded data. If {\bf Yes}, the archive
685 device must support the {\tt ioctl} {\tt MTEOM} call, which will position the
686 tape to the end of the recorded data. In addition, your SCSI driver must keep
687 track of the file number on the tape and report it back correctly by the
688 {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly forward space to
689 the end of the recorded data, but they do not keep track of the file number.
690 On Linux machines, the SCSI driver has a {\bf fast-eod} option, which if set
691 will cause the driver to lose track of the file number. You should ensure
692 that this option is always turned off using the {\bf mt} program.
694 Default setting for Hardware End of Medium is {\bf Yes}. This function is
695 used before appending to a tape to ensure that no previously written data is
696 lost. We recommend if you have a non-standard or unusual tape drive that you
697 use the {\bf btape} program to test your drive to see whether or not it
698 supports this function. All modern (after 1998) tape drives support this
701 \item [Fast Forward Space File = {\it Yes|No}]
702 \index[sd]{Fast Forward Space File}
703 \index[sd]{Directive!Fast Forward Space File}
704 If {\bf No}, the archive device is not required to support keeping track of
705 the file number ({\bf MTIOCGET} ioctl) during forward space file. If {\bf
706 Yes}, the archive device must support the {\tt ioctl} {\tt MTFSF} call, which
707 virtually all drivers support, but in addition, your SCSI driver must keep
708 track of the file number on the tape and report it back correctly by the
709 {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly forward space,
710 but they do not keep track of the file number or more seriously, they do not
711 report end of meduim.
713 Default setting for Fast Forward Space File is {\bf Yes}.
715 \item [Use MTIOCGET = {\it Yes|No}]
716 \index[sd]{Fast Forward Space File}
717 \index[sd]{Directive!Fast Forward Space File}
718 If {\bf No}, the operating system is not required to support keeping track of
719 the file number and reporting it in the ({\bf MTIOCGET} ioctl). The default
720 is {\bf Yes}. If you must set this to No, Bacula will do the proper file
721 position determination, but it is very unfortunate because it means that
722 tape movement is very inefficient.
723 Fortunately, this operation system deficiency seems to be the case only
724 on a few *BSD systems. Operating systems known to work correctly are
725 Solaris, Linux and FreeBSD.
727 \item [BSF at EOM = {\it Yes|No}]
728 \index[sd]{BSF at EOM}
729 \index[sd]{Directive!BSF at EOM}
730 If {\bf No}, the default, no special action is taken by Bacula with the End
731 of Medium (end of tape) is reached because the tape will be positioned after
732 the last EOF tape mark, and Bacula can append to the tape as desired.
733 However, on some systems, such as FreeBSD, when Bacula reads the End of
734 Medium (end of tape), the tape will be positioned after the second EOF tape
735 mark (two successive EOF marks indicated End of Medium). If Bacula appends
736 from that point, all the appended data will be lost. The solution for such
737 systems is to specify {\bf BSF at EOM} which causes Bacula to backspace over
738 the second EOF mark. Determination of whether or not you need this directive
739 is done using the {\bf test} command in the {\bf btape} program.
741 \item [TWO EOF = {\it Yes|No}]
743 \index[sd]{Directive!TWO EOF}
744 If {\bf Yes}, Bacula will write two end of file marks when terminating a tape
745 -- i.e. after the last job or at the end of the medium. If {\bf No}, the
746 default, Bacula will only write one end of file to terminate the tape.
748 \item [Backward Space Record = {\it Yes|No}]
749 \index[sd]{Backward Space Record}
750 \index[sd]{Directive!Backward Space Record}
751 If {\it Yes}, the archive device supports the {\tt MTBSR ioctl} to backspace
752 records. If {\it No}, this call is not used and the device must be rewound
753 and advanced forward to the desired position. Default is {\bf Yes} for non
754 random-access devices. This function if enabled is used at the end of a
755 Volume after writing the end of file and any ANSI/IBM labels to determine whether
756 or not the last block was written correctly. If you turn this function off,
757 the test will not be done. This causes no harm as the re-read process is
758 precautionary rather than required.
760 \item [Backward Space File = {\it Yes|No}]
761 \index[sd]{Backward Space File}
762 \index[sd]{Directive!Backward Space File}
763 If {\it Yes}, the archive device supports the {\bf MTBSF} and {\bf MTBSF
764 ioctl}s to backspace over an end of file mark and to the start of a file. If
765 {\it No}, these calls are not used and the device must be rewound and
766 advanced forward to the desired position. Default is {\bf Yes} for non
767 random-access devices.
769 \item [Forward Space Record = {\it Yes|No}]
770 \index[sd]{Forward Space Record}
771 \index[sd]{Directive!Forward Space Record}
772 If {\it Yes}, the archive device must support the {\bf MTFSR ioctl} to
773 forward space over records. If {\bf No}, data must be read in order to
774 advance the position on the device. Default is {\bf Yes} for non
775 random-access devices.
777 \item [Forward Space File = {\it Yes|No}]
778 \index[sd]{Forward Space File}
779 \index[sd]{Directive!Forward Space File}
780 If {\bf Yes}, the archive device must support the {\tt MTFSF ioctl} to
781 forward space by file marks. If {\it No}, data must be read to advance the
782 position on the device. Default is {\bf Yes} for non random-access devices.
784 \item [Offline On Unmount = {\it Yes|No}]
785 \index[sd]{Offline On Unmount}
786 \index[sd]{Directive!Offline On Unmount}
787 The default for this directive is {\bf No}. If {\bf Yes} the archive device
788 must support the {\tt MTOFFL ioctl} to rewind and take the volume offline. In
789 this case, Bacula will issue the offline (eject) request before closing the
790 device during the {\bf unmount} command. If {\bf No} Bacula will not attempt
791 to offline the device before unmounting it. After an offline is issued, the
792 cassette will be ejected thus {\bf requiring operator intervention} to
793 continue, and on some systems require an explicit load command to be issued
794 ({\bf mt -f /dev/xxx load}) before the system will recognize the tape. If you
795 are using an autochanger, some devices require an offline to be issued prior
796 to changing the volume. However, most devices do not and may get very
799 If you are using a Linux 2.6 kernel or other OSes
800 such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
801 with no tape, and Bacula will not be able to properly open the drive and
802 may fail the job. For more information on this problem, please see the
803 \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
807 \item [Maximum Volume Size = {\it size}]
808 \index[sd]{Maximum Volume Size}
809 \index[sd]{Directive!Maximum Volume Size}
810 No more than {\bf size} bytes will be written onto a given volume on the
811 archive device. This directive is used mainly in testing Bacula to
812 simulate a small Volume. It can also be useful if you wish to limit the
813 size of a File Volume to say less than 2GB of data. In some rare cases
814 of really antiquated tape drives that do not properly indicate when the
815 end of a tape is reached during writing (though I have read about such
816 drives, I have never personally encountered one). Please note, this
817 directive is deprecated (being phased out) in favor of the {\bf Maximum
818 Volume Bytes} defined in the Director's configuration file.
820 \item [Maximum File Size = {\it size}]
821 \index[sd]{Maximum File Size}
822 \index[sd]{Directive!Maximum File Size}
823 No more than {\bf size} bytes will be written into a given logical file
824 on the volume. Once this size is reached, an end of file mark is
825 written on the volume and subsequent data are written into the next
826 file. Breaking long sequences of data blocks with file marks permits
827 quicker positioning to the start of a given stream of data and can
828 improve recovery from read errors on the volume. The default is one
831 \item [Block Positioning = {\it yes|no}]
832 \index[sd]{Block Positioning}
833 \index[sd]{Directive!Block Positioning}
834 This directive is not normally used (and has not yet been tested). It will
835 tell Bacula not to use block positioning when it is reading tapes. This can
836 cause Bacula to be {\bf extremely} slow when restoring files. You might use
837 this directive if you wrote your tapes with Bacula in variable block mode
838 (the default), but your drive was in fixed block mode. If it then works as I
839 hope, Bacula will be able to re-read your tapes.
841 \item [Maximum Network Buffer Size = {\it bytes}]
842 \index[sd]{Maximum Network Buffer Size}
843 \index[sd]{Directive!Maximum Network Buffer Size}
844 where {\it bytes} specifies the initial network buffer size to use with the
845 File daemon. This size will be adjusted down if it is too large until
846 it is accepted by the OS. Please use care in setting this value since if
847 it is too large, it will be trimmed by 512 bytes until the OS is happy,
848 which may require a large number of system calls. The default value is
851 The default size was chosen to be relatively large but not too big in
852 the case that you are transmitting data over Internet. It is clear that
853 on a high speed local network, you can increase this number and improve
854 performance. For example, some users have found that if you use a value
855 of 65,536 bytes they get 5-10 times the throughput. Larger values for
856 most users don't seem to improve performance. If you are interested
857 in improving your backup speeds, this is definitely a place to
858 experiment. You will probably also want to make the corresponding change
859 in each of your File daemons conf files.
862 \item [Maximum Spool Size = {\it bytes}]
863 \index[sd]{Maximum Spool Size}
864 \index[sd]{Directive!Maximum Spool Size}
865 where the bytes specify the maximum spool size for all jobs that are running.
866 The default is no limit.
868 \item [Maximum Job Spool Size = {\it bytes}]
869 \index[sd]{Maximum Job Spool Size}
870 \index[sd]{Directive!Maximum Job Spool Size}
871 where the bytes specify the maximum spool size for any one job that is
872 running. The default is no limit.
873 This directive is implemented only in version 1.37 and later.
875 \item [Spool Directory = {\it directory}]
876 \index[sd]{Spool Directory}
877 \index[sd]{Directive!Spool Directory}
878 specifies the name of the directory to be used to store the spool files for
879 this device. This directory is also used to store temporary part files when
880 writing to a device that requires mount (DVD). The default is to use the
883 \item [Maximum Part Size = {\it bytes}]
884 \index[sd]{Maximum Part Size}
885 \index[sd]{Directive!Maximum Part Size}
886 This is the maximum size of a volume part file. The default is no limit.
887 This directive is implemented only in version 1.37 and later.
889 If the device requires mount, it is transfered to the device when this size
890 is reached. In this case, you must take care to have enough disk space left
891 in the spool directory.
893 Otherwise, it is left on the hard disk.
895 It is ignored for tape and FIFO devices.
900 \subsection*{Devices that require a mount (DVD)}
901 \index[general]{Devices that require a mount (DVD)}
902 \index[general]{DVD!Devices that require a mount}
903 \addcontentsline{toc}{subsection}{Devices that require a mount (DVD)}
905 All the directives in this section are implemented only in
906 Bacula version 1.37 and later. As of version 1.39.5, the directives
907 "Requires Mount", "Mount Point", "Mount Command", and "Unmount Command"
908 apply to removable filesystems such as USB in addition to DVD.
912 \item [Requires Mount = {\it Yes|No}]
913 \index[sd]{Requires Mount}
914 \index[sd]{Directive!Requires Mount}
915 You must set this directive to {\bf yes} for DVD-writers, and to {\bf no} for
916 all other devices (tapes/files). This directive indicates if the device
917 requires to be mounted to be read, and if it must be written in a special way.
918 If it set, {\bf Mount Point}, {\bf Mount Command}, {\bf Unmount Command} and
919 {\bf Write Part Command} directives must also be defined.
921 \item [Mount Point = {\it directory}]
922 \index[sd]{Mount Point}
923 \index[sd]{Directive!Mount Point}
924 Directory where the device can be mounted.
926 \item [Mount Command = {\it name-string}]
927 \index[sd]{Mount Command}
928 \index[sd]{Directive!Mount Command}
929 Command that must be executed to mount the device. Before the command is
930 executed, \%a is replaced with the Archive Device, and \%m with the Mount
933 Most frequently, you will define it as follows:
937 Mount Command = "/bin/mount -t iso9660 -o ro %a %m"
941 \item [Unmount Command = {\it name-string}]
942 \index[sd]{Unmount Command}
943 \index[sd]{Directive!Unmount Command}
944 Command that must be executed to unmount the device. Before the command is
945 executed, \%a is replaced with the Archive Device, and \%m with the Mount
948 Most frequently, you will define it as follows:
952 Unmount Command = "/bin/umount %m"
956 \item [Write Part Command = {\it name-string}]
957 \index[sd]{Write Part Command}
958 \index[sd]{Directive!Write Part Command}
959 Command that must be executed to write a part to the device. Before the
960 command is executed, \%a is replaced with the Archive Device, \%m with the
961 Mount Point, \%e is replaced with 1 if we are writing the first part,
962 and with 0 otherwise, and \%v with the current part filename.
964 For a DVD, you will most frequently specify the Bacula supplied {\bf
965 dvd-writepart} script as follows:
969 Write Part Command = "/path/dvd-writepart %e %a %v"
973 Where {\bf /path} is the path to your scripts install directory, and
974 dvd-writepart is the Bacula supplied script file.
975 This command will already be present, but commented out,
976 in the default bacula-sd.conf file. To use it, simply remove
977 the comment (\#) symbol.
980 \item [Free Space Command = {\it name-string}]
981 \index[sd]{Free Space Command}
982 \index[sd]{Directive!Free Space Command}
983 Command that must be executed to check how much free space is left on the
984 device. Before the command is executed,\%a is replaced with the Archive
985 Device, \%m with the Mount Point, \%e is replaced with 1 if we are writing
986 the first part, and with 0 otherwise, and \%v with the current part filename.
988 For a DVD, you will most frequently specify the Bacula supplied {\bf
989 dvd-freespace} script as follows:
993 Free Space Command = "/path/dvd-freespace %a"
997 Where {\bf /path} is the path to your scripts install directory, and
998 dvd-freespace is the Bacula supplied script file.
999 If you want to specify your own command, please look at the code of
1000 dvd-freespace to see what output Bacula expects from this command.
1001 This command will already be present, but commented out,
1002 in the default bacula-sd.conf file. To use it, simply remove
1003 the comment (\#) symbol.
1005 If you do not set it, Bacula will expect there is always free space on the
1010 \label{AutochangerRes}
1011 \label{AutochangerResource1}
1012 \input{autochangerres}
1014 \subsection*{Capabilities}
1015 \index[general]{Capabilities}
1016 \addcontentsline{toc}{subsection}{Capabilities}
1020 \item [Label media = {\it Yes|No}]
1021 \index[sd]{Label media}
1022 \index[sd]{Directive!Label media}
1023 If {\bf Yes}, permits this device to automatically label blank media
1024 without an explicit operator command. It does so by using an internal
1025 algorithm as defined on the \ilink{Label Format}{Label} record in each
1026 Pool resource. If this is {\bf No} as by default, Bacula will label
1027 tapes only by specific operator command ({\bf label} in the Console) or
1028 when the tape has been recycled. The automatic labeling feature is most
1029 useful when writing to disk rather than tape volumes.
1031 \item [Automatic mount = {\it Yes|No}]
1032 \index[sd]{Automatic mount}
1033 \index[sd]{Directive!Automatic mount}
1034 If {\bf Yes} (the default), permits the daemon to examine the device to
1035 determine if it contains a Bacula labeled volume. This is done
1036 initially when the daemon is started, and then at the beginning of each
1037 job. If the This directive is particularly important if you have set
1038 {\bf Always Open = no} because it permits Bacula to attempt to read the
1039 device before asking the system operator to mount a tape. However,
1040 please note that the tape must be mounted before the job begins.
1044 \subsection*{Messages Resource}
1045 \label{MessagesResource1}
1046 \index[general]{Resource!Messages}
1047 \index[general]{Messages Resource}
1048 \addcontentsline{toc}{subsection}{Messages Resource}
1050 For a description of the Messages Resource, please see the
1051 \ilink{Messages Resource}{_ChapterStart15} Chapter of this
1054 \subsection*{Sample Storage Daemon Configuration File}
1055 \label{SampleConfiguration}
1056 \index[general]{File!Sample Storage Daemon Configuration}
1057 \index[general]{Sample Storage Daemon Configuration File}
1058 \addcontentsline{toc}{subsection}{Sample Storage Daemon Configuration File}
1060 A example Storage Daemon configuration file might be the following:
1065 # Default Bacula Storage Daemon Configuration file
1067 # For Bacula release 1.37.2 (07 July 2005) -- gentoo 1.4.16
1069 # You may need to change the name of your tape drive
1070 # on the "Archive Device" directive in the Device
1071 # resource. If you change the Name and/or the
1072 # "Media Type" in the Device resource, please ensure
1073 # that bacula-dir.conf has corresponding changes.
1075 Storage { # definition of myself
1078 WorkingDirectory = "$HOME/bacula/bin/working"
1079 Pid Directory = "$HOME/bacula/bin/working"
1080 Maximum Concurrent Jobs = 20
1083 # List Directors who are permitted to contact Storage daemon
1087 Password = "ZF9Ctf5PQoWCPkmR3s4atCB0usUPg+vWWyIo2VS5ti6k"
1090 # Restricted Director, used by tray-monitor to get the
1091 # status of the storage daemon
1095 Password = "9usxgc307dMbe7jbD16v0PXlhD64UVasIDD0DH2WAujcDsc6"
1099 # Devices supported by this Storage daemon
1100 # To connect, the Director's bacula-dir.conf must have the
1101 # same Name and MediaType.
1107 Changer Command = "/home/kern/bacula/bin/mtx-changer %c %o %S %a %d"
1108 Changer Device = /dev/sg0
1114 Media Type = DLT-8000
1115 Archive Device = /dev/nst0
1116 AutomaticMount = yes; # when device opened, read it
1118 RemovableMedia = yes;
1121 Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
1127 Media Type = DLT-8000
1128 Archive Device = /dev/nst1
1129 AutomaticMount = yes; # when device opened, read it
1131 RemovableMedia = yes;
1134 Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
1139 Media Type = DLT8000
1140 Archive Device = /dev/nst0
1141 AutomaticMount = yes; # when device opened, read it
1143 RemovableMedia = yes;
1147 # Media Type = DDS-2
1148 # Archive Device = /dev/nst0
1149 # AutomaticMount = yes; # when device opened, read it
1151 # RemovableMedia = yes;
1155 # Media Type = Floppy
1156 # Archive Device = /mnt/floppy
1157 # RemovableMedia = yes;
1158 # Random Access = Yes;
1159 # AutomaticMount = yes; # when device opened, read it
1163 # Name = FileStorage
1165 # Archive Device = /tmp
1166 # LabelMedia = yes; # lets Bacula label unlabeled media
1167 # Random Access = Yes;
1168 # AutomaticMount = yes; # when device opened, read it
1169 # RemovableMedia = no;
1173 # Name = "NEC ND-1300A"
1175 # Archive Device = /dev/hda
1176 # LabelMedia = yes; # lets Bacula label unlabeled media
1177 # Random Access = Yes;
1178 # AutomaticMount = yes; # when device opened, read it
1179 # RemovableMedia = yes;
1181 # MaximumPartSize = 800M;
1182 # RequiresMount = yes;
1183 # MountPoint = /mnt/cdrom;
1184 # MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
1185 # UnmountCommand = "/bin/umount %m";
1186 # SpoolDirectory = /tmp/backup;
1187 # WritePartCommand = "/etc/bacula/dvd-writepart %e %a %v"
1188 # FreeSpaceCommand = "/etc/bacula/dvd-freespace %a"
1191 # A very old Exabyte with no end of media detection
1194 # Name = "Exabyte 8mm"
1195 # Media Type = "8mm"
1196 # Archive Device = /dev/nst0
1197 # Hardware end of medium = No;
1198 # AutomaticMount = yes; # when device opened, read it
1200 # RemovableMedia = yes;
1203 # Send all messages to the Director,
1204 # mount messages also are sent to the email address
1208 director = rufus-dir = all
1209 operator = root = mount