Skip to content

Latest commit

 

History

History
257 lines (162 loc) · 8.69 KB

File metadata and controls

257 lines (162 loc) · 8.69 KB

Storage Daemon Configuration

\ <single: Configuration> \ <single: Storage Daemon; Configuration> \ <single: Configuration; Storage Daemon>

The 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 <ConfigureChapter> chapter of this manual. The following Storage Resource definitions must be defined:

  • Storage <StorageResourceStorage> – to define the name of the Storage daemon.
  • Director <StorageResourceDirector> – to define the Director’s name and his access password.
  • Device <StorageResourceDevice> – to define the characteristics of your storage device (tape drive).
  • Messages <MessagesChapter> – to define where error and information messages are to be sent.

Following resources are optional:

  • StorageResourceAutochanger – to define Autochanger devices.
  • StorageResourceNDMP – to define the NDMP authentication context.

Storage Resource

\ <single: Resource; Storage> \ <single: 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.

The following is a typical Storage daemon storage resource definition.

#
# "Global" Storage daemon configuration specifications appear
# under the Storage resource.
#
Storage {
  Name = "Storage daemon"
  Address = localhost
}

Director Resource

\ <single: Resource; Director> \ <single: 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.

The following is an example of a valid Director resource definition:

Director {
  Name = MainDirector
  Password = my_secret_password
}

NDMP Resource

\ <single: Resource; NDMP> \ <single: 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.

Device Resource

\ <single: Resource; Device> \ <single: 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.

Edit Codes for Mount and Unmount Directives

\ <single: Edit Codes for Mount and Unmount Directives> \ <single: Mount and Unmount: use variables in 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)

\ <single: Devices that require a mount (USB)> :configsd/device/RequiresMount 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, :configsd/device/MountPoint, :configsd/device/MountCommand and :configsd/device/UnmountCommand directives must also be defined.

:configsd/device/MountPoint

Directory where the device can be mounted.

:configsd/device/MountCommand

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:

Mount Command = "/bin/mount -t iso9660 -o ro %a %m"

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:

Mount Command = "/usr/local/bin/mymount"

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.

:configsd/device/UnmountCommand

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:

Unmount Command = "/bin/umount %m"

If you need to specify multiple commands, create a shell script.

Autochanger Resource

\ <single: Autochanger Resource> \ <single: Resource; Autochanger>

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).

The following is an example of a valid Autochanger resource definition:

Autochanger {
  Name = "DDS-4-changer"
  Device = DDS-4-1, DDS-4-2, DDS-4-3
  Changer Device = /dev/sg0
  Changer Command = "/usr/lib/bareos/scripts/mtx-changer %c %o %S %a %d"
}
Device {
  Name = "DDS-4-1"
  Drive Index = 0
  Autochanger = yes
  ...
}
Device {
  Name = "DDS-4-2"
  Drive Index = 1
  Autochanger = yes
  ...
Device {
  Name = "DDS-4-3"
  Drive Index = 2
  Autochanger = yes
  Autoselect = no
  ...
}

Please note that it is important to include the :configsd/device/Autochanger = 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 :configdir/storage/Device must refer to the Autochanger’s resource name rather than a name of one of the Devices.

For details refer to the AutochangersChapter chapter.

Messages Resource

\ <single: Resource; Messages> \ <single: Messages; Resource>

For a description of the Messages Resource, please see the MessagesChapter chapter of this manual.