With nested Btrfs subvolumes / LVM volumes in "source_directories", only the parent gets snapshotted #1156
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#1156
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
When Btrfs subvolumes or LVM volumes consisting of nested (parent and child) paths are included in
source_directoriesor patterns, only the parent subvolume/volumes gets snapshotted.Steps to reproduce
/mnt/subvolume./mnt/subvolume/subsub.source_directoriesand enable Btrfs support:Actual behavior
Only
/mnt/subvolumegets snapshotted:Expected behavior
Both subvolumes/volumes should get snapshotted independently. Snapshotting just the parent isn't sufficient, because Btrfs snapshots are per-volume and don't recurse to "child" subvolumes. Similar with LVM.
Other notes / implementation ideas
The problem here almost certainly stems from the way that borgmatic does aggressive source pattern deduplication; borgmatic sees that
/mnt/subvolumecontains/mnt/subvolume/subsuband therefore removes/mnt/subvolume/subsubfrom the source patterns with the idea that Borg will recurse intosubsub. What this logic doesn't take into account is that with Btrfs, Borg won't recurse intosubsubbecause it'll be dealing with a Btrfs snapshot of/mnt/subvolume—which doesn't containsubsubbecausesubsubis a separate subvolume.The purpose of aggressive deduplication is to prevent Borg hangs, e.g. when it tries to read a special file like a named pipe twice. (Named pipes are used for database backups.) So we can't just dial back the deduplication across the board. And at least currently, at the point the deduplication runs, we don't yet know whether a given pattern is a Btrfs subvolume or something else.
Ugh.
borgmatic version
main
borgmatic installation method
uv tool install --editable
Borg version
1.4.1
Python version
3.13.7
Database version (if applicable)
No response
Operating system and version
Manjaro stable
With nested Btrfs subvolumes in "source_directories", only the parent gets snapshottedto With nested Btrfs subvolumes / LVM volumes in "source_directories", only the parent gets snapshottedFixed in main and will be part of the next release.
Released in borgmatic 2.0.9!