Storage Daemon Configuration

Bacula 1.34 User's Guide |
Client/File daemon Configuration | Index | Messages Resource
# Storage Daemon Configuration ## General The Storage Daemon configuration file has relatively few resource definitions. However, due to the great variation in backup media and system capabilities, the storage daemon must be highly configurable. As a consequence, there are quite a large number of record types in the Device Resource definition that allow you to define all the characteristics of your Storage device (normally a tape drive). Fortunately, with modern storage devices, very few records are actually needed. Examples of Device resource records that are known to work for a number of common tape drives can be found in the <bacula-src>/examples/devices directory. For a general discussion of configuration file and resources including the data types recognized by Bacula, please see the Configuration chapter of this manual. The following Storage Resource definitions must be defined: Storage -- to define the name of the Storage daemon. Director -- to define the Director's name and his access password. Device -- to define the characteristics of your storage device (tape drive). Messages -- to define where error and information messages are to be sent. ## Storage Resource In general, the properties specified under the Storage resource define global properties of the Storage daemon. Each Storage daemon configuration file must have one and only one Storage resource definition. Name = <Storage-Daemon-Name> Specifies the Name of the Storage daemon. This record is required. Working Directory = <Directory> This directive is mandatory and specifies a directory in which the Storage daemon may put its status files. This directory should be used only by Bacula, but may be shared by other Bacula daemons. This record is required Pid Directory = <Directory> This directive is mandatory and specifies a directory in which the Director may put its process Id file files. The process Id file is used to shutdown Bacula and to prevent multiple copies of Bacula from running simultaneously. This record is required. Standard shell expansion of the Directory is done when the configuration file is read so that values such as $HOME will be properly expanded. Typically on Linux systems, you will set this to: /var/run. If you are not installing Bacula in the system directories, you can use the Working Directory as defined above. Heartbeat Interval = <time-interval> This record defines an interval of time. When the Storage daemon is waiting for the operator to mount a tape, each time interval, it will send a heartbeat signal to the File daemon. The default interval is zero which disables the heartbeat. This feature is particularly useful if you have a router such as 3Com that does not follow Internet standards and times out an inactive connection after a short duration. Maximum Concurrent Jobs = <number> where <number> is the maximum number of Jobs that should run concurrently. The default is set to 2, but you may set it to a larger number. Each contact from the Director (e.g. status request, job start request) is considered as a Job, so if you want to be able to do a status request in the console at the same time as a Job is running, you will need to set this value greater than 1. SDPort = <port-number> Specifies port number on which the Storage daemon listens for Director connections. The default is 9103. SDAddress = <IP-Address> This record is optional, and if it is specified, it will cause the Storage daemon server (for Director and File daemon connections) to bind to the specified IP-Address, which is either a domain name or an IP address specified as a dotted quadruple. If this record is not specified, the Storage daemon will bind to any available address (the default). The following is a typical Storage daemon Storage definition.
    #
    # "Global" Storage daemon configuration specifications appear
    # under the Storage resource.
    #
    Storage {
      Name = "Storage daemon"
      Address = localhost
      WorkingDirectory = "~/bacula/working"
      Pid    Directory = "~/bacula/working"
    }
