-
-
Notifications
You must be signed in to change notification settings - Fork 812
Description
Have you checked borgbackup docs, FAQ, and open Github issues?
Yes
Is this a BUG / ISSUE report or a QUESTION?
Bug
System information. For client/server mode post info for both machines.
btrfs destination, xfs source, local usage
Your borg version (borg -V).
1.1.8
Operating system (distribution) and version.
Gentoo Linux 64-bit
Full borg commandline that lead to the problem (leave away excludes and passwords)
borg extract -v --list path/to/repo::archive -e something/i/dont/want
Describe the problem you're observing.
Prior to extracting the backup to an empty btrfs, I recreate my subvolume structure including nocow and compression flags (chattr) from a script generated during backup. This step is needed because borg doesn't restore btrfs subvolumes as subvolumes but only as directories. Since some kernel version, it is allowed to remove empty subvolumes with just "rmdir". Borg seems to do exactly that: It removes empty directories before restoring content into it. I dind't expect that behavior and there's no command line option to work around this. The result is a btrfs with a lot of subvolumes killed (except they contain nested subvolumes).
Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.
I'm currently letting my script use touch .keep-subvolume for each subvolume it creates. This seems to work around the issue: Borg seems to no longer kill the subvolumes because it only removes empty directories.
It would be good if borg wouldn't kill empty subvolumes. Even better would be if it restored subvolmes as subvolumes instead of plain directories if restoring to a btrfs volume. Maybe it could even store the nocow/compress attribute (lsattr) for subvolumes, tho it could make sense to store these even per file (but I don't use that per file).