Back to Engineering Blog
Infrastructure & Reliability 3 min read

A Rotating Off-Site Backup on a Single USB Slot

Two bus-powered 4 TB drives could not be powered on the second backup server. We designed a one-slot monthly rotation with encrypted removable datastores, then moved the slot into a dedicated VM after the USB controller on the first server died mid-write.

Jason NevillBy , Houston, TX
#Backups#ProxmoxBackupServer#LUKS#3-2-1

Key Architectural Takeaways

  • A single-slot rotation gives an off-site copy with simple, safe swapping: the drive is unmounted and its encryption closed after every run.
  • Put the USB slot in a place where a controller fault cannot take the primary datastore offline with it.
  • A hand-built VM outside the infrastructure code must be imported deliberately, or a plan will try to create it again.

The challenge

We wanted an off-site copy of the backups and had two identical 4 TB bus-powered drives. They could not be powered on the second backup server, either from its own ports or from a self-powered hub, because the draw was too high. The first backup server already ran one of them stably on its USB 3 bus.

The design

  • One USB slot. Drive A is attached and pulls daily from the second server's datastore through a PBS remote with a read-only token. Drive B sits off site.
  • Swap monthly. After each run the script unmounts the drive and closes its LUKS mapping, so it is always safe to unplug.
  • Both drives are LUKS2-encrypted and each carries one removable PBS datastore.
  • That gives four copies: the second server's datastore, the first server's mirror datastore, the attached drive and the off-site drive.
  • A monthly window of 30 days, with five days of grace, drives a Grafana alert if the swap is late.

The swap runbook is short: wait for no run in progress, unplug the attached drive, plug in the other, start the service, and carry the unplugged drive away.

The slot moved

The same day, the first backup server's USB controller faulted with a DMAR error while we were preparing drive A with a heavy write. That took the mirror datastore offline until a reboot. The filesystem was clean afterwards and we started a full verify. A controller that can fall over under load is the wrong place for a rotation slot that shares a host with a datastore.

So the slot moved to a dedicated PBS virtual machine on a hypervisor, with the drive passed through as a USB 3 device. Inside the VM sit the LUKS volume and the removable datastore, and a Debian generic kernel (the cloud kernel has no USB support). The first drive prepared there ran its filesystem creation on the 3.6 TB encrypted volume with no controller errors. The pull token was replaced by a dedicated read-only one, and the earlier token revoked.

Gotchas

  • PBS removable datastores need a relative path in datastore create.
  • The VM is hand-built and not in Terraform. Importing it has to be a deliberate terraform import, because a plain resource in a merged plan would be created a second time.
  • Both drives share one LUKS key, kept in the vault with a break-glass copy still needed. The second drive gets prepared at the first swap.

Takeaway

Treat an off-site rotation as a procedure with a failure budget: make the safe state the default after every run, and isolate flaky hardware from the datastores you cannot afford to lose.

Some of what's described here is a design that hasn't been fully tested yet; those parts say so in the text.

Follow the build on LinkedIn or by RSS.

All Articles

Follow the build

Questions about the build, or spotted something we got wrong? Find us on LinkedIn and GitHub.