## Director Resource The Director resource specifies the Name of the Director which is permitted to use the services of the Storage daemon. There may be multiple Director resources. The Director Name and Password must match the corresponding values in the Director's configuration file. Name = <Director-Name> Specifies the Name of the Director allowed to connect to the Storage daemon. This record is required. Password = <Director-password> Specifies the password that must be supplied by the above named Director. This record is required. The following is an example of a valid Director resource definition:
    Director {
      Name = MainDirector
      Password = my_secret_password
    }
  ## Device Resource The Device Resource specifies the details of each device (normally a tape drive) that can be used by the Storage daemon. There may be multiple Device resources for a single Storage daemon. In general, the properties specified within the Device resource are specific to the Device. Name = Device-Name Specifies the Name that the Director will use when asking to backup or restore to or from to this device. This is the logical Device name, and may be any string up to 127 characters in length. It is generally a good idea to make it correspond to the English name of the backup device. The physical name of the device is specified on the Archive Device record described below. The name you specify here is also used in your Director's conf file on the Device record in its Storage resource. Archive Device = name-string The specified name-string gives the system file name of the storage device managed by this storage daemon. This will usually be the device file name of a removable storage device (tape drive), for example "/dev/nst0" or "/dev/rmt/0mbn". It may also be a directory name if you are archiving to disk storage. When specifying a tape device, it is preferable that the "non-rewind" variant of the device file name be given. In addition, on systems such as Sun, which have modified the tape access methods, you must be sure to specify to use Berkeley I/O conventions with the device. The b in the Solaris (Sun) archive specification /dev/rmt/0mbn is what is needed in this case. Bacula does not support SysV tape drive behavior. As noted above, normally the Archive Device is the name of a tape drive, but you may also specify a directory name. In that case, Bacula will write to file storage in the specified directory, and the filename used will be the Volume name as specified in the Catalog. If you want to write into more than one directory (i.e. to spread the load to different disk drives), you will need to define two Device resources, each containing an Archive Device with a different directory. In addition to a tape device name or a directory name, Bacula will accept the name of a FIFO. A FIFO is a special kind of file that connects two programs via kernel memory. If a FIFO device is specified for a backup operation, you must have a program that reads what Bacula writes into the FIFO. When the Storage daemon starts the job, it will wait for MaximumOpenWait seconds for the read program to start reading, and then time it out and terminate the job. As a consequence, it is best to start the read program at the beginning of the job perhaps with the RunBeforeJob record. For this kind of device, you never want to specify AlwaysOpen, because you want the Storage daemon to open it only when a job starts, so you must explicitly set it to No. Since a FIFO is a one way device, Bacula will not attempt to read a label of a FIFO device, but will simply write on it. To create a FIFO Volume in the catalog, use the add command rather than then label command to avoid attempting to write a label. During a restore operation, if the Archive Device is a FIFO, Bacula will attempt to read from the FIFO, so you must have an external program that writes into the FIFO. Bacula will wait MaximumOpenWait seconds for the program to begin writing and will then time it out and terminate the job. As noted above, you may use the RunBeforeJob to start the writer program at the beginning of the job. The Archive Device record is required. Media Type = name-string The specified name-string names the type of media supported by this device, for example, "DLT7000". Media type names are arbitrary in that you set it to anything you want, but must be known to the volume database to keep track of which storage daemons can read which volumes. The same name-string must appear in the appropriate Storage resource definition in the Director's configuration file. Even though the names you assign are arbitrary (i.e. you choose the name you want), you should take care in specifying them because in a future version of Bacula, the Media Type can be used to determine which storage device Bacula should select. Thus you should probably use the same Media Type specification for all drives where the Media can be freely interchanged. You should also ensure to have unique Media Type names if the Media is not compatible between drives. This specification is required for all devices. Autochanger = Yes|No If Yes, this device is an automatic tape changer, and you should also specify a Changer Device as well as a Changer Command. If No (default), the volume must be manually changed. You might also want to add an identical record to the Storage resource in the Director's configuration file so that when labeling tapes you are prompted for the slot. Changer Device = name-string The specified name-string gives the system file name of the autochanger device name that corresponds to the Archive Device specified. This device name is specified only if you have an autochanger. Typically, you will want to specify the generic scsi device name. For example, on Linux systems, for archive device /dev/nst0, This record is optional. See the Using Autochangers chapter of this manual for more details of using this and the following autochanger records. Changer Command = name-string The name-string specifies an external program to be called that will automatically change volumes as required by Bacula. There are a number of substitution characters that may be specified to configure your autochanger. For additional details, please see the Autochangers chapter of this manual. Drive Index = number The Drive Index that you specify is passed to the mtx-changer script and is thus passed to the mtx program. By default, the Drive Index is zero, so if you have only one drive in your autochanger, everything will work normally. However, if you have multiple drives, you may specify two Bacula Device resources. The first will either set Drive Index to zero, or leave it unspecified, and the second Device Resource should contain a Drive Index set to 1. This will then permit you to use two or more drives in your autochanger. However, you must ensure that Bacula does not request the same Volume on both drives at the same time. Maximum Changer Wait = time This record specifies the maximum time for Bacula to wait for an autochanger to change the volume. If this time is exceeded, Bacula will invalidate the Volume slot number stored in the catalog and try again. If no additional changer volumes exist, Bacula will ask the operator to intervene. The default time out is 5 minutes. Always Open = Yes|No If Yes (default), Bacula will always keep the device open unless specifically unmounted by the Console program. This permits Bacula to ensure that the tape drive is always available. If you set AlwaysOpen to no Bacula will only open the drive when necessary, and at the end of the Job if no other Jobs are using the drive, it will be freed. To minimize unnecessary operator intervention, it is highly recommended that Always Open = yes. This also ensures that the drive is available when Bacula needs it. If you have Always Open = yes (recommended) and you want to use the drive for something else, simply use the unmount command in the Console program to release the drive. However, don't forget to remount the drive with mount when the drive is available or the next Bacula job will block. For File storage, this record is ignored. For a FIFO storage device, you must set this to No. Please note that if you set this directive to No Bacula will release the tape drive between each job, and thus the next job will rewind the tape and position it to the end of the data. This can be a very time consuming operation. Volume Poll Interval = time If a non-zero time interval is specified, Bacula will poll the device after asking the operator to mount a new volume to see if the new volume has been mounted. If the time interval is zero (the default), no polling will occur. This directive can be useful if you want to avoid operator intervention via the console. The operator can simply remove the old volume and insert the requested one, and Bacula will continue. Please be aware that if you set this interval to small, you may excessively wear your tape drive if the old tape remains in the drive since Bacula will read it on each poll. This could be avoided by using the Offline On Unmount and the Close on Poll directives. Close on Poll= Yes|No If Yes, Bacula close the device (equivalent to an unmount except no mount is required) and reopen it at each poll. Normally this is not too useful unless you have the Offline on Unmount directive set, in which case the drive will be taken offline preventing wear on the tape during any future polling. Once the operator inserts a new tape, Bacula will recognize the drive on the next poll and automatically continue with the backup. Maximum Open Wait = time This record specifies the maximum amount of time that Bacula will wait for a device that is busy. The default is 5 minutes. If the device cannot be obtained, the current Job will be terminated in error. Bacula will re-attempt to open the drive the next time a Job starts that needs the the drive. Removable media = Yes|No If Yes, this device supports removable media (for example, tapes or CDs). If No, media cannot be removed (for example, an intermediate backup area on a hard disk). Random access = Yes|No If Yes, the archive device is assumed to be a random access medium which supports the lseek (or lseek64 if Largefile is enabled during configuration) facility. Maximum block size = size-in-bytes The Storage daemon will aways attempt to write blocks of the specified size-in-bytes to the archive device. As a consequence, this statement specifies both the default block size and the maximum block size. The size written never exceed the given size-in-bytes. If adding data to a block would cause it to exceed the given maximum size, the block will be written to the archive device, and the new data will begin a new block. If no value is specified or zero is specified, the Storage daemon will use a default block size of 64,512 bytes (126 * 512). Minimum block size = size-in-bytes This statement applies only to non-random access devices (e.g. tape drives). Blocks written by the storage daemon to a non-random archive device will never be smaller than the given size-in-bytes. The Storage daemon will attempt to efficiently fill blocks with data received from active sessions but will, if necessary, add padding to a block to achieve the required minimum size. To force the block size to be fixed, as is normally the case for non-random access devices (tape drives), set the Minimum block size and the Maximum block size to the same value (zero included). The default is that both the minimum and maximum block size are zero and the default block size is 64,512 bytes. If you wish the block size to be fixed and different from the default, specify the same value for both Minimum block size and Maximum block size. For example, suppose you want a fixed block size of 100K bytes, then you would specify:
          Minimum block size = 100K
          Maximum block size = 100K
  If you want the block size to be variable but with a 64K minimum and 200K maximum (and default as well), you would specify:
          Minimum block size = 64K
          Maximum blocksize = 200K
