Storage Daemon Configuration¶
The Bareos 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 directives 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, the defaults are sufficient, and very few directives are actually needed.
For a general discussion of configuration file and resources including the data types recognized by Bareos, 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.
Following resources are optional:
- Autochanger Resource – to define Autochanger devices.
- NDMP Resource – to define the NDMP authentication context.
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.
-
Absolute Job Timeout
¶ Type: PINT32
-
Allow Bandwidth Bursting
¶ Type: BOOLEAN Default value: no
-
Auto XFlate On Replication
¶ Type: BOOLEAN Default value: no Since Version: 13.4.0
-
Backend Directory
¶ Type: DIRECTORY_LIST Default value: /usr/lib/bareos/backends (platform specific)
-
Client Connect Wait
¶ Type: TIME Default value: 1800 This directive defines an interval of time in seconds that the Storage daemon will wait for a Client (the File daemon) to connect. Be aware that the longer the Storage daemon waits for a Client, the more resources will be tied up.
-
Collect Device Statistics
¶ Type: BOOLEAN Default value: no
-
Collect Job Statistics
¶ Type: BOOLEAN Default value: no
-
Compatible
¶ Type: BOOLEAN Default value: no This directive enables the compatible mode of the storage daemon. In this mode the storage daemon will try to write the storage data in a compatible way with Bacula of which Bareos is a fork. This only works for the data streams both share and not for any new datastreams which are Bareos specific. Which may be read when used by a Bareos storage daemon but might not be understood by any of the Bacula components (dir/sd/fd).
The default setting of this directive was changed to no since Bareos Version >= 15.2.0.
-
Description
¶ Type: STRING
-
Device Reserve By Media Type
¶ Type: BOOLEAN Default value: no
-
FD Connect Timeout
¶ Type: TIME Default value: 1800
-
File Device Concurrent Read
¶ Type: BOOLEAN Default value: no
-
Heartbeat Interval
¶ Type: TIME Default value: 0 This directive defines an interval of time in seconds. 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 that does not follow Internet standards and times out an valid connection after a short duration despite the fact that keepalive is set. This usually results in a broken pipe error message.
-
Log Timestamp Format
¶ Type: STRING Since Version: 15.2.3
-
Maximum Bandwidth Per Job
¶ Type: SPEED
-
Maximum Concurrent Jobs
¶ Type: PINT32 Default value: 20 This directive specifies the maximum number of Jobs that may run concurrently. 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. To run simultaneous Jobs, you will need to set a number of other directives in the Director’s configuration file. Which ones you set depend on what you want, but you will almost certainly need to set the
Maximum Concurrent Jobs (Dir->Storage)
. Please refer to the Concurrent Jobs chapter.
-
Maximum Connections
¶ Type: PINT32 Default value: 42 Since Version: 15.2.3
-
Maximum Network Buffer Size
¶ Type: PINT32
-
Messages
¶ Type: RES
-
Name
¶ Required: True Type: NAME Specifies the Name of the Storage daemon.
-
NDMP Address
¶ Type: ADDRESS Default value: 10000 This directive is optional, and if it is specified, it will cause the Storage daemon server (for NDMP Tape Server 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 directive is not specified, the Storage daemon will bind to any available address (the default).
-
NDMP Addresses
¶ Type: ADDRESSES Default value: 10000 Specify the ports and addresses on which the Storage daemon will listen for NDMP Tape Server connections. Normally, the default is sufficient and you do not need to specify this directive.
-
NDMP Enable
¶ Type: BOOLEAN Default value: no This directive enables the Native NDMP Tape Agent.
-
NDMP Log Level
¶ Type: PINT32 Default value: 4 This directive sets the loglevel for the NDMP protocol library.
-
NDMP Port
¶ Type: PORT Default value: 10000 Specifies port number on which the Storage daemon listens for NDMP Tape Server connections.
-
NDMP Snooping
¶ Type: BOOLEAN Default value: no This directive enables the Snooping and pretty printing of NDMP protocol information in debugging mode.
-
Pid Directory
¶ Type: DIRECTORY Default value: /var/lib/bareos (platform specific) This directive specifies a directory in which the Storage Daemon may put its process Id file files. The process Id file is used to shutdown Bareos and to prevent multiple copies of Bareos from running simultaneously. Standard shell expansion of the directory is done when the configuration file is read so that values such as $HOME will be properly expanded.
-
Plugin Directory
¶ Type: DIRECTORY This directive specifies a directory in which the Storage Daemon searches for plugins with the name
<pluginname>-sd.so
which it will load at startup.
-
Plugin Names
¶ Type: PLUGIN_NAMES If a
Plugin Directory (Sd->Storage)
is specified Plugin Names defines, which sdPlugins get loaded.If Plugin Names is not defined, all plugins get loaded, otherwise the defined ones.
-
Scripts Directory
¶ Type: DIRECTORY This directive is currently unused.
-
SD Address
¶ Type: ADDRESS Default value: 9103 This directive 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 and the
SD Addresses (Sd->Storage)
directives are not specified, the Storage daemon will bind to any available address (the default).
-
SD Addresses
¶ Type: ADDRESSES Default value: 9103 Specify the ports and addresses on which the Storage daemon will listen for Director connections. Using this directive, you can replace both the
SD Port (Sd->Storage)
andSD Address (Sd->Storage)
directives.
-
SD Connect Timeout
¶ Type: TIME Default value: 1800
-
SD Port
¶ Type: PORT Default value: 9103 Specifies port number on which the Storage daemon listens for Director connections.
-
SD Source Address
¶ Type: ADDRESS Default value: 0
-
Secure Erase Command
¶ Type: STRING Since Version: 15.2.1 Specify command that will be called when bareos unlinks files.
When files are no longer needed, Bareos will delete (unlink) them. With this directive, it will call the specified command to delete these files. See Secure Erase Command for details.
-
Statistics Collect Interval
¶ Type: PINT32 Default value: 30
-
Sub Sys Directory
¶ Type: DIRECTORY
-
TLS Allowed CN
¶ Type: STRING_LIST “Common Name”s (CNs) of the allowed peer certificates.
-
TLS Authenticate
¶ Type: BOOLEAN Default value: no Use TLS only to authenticate, not for encryption.
-
TLS CA Certificate Dir
¶ Type: DIRECTORY Path of a TLS CA certificate directory.
-
TLS CA Certificate File
¶ Type: DIRECTORY Path of a PEM encoded TLS CA certificate(s) file.
-
TLS Certificate
¶ Type: DIRECTORY Path of a PEM encoded TLS certificate.
-
TLS Certificate Revocation List
¶ Type: DIRECTORY Path of a Certificate Revocation List file.
-
TLS Cipher List
¶ Type: DIRECTORY List of valid TLS Ciphers.
-
TLS DH File
¶ Type: DIRECTORY Path to PEM encoded Diffie-Hellman parameter file. If this directive is specified, DH key exchange will be used for the ephemeral keying, allowing for forward secrecy of communications.
-
TLS Enable
¶ Type: BOOLEAN Default value: yes Enable TLS support.
Bareos can be configured to encrypt all its network traffic. Chapter TLS Configuration Directives explains how the Bareos components must be configured to use TLS.
-
TLS Key
¶ Type: DIRECTORY Path of a PEM encoded private key. It must correspond to the specified “TLS Certificate”.
-
TLS Require
¶ Type: BOOLEAN Default value: no Without setting this to yes, Bareos can fall back to use unencrypted connections. Enabling this implicitly sets “TLS Enable = yes”.
-
TLS Verify Peer
¶ Type: BOOLEAN Default value: no If disabled, all certificates signed by a known CA will be accepted. If enabled, the CN of a certificate must the Address or in the “TLS Allowed CN” list.
-
Ver Id
¶ Type: STRING
-
Working Directory
¶ Type: DIRECTORY Default value: /var/lib/bareos (platform specific) This directive specifies a directory in which the Storage daemon may put its status files. This directory should be used only by Bareos, but may be shared by other Bareos daemons provided the names given to each daemon are unique.
The following is a typical Storage daemon storage resource definition.
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.
configuration directive name | type of data | default value | remark |
---|---|---|---|
Description (Sd->Director) |
= STRING | ||
Key Encryption Key (Sd->Director) |
= AUTOPASSWORD | ||
Maximum Bandwidth Per Job (Sd->Director) |
= SPEED | ||
Monitor (Sd->Director) |
= BOOLEAN | ||
Name (Sd->Director) |
= NAME | required | |
Password (Sd->Director) |
= AUTOPASSWORD | required | |
TLS Allowed CN (Sd->Director) |
= STRING_LIST | ||
TLS Authenticate (Sd->Director) |
= BOOLEAN | no | |
TLS CA Certificate Dir (Sd->Director) |
= DIRECTORY | ||
TLS CA Certificate File (Sd->Director) |
= DIRECTORY | ||
TLS Certificate (Sd->Director) |
= DIRECTORY | ||
TLS Certificate Revocation List (Sd->Director) |
= DIRECTORY | ||
TLS Cipher List (Sd->Director) |
= DIRECTORY | ||
TLS DH File (Sd->Director) |
= DIRECTORY | ||
TLS Enable (Sd->Director) |
= BOOLEAN | yes | |
TLS Key (Sd->Director) |
= DIRECTORY | ||
TLS Require (Sd->Director) |
= BOOLEAN | no | |
TLS Verify Peer (Sd->Director) |
= BOOLEAN | no |
-
Description
¶ Type: STRING
-
Key Encryption Key
¶ Type: AUTOPASSWORD This key is used to encrypt the Security Key that is exchanged between the Director and the Storage Daemon for supporting Application Managed Encryption (AME). For security reasons each Director should have a different Key Encryption Key.
-
Maximum Bandwidth Per Job
¶ Type: SPEED
-
Monitor
¶ Type: BOOLEAN If Monitor is set to no (default), this director will have full access to this Storage daemon. If Monitor is set to yes, this director will only be able to fetch the current status of this Storage daemon.
Please note that if this director is being used by a Monitor, we highly recommend to set this directive to yes to avoid serious security problems.
-
Name
¶ Required: True Type: NAME Specifies the Name of the Director allowed to connect to the Storage daemon. This directive is required.
-
Password
¶ Required: True Type: AUTOPASSWORD Specifies the password that must be supplied by the above named Director. This directive is required.
-
TLS Allowed CN
¶ Type: STRING_LIST “Common Name”s (CNs) of the allowed peer certificates.
-
TLS Authenticate
¶ Type: BOOLEAN Default value: no Use TLS only to authenticate, not for encryption.
-
TLS CA Certificate Dir
¶ Type: DIRECTORY Path of a TLS CA certificate directory.
-
TLS CA Certificate File
¶ Type: DIRECTORY Path of a PEM encoded TLS CA certificate(s) file.
-
TLS Certificate
¶ Type: DIRECTORY Path of a PEM encoded TLS certificate.
-
TLS Certificate Revocation List
¶ Type: DIRECTORY Path of a Certificate Revocation List file.
-
TLS Cipher List
¶ Type: DIRECTORY List of valid TLS Ciphers.
-
TLS DH File
¶ Type: DIRECTORY Path to PEM encoded Diffie-Hellman parameter file. If this directive is specified, DH key exchange will be used for the ephemeral keying, allowing for forward secrecy of communications.
-
TLS Enable
¶ Type: BOOLEAN Default value: yes Enable TLS support.
Bareos can be configured to encrypt all its network traffic. Chapter TLS Configuration Directives explains how the Bareos components must be configured to use TLS.
-
TLS Key
¶ Type: DIRECTORY Path of a PEM encoded private key. It must correspond to the specified “TLS Certificate”.
-
TLS Require
¶ Type: BOOLEAN Default value: no Without setting this to yes, Bareos can fall back to use unencrypted connections. Enabling this implicitly sets “TLS Enable = yes”.
-
TLS Verify Peer
¶ Type: BOOLEAN Default value: no If disabled, all certificates signed by a known CA will be accepted. If enabled, the CN of a certificate must the Address or in the “TLS Allowed CN” list.
The following is an example of a valid Director resource definition:
NDMP Resource¶
The NDMP Resource specifies the authentication details of each NDMP client. There may be multiple NDMP resources for a single Storage daemon. In general, the properties specified within the NDMP resource are specific to one client.
configuration directive name | type of data | default value | remark |
---|---|---|---|
Auth Type (Sd->Ndmp) |
= AUTH_TYPE | None | |
Description (Sd->Ndmp) |
= STRING | ||
Log Level (Sd->Ndmp) |
= PINT32 | 4 | |
Name (Sd->Ndmp) |
= NAME | required | |
Password (Sd->Ndmp) |
= AUTOPASSWORD | required | |
Username (Sd->Ndmp) |
= STRING | required |
-
Auth Type
¶ Type: AUTH_TYPE Default value: None Specifies the authentication type that must be supplied by the above named NDMP Client. This directive is required.
The following values are allowed:
- None - Use no password
- Clear - Use clear text password
- MD5 - Use MD5 hashing
-
Description
¶ Type: STRING
-
Log Level
¶ Type: PINT32 Default value: 4 Specifies the NDMP Loglevel which overrides the global NDMP loglevel for this client.
-
Name
¶ Required: True Type: NAME Specifies the name of the NDMP Client allowed to connect to the Storage daemon. This directive is required.
-
Password
¶ Required: True Type: AUTOPASSWORD Specifies the password that must be supplied by the above named NDMP Client. This directive is required.
-
Username
¶ Required: True Type: STRING Specifies the username that must be supplied by the above named NDMP Client. This directive is required.
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.
-
Alert Command
¶ Type: STRNAME This specifies an external program to be called at the completion of each Job after the device is released. The purpose of this command is to check for Tape Alerts, which are present when something is wrong with your tape drive (at least for most modern tape drives). The same substitution characters that may be specified in the Changer Command may also be used in this string. For more information, see the Autochanger Support chapter.
Note, it is not necessary to have an autochanger to use this command. The example below uses the tapeinfo program that comes with the mtx package, but it can be used on any tape drive. However, you will need to specify a
Changer Device (Sd->Device)
directive so that the generic SCSI device name can be edited into the command (with the %c).An example of the use of this command to print Tape Alerts in the Job report is:
and an example output when there is a problem could be:
-
Always Open
¶ Type: BIT Default value: yes If Yes, Bareos will always keep the device open unless specifically unmounted by the Console program. This permits Bareos to ensure that the tape drive is always available, and properly positioned. If you set AlwaysOpen to no Bareos 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. The next time Bareos wants to append to a tape on a drive that was freed, Bareos will rewind the tape and position it to the end. To avoid unnecessary tape positioning and to minimize unnecessary operator intervention, it is highly recommended that Always Open = yes. This also ensures that the drive is available when Bareos 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 Bareos job will block.
For File storage, this directive is ignored. For a FIFO storage device, you must set this to No.
Please note that if you set this directive to No Bareos 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. In addition, with this directive set to no, certain multiple drive autochanger operations will fail. We strongly recommend to keep Always Open set to Yes
-
Archive Device
¶ Required: True Type: STRNAME Specifies where to read and write the backup data. The type of the Archive Device can be specified by the
Device Type (Sd->Device)
directive. If Device Type is not specified, Bareos tries to guess the Device Type accordingly to the type of the specified Archive Device file type.There are different types that are supported:
- device
- Usually the device file name of a removable storage device (tape drive), for example
/dev/nst0
or/dev/rmt/0mbn
, preferably in the “non-rewind” variant. In addition, on systems such as Sun, which have multiple 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. Bareos does not support SysV tape drive behavior. - directory
- If a directory is specified, it is used as file storage. The directory must be existing and be specified as absolute path. Bareos 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.
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 Bareos writes into the FIFO. When the Storage daemon starts the job, it will wait for
Maximum Open Wait (Sd->Device)
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
Run Before Job (Dir->Job)
directive. For this kind of device, you always want to specifyAlways Open (Sd->Device)
= no, because you want the Storage daemon to open it only when a job starts. Since a FIFO is a one way device, Bareos 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 the label command to avoid attempting to write a label.During a restore operation, if the Archive Device is a FIFO, Bareos will attempt to read from the FIFO, so you must have an external program that writes into the FIFO. Bareos will wait
Maximum Open Wait (Sd->Device)
seconds for the program to begin writing and will then time it out and terminate the job. As noted above, you may use theRun Before Job (Dir->Job)
to start the writer program at the beginning of the job.A FIFO device can also be used to test your configuration, see the Howto section.
GlusterFS Storage
don’t use this directive, but onlyDevice Type (Sd->Device)
andDevice Options (Sd->Device)
(this behavior have changed with Version >= 15.2.0).Ceph Object Store
don’t use this directive, but onlyDevice Type (Sd->Device)
andDevice Options (Sd->Device)
. (this behavior have changed with Version >= 15.2.0).
-
Auto Deflate
¶ Type: IO_DIRECTION Since Version: 13.4.0 This is a parameter used by plugin-autoxflate-sd which allow you to transform a non compressed piece of data into a compressed piece of data on the storage daemon. e.g. Storage Daemon compression. You can either enable compression on the client and use the CPU cyclces there to compress your data with one of the supported compression algorithms. The value of this parameter specifies a so called io-direction currently you can use the following io-directions:
- in - compress data streams while reading the data from a device.
- out - compress data streams while writing the data to a device.
- both - compress data streams both when reading and writing to a device.
Currently only plain data streams are compressed (so things that are already compressed or encrypted will not be considered for compression.) Also meta-data streams are not compressed. The compression is done in a way that the stream is transformed into a native compressed data stream. So if you enable this and send the data to a filedaemon it will know its a compressed stream and will do the decompression itself. This also means that you can turn this option on and off at any time without having any problems with data already written.
This option could be used if your clients doesn’t have enough power to do the compression/decompression itself and you have enough network bandwidth. Or when your filesystem doesn’t have the option to transparently compress data you write to it but you want the data to be compressed when written.
-
Auto Deflate Algorithm
¶ Type: COMPRESSION_ALGORITHM Since Version: 13.4.0 This option specifies the compression algorithm used for the autodeflate option which is performed by the autoxflate-sd plugin. The algorithms supported are:
- GZIP - gzip level 1–9
- LZO
- LZFAST
- LZ4
- LZ4HC
-
Auto Deflate Level
¶ Type: PINT16 Default value: 6 Since Version: 13.4.0 This option specifies the level to be used when compressing when you select a compression algorithm that has different levels.
-
Auto Inflate
¶ Type: IO_DIRECTION Since Version: 13.4.0 This is a parameter used by plugin-autoxflate-sd which allow you to transform a compressed piece of data into a non compressed piece of data on the storage daemon. e.g. Storage Daemon decompression. You can either enable decompression on the client and use the CPU cyclces there to decompress your data with one of the supported compression algorithms. The value of this parameter specifies a so called io-direction currently you can use the following io-directions:
- in - decompress data streams while reading the data from a device.
- out - decompress data streams while writing the data to a device.
- both - decompress data streams both when reading and writing to a device.
This option allows you to write uncompressed data to for instance a tape drive that has hardware compression even when you compress your data on the client with for instance a low cpu load compression method (LZ4 for instance) to transfer less data over the network. It also allows you to restore data in a compression format that the client might not support but the storage daemon does. This only works on normal compressed datastreams not on encrypted datastreams or meta data streams.
-
Auto Select
¶ Type: BOOLEAN Default value: yes If this directive is set to yes, and the Device belongs to an autochanger, then when the Autochanger is referenced by the Director, this device can automatically be selected. If this directive is set to no, then the Device can only be referenced by directly using the Device name in the Director. This is useful for reserving a drive for something special such as a high priority backup or restore operations.
-
Autochanger
¶ Type: BIT Default value: no If set to yes, this device belongs to an automatic tape changer, and you must specify an Autochanger resource that points to this Device resource.
If set to no, the volume must be manually changed.
In the Bareos Director, the directive
Auto Changer (Dir->Storage)
should be set in correspondence.
-
Automatic Mount
¶ Type: BIT Default value: no If yes, permits the daemon to examine the device to determine if it contains a Bareos labeled volume. This is done initially when the daemon is started, and then at the beginning of each job. This directive is particularly important if you have set
Always Open (Sd->Device) = no
because it permits Bareos to attempt to read the device before asking the system operator to mount a tape. However, please note that the tape must be mounted before the job begins.
-
Backward Space File
¶ Type: BIT Default value: yes 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.
-
Backward Space Record
¶ Type: BIT Default value: yes If Yes, the archive device supports the tt 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. This function if enabled is used at the end of a Volume after writing the end of file and any ANSI/IBM labels to determine whether or not the last block was written correctly. If you turn this function off, the test will not be done. This causes no harm as the re-read process is precautionary rather than required.
-
Block Checksum
¶ Type: BIT Default value: yes You may turn off the Block Checksum (CRC32) code that Bareos uses when writing blocks to a Volume. Doing so can reduce the Storage daemon CPU usage slightly. It will also permit Bareos to read a Volume that has corrupted data.
It is not recommend to turn this off, particularly on older tape drives or for disk Volumes where doing so may allow corrupted data to go undetected.
-
Block Positioning
¶ Type: BIT Default value: yes This directive tells Bareos not to use block positioning when doing restores. Turning this directive off can cause Bareos to be extremely slow when restoring files. You might use this directive if you wrote your tapes with Bareos in variable block mode (the default), but your drive was in fixed block mode.
-
Bsf At Eom
¶ Type: BIT Default value: no If no, no special action is taken by Bareos with the End of Medium (end of tape) is reached because the tape will be positioned after the last EOF tape mark, and Bareos can append to the tape as desired. However, on some systems, such as FreeBSD, when Bareos 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 Bareos appends from that point, all the appended data will be lost. The solution for such systems is to specify
Bsf At Eom (Sd->Device) = yes
which causes Bareos to backspace over the second EOF mark. Determination of whether or not you need this directive is done using the test command in the btape program.
-
Changer Command
¶ Type: STRNAME This directive can be specified if this device is used with an autochanger and you want to overwrite the default
Changer Command (Sd->Autochanger)
. Normally, this directive will be specified only in the Autochanger Resource, which is then used for all devices. However, you may also specify the different Changer Command in each Device resource.
-
Changer Device
¶ Type: STRNAME This directive should be specified if
- this device is used with an autochanger and you want to overwrite the default
Changer Device (Sd->Autochanger)
or - if you have a standard tape drive and want to use the
Alert Command (Sd->Device)
.
The specified device must be a generic SCSI device.
For details, see the Autochanger Support chapter.
- this device is used with an autochanger and you want to overwrite the default
-
Check Labels
¶ Type: BIT Default value: no If you intend to read ANSI or IBM labels, this must be set. Even if the volume is not ANSI labeled, you can set this to yes, and Bareos will check the label type. Without this directive set to yes, Bareos will assume that labels are of Bareos type and will not check for ANSI or IBM labels. In other words, if there is a possibility of Bareos encountering an ANSI/IBM label, you must set this to yes.
-
Close On Poll
¶ Type: BIT Default value: no If Yes, Bareos 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, Bareos will recognize the drive on the next poll and automatically continue with the backup. Please see above for more details.
-
Collect Statistics
¶ Type: BOOLEAN Default value: yes
-
Description
¶ Type: STRING The Description directive provides easier human recognition, but is not used by Bareos directly.
-
Device Options
¶ Type: STRING Since Version: 15.2.0 Some
Device Type (Sd->Device)
require additional configuration. This can be specified in this directive, e.g. forDroplet Storage Backend GFAPI Storage Backend Rados Storage Backend
Before the Device Options directive have been introduced, these options have to be configured in the
Archive Device (Sd->Device)
directive. This behavior have changed with Version >= 15.2.0.
-
Device Type
¶ Type: DEVICE_TYPE The Device Type specification allows you to explicitly define the kind of device you want to use. It may be one of the following:
- Tape
- is used to access tape device and thus has sequential access. Tape devices are controlled using ioctl() calls.
- File
- tells Bareos that the device is a file. It may either be a file defined on fixed medium or a removable filesystem such as USB. All files must be random access devices.
- Fifo
- is a first-in-first-out sequential access read-only or write-only device.
- GFAPI (GlusterFS)
is used to access a GlusterFS storage. It must be configured using
Device Options (Sd->Device)
. For details, refer to GFAPI Storage Backend.Version >= 14.2.2
- Rados (Ceph Object Store)
is used to access a Ceph object store. It must be configured using
Device Options (Sd->Device)
. For details, refer to Rados Storage Backend.Version >= 14.2.2
- Droplet
is used to access an object store supported by libdroplet, most notably S3. For details, refer to Droplet Storage Backend.
Version >= 17.2.7
The Device Type directive is not required in all cases. If it is not specified, Bareos will attempt to guess what kind of device has been specified using the
Archive Device (Sd->Device)
specification supplied. There are several advantages to explicitly specifying the Device Type. First, on some systems, block and character devices have the same type. Secondly, if you explicitly specify the Device Type, the mount point need not be defined until the device is opened. This is the case with most removable devices such as USB. If the Device Type is not explicitly specified, then the mount point must exist when the Storage daemon starts.
-
Diagnostic Device
¶ Type: STRNAME
-
Drive Crypto Enabled
¶ Type: BOOLEAN The default for this directive is No. If Yes the storage daemon can perform so called Application Managed Encryption (AME) using a special Storage Daemon plugin which loads and clears the Encryption key using the SCSI SPIN/SPOUT protocol.
-
Drive Index
¶ Type: PINT16 The Drive Index that you specify is passed to the
Changer Command (Sd->Device)
. 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 must specify multiple Bareos Device resources (one for each drive). The first Device should have the Drive Index set to 0, and the second Device Resource should contain a Drive Index set to 1, and so on. This will then permit you to use two or more drives in your autochanger.For details, refer to Multiple Devices.
-
Drive Tape Alert Enabled
¶ Type: BOOLEAN
-
Eof On Error Is Eot
¶ Type: BOOLEAN Since Version: 18.2.4 If Yes, Bareos will treat any read error at an end-of-file mark as end-of-tape. You should only set this option if your tape-drive fails to detect end-of-tape while reading.
-
Fast Forward Space File
¶ Type: BIT Default value: yes 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 tt ioctl tt 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 medium.
-
Forward Space File
¶ Type: BIT Default value: yes If Yes, the archive device must support the tt MTFSF ioctl to forward space by file marks. If No, data must be read to advance the position on the device.
-
Forward Space Record
¶ Type: BIT Default value: yes 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.
-
Free Space Command
¶ Type: STRNAME Since Version: deprecated
-
Hardware End Of File
¶ Type: BIT Default value: yes
-
Hardware End Of Medium
¶ Type: BIT Default value: yes All modern (after 1998) tape drives should support this feature. In doubt, use the btape program to test your drive to see whether or not it supports this function. If the archive device does not support the end of medium ioctl request tt MTEOM, set this parameter to No. The storage daemon will then use the forward space file function to find 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.
-
Label Block Size
¶ Type: PINT32 Default value: 64512 The storage daemon will write the label blocks with the size configured here. Usually, you will not need to change this directive.
For more information on this directive, please see Tapespeed and blocksizes.
-
Label Media
¶ Type: BIT Default value: 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 (Dir->Pool)
record in each Pool resource. If this is No as by default, Bareos 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.
-
Label Type
¶ Type: LABEL Defines the label type to use, see section Tape Labels: ANSI or IBM. This directive is implemented in the Director Pool resource (
Label Type (Dir->Pool)
) and in the SD Device resource. If it is specified in the the SD Device resource, it will take precedence over the value passed from the Director to the SD. If it is set to a non-default value, make sure to also enableCheck Labels (Sd->Device)
.
-
Maximum Block Size
¶ Type: MAX_BLOCKSIZE The Storage daemon will always 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. 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).
Warning
If your are using LTO drives, changing the block size after labeling the tape will result into unreadable tapes.
Please read chapter Tapespeed and blocksizes, to see how to tune this value in a safe manner.
-
Maximum Changer Wait
¶ Type: TIME Default value: 300 This directive specifies the maximum amount of time that Bareos will wait for the changer to respond to a command (e.g. load). If you have a slow autoloader you may want to set it longer.
If the autoloader program fails to respond in this time, Bareos will invalidate the volume slot number stored in the catalog and try again. If no additional changer volumes exist, Bareos will ask the operator to intervene.
-
Maximum Concurrent Jobs
¶ Type: PINT32 This directive specifies the maximum number of Jobs that can run concurrently on a specified Device. Using this directive, it is possible to have different Jobs using multiple drives, because when the Maximum Concurrent Jobs limit is reached, the Storage Daemon will start new Jobs on any other available compatible drive. This facilitates writing to multiple drives with multiple Jobs that all use the same Pool.
Warning
If
Device Type (Sd->Device)
is “Droplet” then Maximum Concurrent Jobs is limited to 1.
-
Maximum File Size
¶ Type: SIZE64 Default value: 1000000000 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. This directive creates EOF marks only on tape media. However, regardless of the medium type (tape, disk, USB …) each time a the Maximum File Size is exceeded, a record is put into the catalog database that permits seeking to that position on the medium for restore operations. If you set this to a small value (e.g. 1MB), you will generate lots of database records (JobMedia) and may significantly increase CPU/disk overhead.
If you are configuring an modern drive like LTO-4 or newer, you probably will want to set the Maximum File Size to 20GB or bigger to avoid making the drive stop to write an EOF mark.
For more info regarding this parameter, read Tapespeed and blocksizes.
Note, this directive does not limit the size of Volumes that Bareos will create regardless of whether they are tape or disk volumes. It changes only the number of EOF marks on a tape and the number of block positioning records that are generated. If you want to limit the size of all Volumes for a particular device, use the use the
Maximum Volume Bytes (Dir->Pool)
directive.
-
Maximum Job Spool Size
¶ Type: SIZE64 where the bytes specify the maximum spool size for any one job that is running. The default is no limit.
-
Maximum Network Buffer Size
¶ Type: PINT32 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.
The default size was chosen to be relatively large but not too big in the case that you are transmitting data over Internet. It is clear that on a high speed local network, you can increase this number and improve performance. For example, some users have found that if you use a value of 65,536 bytes they get five to ten times the throughput. Larger values for most users don’t seem to improve performance. If you are interested in improving your backup speeds, this is definitely a place to experiment. You will probably also want to make the corresponding change in each of your File daemons conf files.
-
Maximum Open Volumes
¶ Type: PINT32 Default value: 1
-
Maximum Open Wait
¶ Type: TIME Default value: 300 This directive specifies the maximum amount of time that Bareos will wait for a device that is busy. If the device cannot be obtained, the current Job will be terminated in error. Bareos will re-attempt to open the drive the next time a Job starts that needs the the drive.
-
Maximum Part Size
¶ Type: SIZE64 Since Version: deprecated
-
Maximum Rewind Wait
¶ Type: TIME Default value: 300 This directive specifies the maximum time in seconds for Bareos to wait for a rewind before timing out. If this time is exceeded, Bareos will cancel the job.
-
Maximum Spool Size
¶ Type: SIZE64 where the bytes specify the maximum spool size for all jobs that are running. The default is no limit.
-
Maximum Volume Size
¶ Type: SIZE64 Since Version: deprecated Normally,
Maximum Volume Bytes (Dir->Pool)
should be used instead. Limit the number of bytes that will be written onto a given volume on the archive device. This directive is used mainly in testing Bareos to simulate a small Volume.
-
Media Type
¶ Required: True Type: STRNAME The specified value names the type of media supported by this device, for example, “DLT7000”. Media type names are arbitrary in that you set them to anything you want, but they must be known to the volume database to keep track of which storage daemons can read which volumes. In general, each different storage type should have a unique Media Type associated with it. 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 the Media Type is used to determine which storage device Bareos will select during restore. Thus you should probably use the same Media Type specification for all drives where the Media can be freely interchanged. This is not generally an issue if you have a single Storage daemon, but it is with multiple Storage daemons, especially if they have incompatible media.
For example, if you specify a Media Type of “DDS-4” then during the restore, Bareos will be able to choose any Storage Daemon that handles “DDS-4”. If you have an autochanger, you might want to name the Media Type in a way that is unique to the autochanger, unless you wish to possibly use the Volumes in other drives. 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.
In addition, if you are using disk storage, each Device resource will generally have a different mount point or directory. In order for Bareos to select the correct Device resource, each one must have a unique Media Type.
-
Minimum Block Size
¶ Type: PINT32 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. 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 the case for some non-random access devices (tape drives), set the Minimum block size and the Maximum block size to the same value. The default is that both the minimum and maximum block size are zero and the default block size is 64,512 bytes.
For example, suppose you want a fixed block size of 100K bytes, then you would specify:
Please note that if you specify a fixed block size as shown above, the tape drive must either be in variable block size mode, or if it is in fixed block size mode, the block size (generally defined by mt) must be identical to the size specified in Bareos – otherwise when you attempt to re-read your Volumes, you will get an error.
If you want the block size to be variable but with a 63K minimum and 200K maximum (and default as well), you would specify:
-
Mount Command
¶ Type: STRNAME This directive specifies the command that must be executed to mount devices such as many USB devices. Before the command is executed, %a is replaced with the Archive Device, and %m with the Mount Point.
See the Edit Codes for Mount and Unmount Directives section below for more details of the editing codes that can be used in this directive.
If you need to specify multiple commands, create a shell script.
-
Mount Point
¶ Type: STRNAME Directory where the device can be mounted. This directive is used only for devices that have Requires Mount enabled such as USB file devices.
-
Name
¶ Required: True Type: NAME Unique identifier of the resource.
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 (Sd->Device)
directive. The name you specify here is also used in your Director’s configuration file on the Storage Resource in its Storage resource.
-
No Rewind On Close
¶ Type: BOOLEAN Default value: yes If Yes the storage daemon will not try to rewind the device on closing the device e.g. when shutting down the Storage daemon. This allows you to do an emergency shutdown of the Daemon without the need to wait for the device to rewind. On restarting and opening the device it will get a rewind anyhow and this way services don’t have to wait forever for a tape to spool back.
-
Offline On Unmount
¶ Type: BIT Default value: no If Yes the archive device must support the tt MTOFFL ioctl to rewind and take the volume offline. In this case, Bareos will issue the offline (eject) request before closing the device during the unmount command. If No Bareos 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.
If you are using a Linux 2.6 kernel or other OSes such as FreeBSD or Solaris, the Offline On Unmount will leave the drive with no tape, and Bareos will not be able to properly open the drive and may fail the job.
-
Query Crypto Status
¶ Type: BOOLEAN The default for this directive is No. If Yes the storage daemon may query the tape device for it security status. This only makes sense when Drive Crypto Enabled is also set to yes as the actual query is performed by the same Storage Daemon plugin and using the same SCSI SPIN protocol.
-
Random Access
¶ Type: BIT Default value: 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. This should be set to Yes for all file systems such as USB, and fixed files. It should be set to No for non-random access devices such as tapes and named pipes.
-
Removable Media
¶ Type: BIT Default value: yes If Yes, this device supports removable media (for example tapes). If No, media cannot be removed (for example, an intermediate backup area on a hard disk). If Removable media is enabled on a File device (as opposed to a tape) the Storage daemon will assume that device may be something like a USB device that can be removed or a simply a removable harddisk. When attempting to open such a device, if the Volume is not found (for File devices, the Volume name is the same as the Filename), then the Storage daemon will search the entire device looking for likely Volume names, and for each one found, it will ask the Director if the Volume can be used. If so, the Storage daemon will use the first such Volume found. Thus it acts somewhat like a tape drive – if the correct Volume is not found, it looks at what actually is found, and if it is an appendable Volume, it will use it.
If the removable medium is not automatically mounted (e.g. udev), then you might consider using additional Storage daemon device directives such as Requires Mount, Mount Point, Mount Command, and Unmount Command, all of which can be used in conjunction with Removable Media.
-
Requires Mount
¶ Type: BIT Default value: no When this directive is enabled, the Storage daemon will submit a Mount Command before attempting to open the device. You must set this directive to yes for removable file systems such as USB devices that are not automatically mounted by the operating system when plugged in or opened by Bareos. It should be set to no for all other devices such as tapes and fixed filesystems. It should also be set to no for any removable device that is automatically mounted by the operating system when opened (e.g. USB devices mounted by udev or hotplug). This directive indicates if the device requires to be mounted using the Mount Command. To be able to write devices need a mount, the following directives must also be defined: Mount Point, Mount Command, and Unmount Command.
-
Spool Directory
¶ Type: DIRECTORY specifies the name of the directory to be used to store the spool files for this device. This directory is also used to store temporary part files when writing to a device that requires mount (USB). The default is to use the working directory.
-
Two Eof
¶ Type: BIT Default value: no If Yes, Bareos 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 No, Bareos will only write one end of file to terminate the tape.
-
Unmount Command
¶ Type: STRNAME This directive specifies the command that must be executed to unmount devices such as many USB devices. Before the command is executed, %a is replaced with the Archive Device, and %m with the Mount Point.
Most frequently, you will define it as follows:
See the Edit Codes for Mount and Unmount Directives section below for more details of the editing codes that can be used in this directive.
If you need to specify multiple commands, create a shell script.
-
Use Mtiocget
¶ Type: BIT Default value: yes If No, the operating system is not required to support keeping track of the file number and reporting it in the (MTIOCGET ioctl). If you must set this to No, Bareos will do the proper file position determination, but it is very unfortunate because it means that tape movement is very inefficient. Fortunately, this operation system deficiency seems to be the case only on a few *BSD systems. Operating systems known to work correctly are Solaris, Linux and FreeBSD.
-
Volume Capacity
¶ Type: SIZE64
-
Volume Poll Interval
¶ Type: TIME Default value: 300 If the time specified on this directive is non-zero, Bareos will periodically poll (or read) the drive at the specified interval to see if a new volume has been mounted. If the time interval is zero, no polling will occur. This directive can be useful if you want to avoid operator intervention via the console. Instead, the operator can simply remove the old volume and insert the requested one, and Bareos on the next poll will recognize the new tape and continue. Please be aware that if you set this interval too small, you may excessively wear your tape drive if the old tape remains in the drive, since Bareos will read it on each poll.
-
Write Part Command
¶ Type: STRNAME Since Version: deprecated
Edit Codes for Mount and Unmount Directives¶
Before submitting the Mount Command, or Unmount Command directives to the operating system, Bareos performs character substitution of the following characters:
%% = %
%a = Archive device name
%e = erase (set if cannot mount and first part)
%n = part number
%m = mount point
%v = last part name (i.e. filename)
Devices that require a mount (USB)¶
Requires Mount (Sd->Device)
- You must set this directive to yes for removable devices such as
USB unless they are automounted, and to no for all other devices
(tapes/files). This directive indicates if the device requires to be
mounted to be read, and if it must be written in a special way. If it
set,
Mount Point (Sd->Device)
,Mount Command (Sd->Device)
andUnmount Command (Sd->Device)
directives must also be defined. Mount Point (Sd->Device)
- Directory where the device can be mounted.
Mount Command (Sd->Device)
Command that must be executed to mount the device. Before the command is executed, %a is replaced with the Archive Device, and %m with the Mount Point.
Most frequently, you will define it as follows:
For some media, you may need multiple commands. If so, it is recommended that you use a shell script instead of putting them all into the Mount Command. For example, instead of this:
Where that script contains:
#!/bin/sh ndasadmin enable -s 1 -o w sleep 2 mount /dev/ndas-00323794-0p1 /backup
Similar consideration should be given to all other Command parameters.
Unmount Command (Sd->Device)
Command that must be executed to unmount the device. Before the command is executed, %a is replaced with the Archive Device, and %m with the Mount Point.
Most frequently, you will define it as follows:
If you need to specify multiple commands, create a shell script.
Autochanger Resource¶
The Autochanger resource supports single or multiple drive autochangers by grouping one or more Device resources into one unit called an autochanger in Bareos (often referred to as a “tape library” by autochanger manufacturers).
configuration directive name | type of data | default value | remark |
---|---|---|---|
Changer Command (Sd->Autochanger) |
= STRNAME | required | |
Changer Device (Sd->Autochanger) |
= STRNAME | required | |
Description (Sd->Autochanger) |
= STRING | ||
Device (Sd->Autochanger) |
= RESOURCE_LIST | required | |
Name (Sd->Autochanger) |
= NAME | required |
-
Changer Command
¶ Required: True Type: STRNAME This command specifies an external program and parameter to be called that will automatically change volumes as required by Bareos. This command is invoked each time that Bareos wishes to manipulate the autochanger.
Most frequently, you will specify the Bareos supplied mtx-changer script.
The following substitutions are made in the command before it is sent to the operating system for execution:
- %%
- %
- %a
- archive device name
- %c
- changer device name
- %d
- changer drive index base 0
- %f
- Client’s name
- %j
- Job name
- %o
- command (loaded, load, or unload)
- %s
- Slot base 0
- %S
- Slot base 1
- %v
- Volume name
A typical setting for this is
Changer Command (Sd->Autochanger) = "/usr/lib/bareos/scripts/mtx-changer %c %o %S %a %d"
.Details of the three commands currently used by Bareos (loaded, load, unload) as well as the output expected by Bareos are given in the Bareos Autochanger Interface section.
If it is specified here, it needs not to be specified in the Device resource. If it is also specified in the Device resource, it will take precedence over the one specified in the Autochanger resource.
-
Changer Device
¶ Required: True Type: STRNAME The specified device must be the generic SCSI device of the autochanger.
The changer device is additional to the the
Archive Device (Sd->Device)
. This is because most autochangers are controlled through a different device than is used for reading and writing the tapes. For example, on Linux, one normally uses the generic SCSI interface for controlling the autochanger, but the standard SCSI interface for reading and writing the tapes.On Linux, for the
Archive Device (Sd->Device) = /dev/nst0
, you would typically haveChanger Device (Sd->Device) = /dev/sg0
.On FreeBSD systems, the changer device will typically be on
/dev/pass0
through/dev/passN
.On Solaris, the changer device will typically be some file under
/dev/rdsk
.Please ensure that your Storage daemon has permission to access this device.
It can be overwritten per device using the
Changer Device (Sd->Device)
directive.
-
Description
¶ Type: STRING
-
Device
¶ Required: True Type: RESOURCE_LIST Specifies the names of the Device resource or resources that correspond to the autochanger drive. If you have a multiple drive autochanger, you must specify multiple Device names, each one referring to a separate Device resource that contains a Drive Index specification that corresponds to the drive number base zero. You may specify multiple device names on a single line separated by commas, and/or you may specify multiple Device directives.
-
Name
¶ Required: True Type: NAME Specifies the Name of the Autochanger. This name is used in the Director’s Storage definition to refer to the autochanger.
The following is an example of a valid Autochanger resource definition:
Please note that it is important to include the Autochanger (Sd->Device) = yes
directive in each device definition that belongs to an Autochanger. A device definition should not belong to more than one Autochanger resource.
Also, your Device (Dir->Storage)
must refer to the Autochanger’s resource name rather than a name of one of the Devices.
For details refer to the Autochanger Support chapter.
Messages Resource¶
For a description of the Messages Resource, please see the Messages Configuration chapter of this manual.