Create Bacula tape storage#

To write Bacula backups you need to have Bacula storage. The Bacula storage is the destination place where backups are written.

After fresh installing Bacula, there is not any the Bacula tape storage configuration ready to use. In this chapter you can learn how to configure the Bacula tape autochanger to work with Bacula.

What is required?#

  • Bacularis version 4.4.0 or greater.

  • Tape autochanger device where you want to store Bacula backups

  • Bacula Storage Daemon installed on the host with the tape autochanger.

  • If the Storage Daemon and autochanger are in remote location for the web interface, then on that remote host the Bacularis API needs to be installed and configured.

How to do it?#

Preparation#

To configure the tape autochanger, please check the autochanger tape drive device names in the system (ex. /dev/nst0, /dev/nst12 …) and the changer device name as well (ex: /dev/sg4, /dev/sg21 …). To get these details you can use the lsscsi -g command in the following way:

# lsscsi -g
[1:0:0:0]    disk    ATA      WDC  WDS100T1R0A 00WR  /dev/sda   /dev/sg0
[2:0:0:0]    disk    ATA      SSDPR-CX300-120  11.2  /dev/sdb   /dev/sg1
[3:0:0:0]    disk    ATA      WDC  WDS500G1R0A 10WR  /dev/sdc   /dev/sg2
[4:0:0:0]    disk    ATA      WDC  WDS100T1R0A 00WR  /dev/sdd   /dev/sg3
[7:0:0:0]    mediumx STK      L700             0107  /dev/sch2  /dev/sg6
[7:0:1:0]    tape    IBM      ULT3580-TD5      0107  /dev/st1   /dev/sg8
[7:0:2:0]    tape    IBM      ULT3580-TD5      0107  /dev/st0   /dev/sg7
[7:0:3:0]    tape    IBM      ULT3580-TD4      0107  /dev/st4   /dev/sg12
[7:0:4:0]    tape    IBM      ULT3580-TD4      0107  /dev/st12  /dev/sg20

On the listing above we can see one autochanger L700 with the device name /dev/sg6.

Note

For accessing the autochanger devices Bacula uses SCSI generic device names (/dev/sgX), not SCSI changer device names (/dev/schX).

On the listing we can also see four tape drives:

  • two ULT3580-TD4 with devices /dev/nst4 and /dev/nst12

  • two ULT3580-TD5 with devices /dev/nst1 and /dev/nst0

Note

For accessing the tape drives Bacula uses the SCSI tape drive devices in a non-rewinding form. It means that in Bacula configuration for device /dev/st4 we use /dev/nst4. The n letter in the device name has the non-rewind meaning.

In modern operating systems the devices can be accessible via the symbolic links created by the UDEV system device manager. These links are more friendly than raw devices like /dev/nstX or /dev/sgX and - what is more important - these links are constant and independent on changes in the nst or sg type device names. For tape devices the symbolic links you can find in paths like this: /dev/tape/by-id/. As you can easily notice the symbolic link names are the tape device unique hardware indentifiers and they are bound to the st or sg devices.

Example:

  • link /dev/tape/by-id/scsi-XYZZY_C4-nst can be bound to /dev/nst19

  • link /dev/tape/by-id/scsi-SSTK_L700_XYZZY_C-changer can be bound to /dev/sg4

For Bacula it does not matter if you use the device files like /dev/sg or /dev/nst or you use links from /dev/tape/by-id/. Both definitions are valid, the /dev/tape/by-id/ is just a good practice that is the device number change resistant.

Once we know the autochanger device and tape drives devices we can start configuring them.

In the Bacularis web interface please go to the Storage page available in the main menu, then click the Add tape storage button. This action will direct you to the new tape storage wizard.

Step 1 - General#

First, in the wizard in the Storage Daemon API host field please select the API host where is the Storage Daemon installed and where is connected the tape autochanger.

On the question Do you already have tape storage configured in Bacula? you can choose No option.

Now you can define the new storage name (and optional description).

On the question What storage type would you like to create? please answer Single-drive or multi-drive tape storage with changer (autochanger).

Step 2 - Storage#

On the question What changer does your tape device have? you need to define two fields:

  • Changer device file - here you type the autochanger device file or device link.

  • Changer command - this is place for defining a script by using which the Bacula Storage Daemon will manage the autochanger actions like load/unload tapes, list slots …etc. Please don’t worry, you do not need to prepare any new script because Bacula provides it for SCSI changers. It is named mtx-changer.

  • On the DEB-based systems with Bacula installed from the system repositories this script is in /etc/bacula/scripts/mtx-changer.

  • On the RPM-based systems with Bacula installed from the system repositories this script is in /usr/libexec/bacula/mtx-changer.

Please put it in the Changer command the mtx-changer script with full path and the following parameters:

Example for DEB-based systems with Bacula installed from the system repositories:

/etc/bacula/scripts/mtx-changer %c %o %S %a %d

For RPM-based systems with Bacula installed from the system repositories:

/usr/libexec/bacula/mtx-changer %c %o %S %a %d

In section with the question What tape drives does your tape device have? please define all the autochanger tape drive device names.

On the question What is storage media type? please define desired media type name. It can be any string that in case tape storage it can be characteristic for your tape type (or the tape generation), for example: MyLTO6Tape, TapeL8, BlueTape …etc.

Step 3 - Summary#

On the last wizard step please review the wizard summary and finalize the wizard. You will be asked about allowing Bacularis to restart the Bacula Storage component.

Important notes#

If during finalizing the wizard you do not allow Bacularis to restart the Bacula Storage component, all the new Bacula tape storage configuration will be created but it will not be ready to use until the Storage Daemon restart. It is because to apply new storage configuration the Storage Daemon needs to be restarted.

The Storage Daemon can be restarted at the end of the new tape storage wizard or it can be done later on the storage details page. You can go to the storage details page using the following path:

[Main menu] => [Page: Storage] => [Select storage in table] => [Button: Details]

Video guide#

Here you can watch the video guide that shows installing Bacula tape storage with the Bacularis new storage wizard.