borgbackupserver icon indicating copy to clipboard operation
borgbackupserver copied to clipboard

Back up from a snapshot option is greyed out on bbs docker agent

Open ArbiterGR opened this issue 1 week ago • 2 comments

Description

As per title: Backup from a snapshot is disabled and the popup says that btrfs tools is missing. The host does have btrfs tools installed, the container doesn't.

Steps to Reproduce

Using bbs docker agent, try to use Backup from a snapshot feature.

Installation Type

Docker

BBS Version

v2.102.0

Agent Version (if applicable)

v2.102.0

Agent OS (if applicable)

None

Relevant Logs


ArbiterGR avatar Nov 22 '26 18:11 ArbiterGR

Just to update on this issue, the container lacks BTRFS Tools. From my testing, it seems it also needs cap_add: - SYS_ADMIN

to be able to use snapshots in btrfs, otherwise we get operation not permitted from the docker daemon.

Would it be possible to include btrfs-tools into the image ?

ArbiterGR avatar Nov 24 '26 07:11 ArbiterGR

Thanks @ArbiterGR. v2.102.1 adds btrfs-progs to the agent image. You were close on the rights: on hosts with AppArmor, SYS_ADMIN is not enough, because Docker's default profile also blocks the bind mount the agent uses. The container needs:

cap_add:
  - SYS_ADMIN
security_opt:
  - apparmor=unconfined

(or privileged: true), and the volume has to be a btrfs subvolume mounted read-write. The Docker agent page has the details. The agent now checks all of this before it offers snapshots, and the tooltip names what is missing.

Testing this turned up two other problems, both fixed. Without mount rights the agent took a snapshot it could neither mount nor delete, which left a .bbs-snap-* folder in the volume; if you have one from your tests, btrfs subvolume delete on the host removes it. On any host, btrfs subvolumes nested inside a snapshotted volume came out empty, and now get their own snapshot. Tested in a container on Ubuntu with AppArmor, with and without each setting.

marcpope avatar Nov 27 '26 02:11 marcpope