Hardware End of Medium = Yes|No If No, the archive device is not required to support end of medium ioctl request, and the storage daemon will use the forward space file function to find the end of the recorded data. If Yes, the archive device must support the `ioctl` `MTEOM` call, which will position the tape to the end of the recorded data. In addition, your SCSI driver must keep track of the file number on the tape and report it back correctly by the MTIOCGET ioctl. Note, some SCSI drivers will correctly forward space to the end of the recorded data, but they do not keep track of the file number. On Linux machines, the SCSI driver has a fast-eod option, which if set will cause the driver to lose track of the file number. You should ensure that this option is always turned off using the mt program. Default setting for Hardware End of Medium is Yes. This function is used before appending to a tape to ensure that no previously written data is lost. We recommend if you have a non standard or unusual tape drive that you use the btape program to test your drive to see whether or not it supports this function. All modern (after 1998) tape drives support this feature. If you set Hardware End of Medium = no, you should also set Fast Forward Space File = no. If you do not, Bacula will most likely be unable to correctly find the end of data on the tape. Fast Forward Space File = Yes|No If No, the archive device is not required to support keeping track of the file number (MTIOCGET ioctl) during forward space file. If Yes, the archive device must support the `ioctl` `MTFSF` call, which virtually all drivers support, but in addition, your SCSI driver must keep track of the file number on the tape and report it back correctly by the MTIOCGET ioctl. Note, some SCSI drivers will correctly forward space, but they do not keep track of the file number or more seriously, they do not report end of meduim. Default setting for Fast Forward Space File is Yes. If you disable Hardware End of Medium, most likely you should also disable Fast Forward Space file. The test command in the program btape will test this feature and advise you if it should be turned off. BSF at EOM = Yes|No If No, the default, no special action is taken by Bacula with the End of Medium (end of tape) is reached because the tape will be positioned after the last EOF tape mark, and Bacula can append to the tape as desired. However, on some systems, such as FreeBSD, when Bacula reads the End of Medium (end of tape), the tape will be positioned after the second EOF tape mark (two successive EOF marks indicated End of Medium). If Bacula appends from that point, all the appended data will be lost. The solution for such systems is to specify BSF at EOM which causes Bacula to backspace over the second EOF mark. Determination of whether or not you need this record is done using the test command in the btape program. TWO EOF = Yes|No If No, Bacula will write two end of file marks when terminating a tape -- i.e. after the last job or at the end of the medium. If Yes, the default, Bacula will only write one end of file to terminate the tape. Backward Space Record = Yes|No If Yes, the archive device supports the `MTBSR ioctl` to backspace records. If No, this call is not used and the device must be rewound and advanced forward to the desired position. Default is Yes for non random-access devices. Backward Space File = Yes|No If Yes, the archive device supports the MTBSF and MTBSF ioctls to backspace over an end of file mark and to the start of a file. If No, these calls are not used and the device must be rewound and advanced forward to the desired position. Default is Yes for non random-access devices. Forward Space Record = Yes|No If Yes, the archive device must support the MTFSR ioctl to forward space over records. If No, data must be read in order to advance the position on the device. Default is Yes for non random-access devices. Forward Space File = Yes|No If Yes, the archive device must support the `MTFSF ioctl` to forward space by file marks. If No, data must be read to advance the position on the device. Default is Yes for non random-access devices. Offline On Unmount = Yes|No The default for this record is No. If Yes the archive device must support the `MTOFFL ioctl` to rewind and take the volume offline. In this case, Bacula will issue the offline (eject) request before closing the device during the unmount command. If No Bacula will not attempt to offline the device before unmounting it. After an offline is issued, the cassette will be ejected thus requiring operator intervention to continue, and on some systems require an explicit load command to be issued (mt -f /dev/xxx load) before the system will recognize the tape. If you are using an autochanger, some devices require an offline to be issued prior to changing the volume. However, most devices do not and may get very confused. Maximum Volume Size = size No more than size bytes will be written onto a given volume on the archive device. This record is used mainly in testing Bacula to simulate a small Volume. It can also be useful if you wish to limit the size of a File Volume to say less than 2GB of data. In some rare cases of really antiquated tape drives that do not properly indicate when the end of a tape is reached during writing (though I have read about such drives, I have never personally encountered one). Please note, this record is deprecated (being phased out) in favor of the Maximum Volume Bytes defined in the Director's configuration file. Maximum File Size = size No more than size bytes will be written into a given logical file on the volume. Once this size is reached, an end of file mark is written on the volume and subsequent data are written into the next file. Breaking long sequences of data blocks with file marks permits quicker positioning to the start of a given stream of data and can improve recovery from read errors on the volume. The default is one Gigabyte. Maximum Network Buffer Size = bytes where bytes specifies the initial network buffer size to use with the File daemon. This size will be adjusted down if it is too large until it is accepted by the OS. Please use care in setting this value since if it is too large, it will be trimmed by 512 bytes until the OS is happy, which may require a large number of system calls. The default value is 32,768 bytes. Maximum Spool Size = bytes where the bytes specify the maximum spool size for all jobs that are running. The default is no limit. Maximum Job Spool Size = bytes where the bytes specify the maximum spool size for any one job that is running. The default is no limit. Spool Directory = directory/em> specifies the name of the directory to be used to store the spool files for this device. The default is to use the working directory. ## Parallelism Maximum Concurrent Jobs = positive integer The storage daemon will accept no more than the given positive integer of simultaneous connections. The default is 10. It is best to set this number fairly large (e.g. 10 or 20) and control how many Jobs are running with the Maximum Concurrent Jobs in the Storage resource in the Director's configuration file. ## Capabilities Label media = Yes|No If Yes, permits this device to automatically label blank media without an explicit operator command. It does so by using an internal algorithm as defined on the Label Format record in each Pool resource. If this is No as by default, Bacula will label tapes only by specific operator command (label in the Console) or when the tape has been recycled. The automatic labeling feature is most useful when writing to disk rather than tape volumes. Automatic mount = Yes|No If Yes (the default), permits the daemon to examine the device to determine if it contains a Bacula labeled volume. This is done initially when the daemon is started, and then at the beginning of each job. This record is particularly important if you have set Always Open = no because it permits Bacula to attempt to read the device before asking the system operator to mount a tape. ## Messages Resource For a description of the Messages Resource, please see the Messages Resource Chapter of this manual. ## Sample Storage Daemon Configuration File A example Storage Daemon configuration file might be the following:
    #
    # Default Bacula Storage Daemon Configuration file
    #
    #  For Bacula release 1.15 (5 March 2002) -- redhat 7.1
    #
    # You may need to change the name of your tape drive
    #   on the "Archive Device" directive in the Device
    #   resource.  If you change the Name and/or the
    #   "Media Type" in the Device resource, please ensure
    #   that bacula-dir.conf has corresponding changes.
    #

    Storage {                             \# definition of myself
      Name = rufus-sd
      Address = rufus
      WorkingDirectory = "$HOME/bacula/bin/working"
      Pid Directory = "$HOME/bacula/bin/working"
    }

    #
    # List Directors who are permitted to contact Storage daemon
    #
    Director {
      Name = rufus-dir
      Password = "ZF9Ctf5PQoWCPkmR3s4atCB0usUPg+vWWyIo2VS5ti6k"
    }

    #
    # Devices supported by this Storage daemon
    # To connect, the Director's bacula-dir.conf must have the
    #  same Name and MediaType.
    #
    Device {
      Name = "HP DLT 80"
      Media Type = DLT8000
      Archive Device = /dev/nst0
      AutomaticMount = yes;               \# when device opened, read it
      AlwaysOpen = yes;
      RemovableMedia = yes;
    }

    #Device {
    #  Name = SDT-7000                     #
    #  Media Type = DDS-2
    #  Archive Device = /dev/nst0
    #  AutomaticMount = yes;               # when device opened, read it
    #  AlwaysOpen = yes;
    #  RemovableMedia = yes;
    #}

    #Device {
    #  Name = Floppy
    #  Media Type = Floppy
    #  Archive Device = /mnt/floppy
    #  RemovableMedia = yes;
    #  Random Access = Yes;
    #  AutomaticMount = yes;               # when device opened, read it
    #  AlwaysOpen = no;
    #}

    #Device {
    #  Name = FileStorage
    #  Media Type = File
    #  Archive Device = /tmp
    #  LabelMedia = yes;                   # lets Bacula label unlabeled media
    #  Random Access = Yes;
    #  AutomaticMount = yes;               # when device opened, read it
    #  RemovableMedia = no;
    #  AlwaysOpen = no;
    #}

    #
    # A very old Exabyte with no end of media detection
    #
    #Device {
    #  Name = "Exabyte 8mm"
    #  Media Type = "8mm"
    #  Archive Device = /dev/nst0
    #  Hardware end of medium = No;
    #  AutomaticMount = yes;               # when device opened, read it
    #  AlwaysOpen = Yes;
    #  RemovableMedia = yes;
    #}

    #
    # Send all messages to the Director,
    # mount messages also are sent to the email address
    #
    Messages {
      Name = Standard
      director = rufus-dir = all
      operator = root = mount
    }
Client/File daemon Configuration | Index | Messages Resource
Bacula 1.34 User's Guide The Network Backup Solution | Copyright © 2000-2004 Kern Sibbald and John Walker