btrfs subvolumes under root not backed up #983
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 project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
borgmatic-collective/borgmatic#983
Loading…
Add table
Add a link
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
Hey, first of all thanks a lot for borgmatic. It's an excellent tool!
I am encountering a bit of an issue however. My setup is as follows:
btrfs subvolume @ mounted at /
btrfs subvolume @home mounted at /home
Now I want to backup my whole system. Meaning I added
However this leads to the
/homedirectory not being snapshotted and remaining empty./.borgmatic-snapshot-99638/home/is empty.This also happens if I explicitly mention "/home" in the source_directories, as well as if I list all the directories under
/I want to backup manually under source_directories.I'll be happy to provide any more information you need.
Thank you for your time!
Steps to reproduce
No response
Actual behavior
No response
Expected behavior
No response
Other notes / implementation ideas
No response
borgmatic version
1.9.8
borgmatic installation method
pipx
Borg version
1.4.0
Python version
3.13.1
Database version (if applicable)
No response
Operating system and version
Fedora Linux 41 (KDE)
Thanks for filing this! Could I see the output of
findmnt -t btrfs --liston your system? That's what borgmatic uses internally to probe for subvolume mount points. Based on the output above, I'm guessing it is finding/homecorrectly, but it'd be good to confirm.I would actually expect
/.borgmatic-snapshot-99638/home/to be empty, because borgmatic doesn't do recursive snapshotting. Instead, I would expect it to do a separate snapshot of your/homesubvolume mount point—if it's explicitly listed in yoursource_directories. So there's nothing in the output aboutCreating Btrfs snapshot for /home subvolume? And what happens if you omit/fromsource_directoriesbut include/homein it?Related: #959.
Looking at this a little further, I think I found at least part of the problem. borgmatic is not expecting the
@-prefixed names within thebtrfs subvolume listoutput. Instead, it appears to be expecting valid filesystem mount point paths there. This means that it's not correctly seeing that the@homesubvolume corresponds to the/homedirectory—and therefore it's not snapshotting/home. I'll have to think about how this can be addressed.I believe I have a fix in main, which will be part of the next release. Do you have any convenient way to test this fix locally, or would you prefer to wait for the release? The only changed file is here: https://projects.torsion.org/borgmatic-collective/borgmatic/raw/branch/main/borgmatic/hooks/data_source/btrfs.py ... In theory you could replace the corresponding file in your borgmatic installation to see if the fix works on your machine.
Thank you so much for the quick fix! I tried the the version from
mainand it works now.Really appreciate it :)
Awesome, glad to hear it!
Released in borgmatic 1.9.9!