Testing Tape Autochanger/Drives

See Test the Tape Drive Device With Btape Utility.

Testing Tape Autochanger for the Best Performance

Testing the tape autochanger is a very important task in every Bacula setup and it should be done before running any production backup because it will:

  • identify any connectivity, hardware or configuration issues preventing data to be backed up efficiently and safely

  • assure the best performance of Bacula Enterprise working with the tested tape autochanger

  • confirm the best settings so no other changes will be required that would make the overall Bacula Enterprise configuration more complex.

Testing a Single Device or Tape Autochanger

Tests should be performed with the btape utility to verify the Autochanger configuration and if m and mtx commands are running correctly. Preferably, the btape tests are done before going to production. Additionally, a special speed test will perform raw data and random data tests on your tape device with your current configuration to test the performance of your device.

Performing a Writing/Reading Device Check

Before running the btape tests, a working SD configuration to connect to the Tape Library must be functional. Please refer to vendor and operating system manuals in order to install this. The Storage Daemon connected to the Tape Library should be shutdown before running the btape test, so no backup jobs will interfere. As an example, the first tape drive (LTO-drive0) will be used for this test.

Note

A blank and empty tape that has not been used before with other third part vendor or legacy backup tools, or which has been blanked manually must be used for these tests.

The commands used below are examples only, you will need to adapt them to your current settings and environment.

systemctl stop bacula-sd

Then, the status of the tape library should be reviewed:

mtx -f /dev/tape/by-serial/changer-device status

The tape drive to test, for example the “Data Transfer Element 0”, should be empty. If not, please unload it with mtx or your tape library interface. Then, a tape should be loaded in the Tape Drive (Drive 0, index=0 in the Device{} resource in bacula-sd.conf or in the related resource) that will be tested with a new tape media (eg. from slot 22 in the command below):

mtx -f /dev/tape/by-serial/changer load 22 0

Then, btape should be run:

/opt/bacula/bin/btape -v -c /opt/bacula/etc/bacula-sd.conf LTO-drive0

where “LTO-drive0” is the name of the tape drive to test in your SD configuration, at drive index 0 in this example.

The actual testing routine can be started with

test

It will create some output which needs to be carefully assessed.

If any error happens with this first test, it must be fixed. Once fixed, please continue with the next step, performing a speed check (The file_size parameter is important in order to write a file bigger than Maximum File Size defined in the Device{} resource).

speed file_size=20

Two directives can be fine tuned in a device configuration so it leads to a faster writing process to a tape drive.

Maximum File Size

For LTO-5 tapes, a value between 8GiB and 12GiB is indicated and between 8GiB and 24GiB for LTO-6; in general, with higher capacity, higer speed tape drives, the file sizes will be increased. The larger this logical file size is, the longer it will take to restore a single file as the tape will need to read more unneeded data before reaching the desired single file. However, backups will be faster as less End-of-File marks need to be written.

Maximum Block Size

The following values should be tested: 128K, 256K, 512K. The largest value should not be exceeded in order to avoid kernel problems. For LTO-5 and up, 256K and 512K are usually appropriate.

Note

  • If the Maximum Block Size settings changes to a lower value after tapes have been written with production data, then your media will become incompatible and I/O-ERRORS will happen.

  • Minimum Block Size should never be used, as it will just waste tape space. If you think you should use it, please contact us.

  • Organize your tests through pairs of directives, for example Minimum File Size = 8GiB; Maximum Block Size = 131072, Maximum File Size = 8GiB; Maximum Block Size = 262144, etc. (8GiB-524288, 12GiB-131072, 12GiB-262144, 12GiB-524288, etc.)

  • When the test plan is defined, both Directives should be changed accordingly in the Device{} Resource of the Storage Daemon configuration file for the chosen drive and all other drives that can share media.

    Once modified, please run the btape speed tests according the Minimum File Size of your selected pair. After each test with a pair you will need to restart the **btape utility to load the configuration changes. Please find this example with a Maximum File Size given in GiB:

    speed file_size=20
    
  • The file_size value should be much larger than the Maximum file Size directive. In order to find the best settings for a production environment, it will be necessary to observe reported throughput of the “Test with zero data and Bacula block structure” and the following “Test with random data, should give the minimum throughput” from all test runs.

    Find more details about the btape command in our Bacula Enterprise Utility programs in your download area or by contacting us.

Go back to the Testing and Monitoring chapter.

Go back to the Best Practices chapter.

Go back to the main Bacula Enterprise Configuration page.