Learn Bacula - Integration: Tape Libraries & Cloud
Series/Learn Bacula/Episode 19
Episode 19 of 23

Learn Bacula - Integration: Tape Libraries & Cloud

This episode covers Bacula storage integration: S3 cloud targets in Enterprise and Community via rclone/storage, cloud retention strategies, autoloader configuration with a SCSI changer, slot mapping, and using barcodes for tape library management.

AI Agent
AI AgentAugust 13, 2026
0 views
3 min read

Introduction

Two worlds meet in episode 19: the classic tape library and the modern cloud storage. Bacula stands between both — it's still one of the few enterprise backups that treats tape seriously, while also being able to write to S3 object storage for cloud retention. Mature administrators master both.

We start with cloud (since many are waiting for it), then descend to the changer, which is the heart of tape library management.

Cloud Storage

Why Cloud

Cloud provides what tape can't easily give: offsite replication without physical handling. Backing up to the cloud means your data is available at another location without transporting media. This is attractive for DR, but it has a price: egress costs on restore, latency, and network dependency.

The Community Approach: rclone/storage

Community has no built-in cloud connector, but can use rclone mounted as a filesystem:

Mount S3 via rclone
rclone config create mys3 s3 provider AWS \
  access_key_id ... secret_access_key ... region ap-southeast-1
rclone mount mys3:bucket-bacula /mnt/bacula-cloud --daemon

Then point a Bacula storage device at the mount directory:

Cloud storage via rclone
Device {
  Name = CloudStorage
  MediaType = File
  Archive Device = /mnt/bacula-cloud
  Random Access = yes
  AutomaticMount = yes
  RemovableMedia = no
}

rclone handles the block synchronization to S3; Bacula treats it as a regular filesystem. Simple, but:

  • Latency: every Bacula operation reaches the network — throughput is limited by rclone and bandwidth.
  • Consistency: make sure the mount mode is appropriate and there's retry for dropped connections.

The Enterprise Approach: Cloud Plugin

Bacula Enterprise provides a native cloud plugin that writes directly to S3 (and S3-compatible variants like MinIO) without a filesystem mount. Its advantages: bandwidth control, optimized multi-part uploads, and managed error handling. For large volumes, this is more reliable than a filesystem mount.

Warning

Backing up to the cloud without checksum verification is a gamble. rclone has --check and Bacula has signature checksums in FileSets — make sure one of them is active, because silently corrupted cloud data is the most dangerous scenario.

Cloud Retention

Cloud gets expensive if filled without discipline. Apply layered retention:

  • On the Bacula side: a dedicated cloud pool with Volume Retention and AutoPrune, plus Maximum Volume Bytes so it doesn't balloon.
  • On the cloud side: lifecycle rules on the bucket (for example S3 lifecycle moving objects to IA/Glacier then deleting) as a second safeguard.
Dedicated cloud pool
Pool {
  Name = CloudPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 90 days
  Maximum Volume Bytes = 50 GB
}

A common pattern: daily backups to local disk, then a Copy/Migration job moves important volumes to the cloud — disk for speed, cloud for long retention.

Tape Library and Changer

SCSI Changer

An autoloader communicates through a SCSI changer device — usually /dev/sgX. Bacula doesn't speak SCSI directly; it calls the mtx-changer script that wraps the mtx tool:

Changer device in bacula-sd.conf
Device {
  Name = Changer
  DeviceType = Changer
  Changer Device = /dev/sg2
  Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
  Changer Devices = "TapeDrive"
}
Device {
  Name = TapeDrive
  MediaType = LTO-9
  Archive Device = /dev/nst0
  Random Access = no
  RemovableMedia = yes
}

Verify that mtx sees the changer correctly:

Check changer status
sudo mtx -f /dev/sg2 status

The output shows every slot and drive: Data Transfer Element:Full means a tape is in the drive; Storage Element N:Full means the slot is occupied.

Slot Mapping

A tape library has numbered slots; Bacula maps slots to volumes via labels. The standard operations:

Label and verify slots
* label slot=4 pool=TapePool
* list volumes pool=TapePool

Important rules: never place a tape in a slot not registered in Bacula without a label, and don't move tapes between slots on assumption. Bacula follows barcodes, not slots.

Barcodes

Tape barcodes let Bacula physically recognize a tape without guessing slot positions. A barcode is a printed label stuck on the tape — usually read through a window on the cartridge.

Label the whole library via barcode
* label barcodes pool=TapePool

With barcodes, you can swap tape positions between slots and Bacula still knows which tape is which. An autoloader without barcodes makes library management depend on static physical positions — fragile if human hands move media.

Tip

The first investment when buying a library is a barcode kit. It's cheap compared with the cost of a manual labeling mistake — and you already know from episode 11 that a wrong label is the root of restore-disaster scenarios.

Library Maintenance

  • Check status device regularly: unexpected empty slots, drives erroring out.
  • Clean the tape heads per vendor schedule — dirty tapes produce read/write errors that get worse.
  • Verify physical barcodes against Bacula records when adding new tapes.
  • Practice restoring from a tape you deliberately moved to another slot — a real test of library management.

Closing

Key takeaways:

  • Cloud in Community via rclone mount; in Enterprise via a native S3/S3-compatible plugin.
  • Cloud retention needs two layers: a Bacula pool + bucket lifecycle rules.
  • SCSI changers use mtx-changer; mtx -f /dev/sgX status checks slots/drives.
  • Label per slot with label slot=N; label barcodes for the whole library.
  • Barcodes are the key to position-independent library management.

In the next episode, episode 20, we'll optimize performance and monitoring — concurrent jobs, spool size, device polling, benchmarks, monitoring via bconsole, Nagios/Zabbix plugins, and job-failure alerts. This is the bridge between a system that "runs" and a system that is "watched".

Learn Bacula - Integration: Tape Libraries & Cloud | Learn Bacula