[DOCS] btrfs issues and related discussion. #1105

Closed
opened 2025-05-30 01:41:05 +00:00 by sten · 28 comments

What I'm trying to do and why

Hello,

Thank you for your continued work on borgmatic. I'm the Debian maintainer for btrfs-progs, the one who introduced installation to a subvolume in Debian, and a btrfs user for 11 years. I'd like to help make borgmatic effortlessly easy to use on typical btrfs-using systems. I'm sorry that the following will be direct, and I hope that you'll appreciate that I'm trying to save time with a declarative style:

In the online documentation on torsion.org, it says "Btrfs does not support snapshotting read-only subvolumes." which is reproducibly false. I'm utterly baffled by the complexity of the documentation and what it suggests about the implementation. PEP 20 says "Flat is better than nested" and I think this particularly applies to btrfs. The following is also a hard deal-breaker for all the sysadmins I know: "borgmatic rewrites the snapshot file paths". Principle aside, does borgmatic have restore functionality that unrewrites snapshot file paths and restores subvolumes? Restoring from backup is one of the elementary challenges of maintaining btrfs systems, and one that must inform the backup strategy.

The most simple case supported by any mainstream distribution is a single subvolume named "@rootfs" (Debian). The most complex topology at the time of installation is provided by SUSE. Btrfs-enabled software will tend to create a new subvolume for itself and this is [almost?] always a nested subvolume. These subvolumes must to be recreated when restoring. The most safe and simple way to handle the emergent complexity is to do what SUSE does and mount all filesystem roots to an admin location with secure permissions, and then take take out-of-band snapshots. (either to /btrfs-admin/volume-root/snapshots/@dataset_on_date directory or a /btrfs-admin/volume-root/@snapshots/@dataset_on_date).

ZFS is nice because because it has magic built-in to help cope with its complexity, but it's not elegant nor reliable to think of btrfs using ZFS semantics. Case and point: there is still no tool to recursively and deterministically create snapshots for a tree of subvolumes, when this is something that "just works" in ZFS. Yes, arguably this should be part of the core python-btrfs...

I've included info about a moderate case under "other notes / implementation ideas" as well as some possible solutions.

Steps to reproduce

No response

Actual behavior

No response

Expected behavior

No response

Other notes / implementation ideas

findmnt -t btrfs --list --json

{
   "filesystems": [
      {
         "target": "/",
         "source": "/dev/mapper/Crucial[/@rootfs]",
         "fstype": "btrfs",
         "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@rootfs"
      },{
         "target": "/btrfs-admin/Crucial",
         "source": "/dev/mapper/Crucial",
         "fstype": "btrfs",
         "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/"
      },{
         "target": "/srv",
         "source": "/dev/mapper/Crucial[/@srv]",
         "fstype": "btrfs",
         "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=259,subvol=/@srv"
      },{
         "target": "/usr/src",
         "source": "/dev/mapper/Crucial[/@src]",
         "fstype": "btrfs",
         "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@src"
      },{
         "target": "/home",
         "source": "/dev/mapper/Crucial[/@home]",
         "fstype": "btrfs",
         "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home"
      },{
         "target": "/btrfs-admin/Red",
         "source": "/dev/sdb2",
         "fstype": "btrfs",
         "options": "rw,noatime,space_cache,subvolid=5,subvol=/"
      },{
         "target": "/var/cache/apt-cacher-ng",
         "source": "/dev/sdb2[/@apt-cacher-ng]",
         "fstype": "btrfs",
         "options": "rw,relatime,space_cache,subvolid=11080,subvol=/@apt-cacher-ng"
      },{
         "target": "/home/media",
         "source": "/dev/sdb2[/@media]",
         "fstype": "btrfs",
         "options": "rw,noatime,space_cache,subvolid=5736,subvol=/@media"
      },{
         "target": "/home/backups",
         "source": "/dev/sdb2[/@backups]",
         "fstype": "btrfs",
         "options": "rw,noatime,space_cache,subvolid=6383,subvol=/@backups"
      },{
         "target": "/scratch",
         "source": "/dev/sdb2[/@scratch]",
         "fstype": "btrfs",
         "options": "rw,noatime,space_cache,subvolid=262,subvol=/@scratch"
      },{
         "target": "/home/backups/arkie_photos",
         "source": "/dev/sdb2[/@arkie_photos]",
         "fstype": "btrfs",
         "options": "rw,noatime,space_cache,subvolid=8612,subvol=/@arkie_photos"
      },{
         "target": "/var/lib/boinc-client/projects",
         "source": "/dev/sdb2[/@boinc_projects]",
         "fstype": "btrfs",
         "options": "rw,relatime,space_cache,subvolid=11084,subvol=/@boinc_projects"
      }
   ]
}

but then this:
btrfs sub list /btrfs-admin/

btrfs sub list /btrfs-admin/
ID 256 gen 15196 top level 5 path @rootfs
ID 257 gen 15196 top level 5 path @home
ID 258 gen 14917 top level 5 path @src
ID 259 gen 14912 top level 5 path @srv
ID 260 gen 15192 top level 257 path @home/sten/.cache
ID 262 gen 15196 top level 256 path var/lib/lxc/pi-hole/rootfs
ID 263 gen 146 top level 256 path var/lib/portables
ID 264 gen 146 top level 256 path var/lib/machines

btrfs sub list /btrfs-admin/Crucial/

identical to previous output

btrfs sub list /btrfs-admin/Red/

ID 262 gen 1500609 top level 5 path @scratch
ID 5736 gen 1500679 top level 5 path @media
ID 6383 gen 1500778 top level 5 path @backups
ID 8612 gen 1500747 top level 5 path @arkie_photos
ID 8840 gen 1315456 top level 5 path @tmp
ID 9116 gen 1487771 top level 5 path @navis_Borg
ID 11080 gen 1500792 top level 5 path @apt-cacher-ng
ID 11084 gen 1500562 top level 5 path @boinc_projects

My examples are a modest case.

Another option is to "do one thing and do it well" and instead write a plugin that calls a btrfs-specific snapshotting tool. Having spend a couple of years evaluating Snapper and Timeshift (which has an Ubuntu-specific upstream who as been described as hostile), I began to look to https://github.com/jcrd/snapback and https://github.com/hirak99/yabsnap

In terms of full btrfs support, the future will have:

  1. Automatic snapshots with automatic rotation and expiration.
  2. Bootloader menu to boot into "boot environments" or "system restore points" enabled by those snapshots.
  3. Easy rollbacks with a single command.
  4. Layered backups.
  5. Bare metal restore.

As I see it, the scope of borgmatic is @4. What do you think? Would it be more reasonable to use a plugin to call a snapshot operation, and avoid the rabbit hole of all the btrfs topologies?

borgmatic version

No response

borgmatic installation method

No response

Borg version

No response

Python version

No response

Database version (if applicable)

No response

Operating system and version

No response

### What I'm trying to do and why Hello, Thank you for your continued work on borgmatic. I'm the Debian maintainer for btrfs-progs, the one who introduced installation to a subvolume in Debian, and a btrfs user for 11 years. I'd like to help make borgmatic effortlessly easy to use on typical btrfs-using systems. I'm sorry that the following will be direct, and I hope that you'll appreciate that I'm trying to save time with a declarative style: In the online documentation on torsion.org, it says "Btrfs does not support snapshotting read-only subvolumes." which is reproducibly false. I'm utterly baffled by the complexity of the documentation and what it suggests about the implementation. PEP 20 says "Flat is better than nested" and I think this particularly applies to btrfs. The following is also a hard deal-breaker for all the sysadmins I know: "borgmatic rewrites the snapshot file paths". Principle aside, does borgmatic have restore functionality that unrewrites snapshot file paths and restores subvolumes? Restoring from backup is one of the elementary challenges of maintaining btrfs systems, and one that must inform the backup strategy. The most simple case supported by any mainstream distribution is a single subvolume named "@rootfs" (Debian). The most complex topology at the time of installation is provided by SUSE. Btrfs-enabled software will tend to create a new subvolume for itself and this is [almost?] always a nested subvolume. These subvolumes must to be recreated when restoring. The most safe and simple way to handle the emergent complexity is to do what SUSE does and mount all filesystem roots to an admin location with secure permissions, and then take take out-of-band snapshots. (either to /btrfs-admin/volume-root/snapshots/@dataset_on_date directory or a /btrfs-admin/volume-root/@snapshots/@dataset_on_date). ZFS is nice because because it has magic built-in to help cope with its complexity, but it's not elegant nor reliable to think of btrfs using ZFS semantics. Case and point: there is *still* no tool to recursively and deterministically create snapshots for a tree of subvolumes, when this is something that "just works" in ZFS. Yes, arguably this should be part of the core python-btrfs... I've included info about a moderate case under "other notes / implementation ideas" as well as some possible solutions. ### Steps to reproduce _No response_ ### Actual behavior _No response_ ### Expected behavior _No response_ ### Other notes / implementation ideas findmnt -t btrfs --list --json ``` { "filesystems": [ { "target": "/", "source": "/dev/mapper/Crucial[/@rootfs]", "fstype": "btrfs", "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@rootfs" },{ "target": "/btrfs-admin/Crucial", "source": "/dev/mapper/Crucial", "fstype": "btrfs", "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/" },{ "target": "/srv", "source": "/dev/mapper/Crucial[/@srv]", "fstype": "btrfs", "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=259,subvol=/@srv" },{ "target": "/usr/src", "source": "/dev/mapper/Crucial[/@src]", "fstype": "btrfs", "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@src" },{ "target": "/home", "source": "/dev/mapper/Crucial[/@home]", "fstype": "btrfs", "options": "rw,noatime,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home" },{ "target": "/btrfs-admin/Red", "source": "/dev/sdb2", "fstype": "btrfs", "options": "rw,noatime,space_cache,subvolid=5,subvol=/" },{ "target": "/var/cache/apt-cacher-ng", "source": "/dev/sdb2[/@apt-cacher-ng]", "fstype": "btrfs", "options": "rw,relatime,space_cache,subvolid=11080,subvol=/@apt-cacher-ng" },{ "target": "/home/media", "source": "/dev/sdb2[/@media]", "fstype": "btrfs", "options": "rw,noatime,space_cache,subvolid=5736,subvol=/@media" },{ "target": "/home/backups", "source": "/dev/sdb2[/@backups]", "fstype": "btrfs", "options": "rw,noatime,space_cache,subvolid=6383,subvol=/@backups" },{ "target": "/scratch", "source": "/dev/sdb2[/@scratch]", "fstype": "btrfs", "options": "rw,noatime,space_cache,subvolid=262,subvol=/@scratch" },{ "target": "/home/backups/arkie_photos", "source": "/dev/sdb2[/@arkie_photos]", "fstype": "btrfs", "options": "rw,noatime,space_cache,subvolid=8612,subvol=/@arkie_photos" },{ "target": "/var/lib/boinc-client/projects", "source": "/dev/sdb2[/@boinc_projects]", "fstype": "btrfs", "options": "rw,relatime,space_cache,subvolid=11084,subvol=/@boinc_projects" } ] } ``` but then this: btrfs sub list /btrfs-admin/ ``` btrfs sub list /btrfs-admin/ ID 256 gen 15196 top level 5 path @rootfs ID 257 gen 15196 top level 5 path @home ID 258 gen 14917 top level 5 path @src ID 259 gen 14912 top level 5 path @srv ID 260 gen 15192 top level 257 path @home/sten/.cache ID 262 gen 15196 top level 256 path var/lib/lxc/pi-hole/rootfs ID 263 gen 146 top level 256 path var/lib/portables ID 264 gen 146 top level 256 path var/lib/machines ``` btrfs sub list /btrfs-admin/Crucial/ ``` identical to previous output ``` btrfs sub list /btrfs-admin/Red/ ``` ID 262 gen 1500609 top level 5 path @scratch ID 5736 gen 1500679 top level 5 path @media ID 6383 gen 1500778 top level 5 path @backups ID 8612 gen 1500747 top level 5 path @arkie_photos ID 8840 gen 1315456 top level 5 path @tmp ID 9116 gen 1487771 top level 5 path @navis_Borg ID 11080 gen 1500792 top level 5 path @apt-cacher-ng ID 11084 gen 1500562 top level 5 path @boinc_projects ``` My examples are a modest case. Another option is to "do one thing and do it well" and instead write a plugin that calls a btrfs-specific snapshotting tool. Having spend a couple of years evaluating Snapper and Timeshift (which has an Ubuntu-specific upstream who as been described as hostile), I began to look to https://github.com/jcrd/snapback and https://github.com/hirak99/yabsnap In terms of full btrfs support, the future will have: 1. Automatic snapshots with automatic rotation and expiration. 2. Bootloader menu to boot into "boot environments" or "system restore points" enabled by those snapshots. 3. Easy rollbacks with a single command. 4. Layered backups. 5. Bare metal restore. As I see it, the scope of borgmatic is @4. What do you think? Would it be more reasonable to use a plugin to call a snapshot operation, and avoid the rabbit hole of all the btrfs topologies? ### borgmatic version _No response_ ### borgmatic installation method _No response_ ### Borg version _No response_ ### Python version _No response_ ### Database version (if applicable) _No response_ ### Operating system and version _No response_
Author

P.S. I decided to write this full write-up after reading #1092

P.S. I decided to write this full write-up after reading #1092
Owner

Thank you for your continued work on borgmatic. I'm the Debian maintainer for btrfs-progs, the one who introduced installation to a subvolume in Debian, and a btrfs user for 11 years. I'd like to help make borgmatic effortlessly easy to use on typical btrfs-using systems.

Awesome, thanks for your interest and for the detailed ticket!

I'm sorry that the following will be direct, and I hope that you'll appreciate that I'm trying to save time with a declarative style:

In the online documentation on torsion.org, it says "Btrfs does not support snapshotting read-only subvolumes." which is reproducibly false.

Maybe I'm misunderstanding the error message I get when I try that...?

# btrfs property set /mnt/subvolume ro true
# btrfs subvolume snapshot -r /mnt/subvolume @snapshot
ERROR: cannot snapshot '/mnt/subvolume': Read-only file system

I'm utterly baffled by the complexity of the documentation and what it suggests about the implementation.

I'm open to suggestions on reducing its complexity!

PEP 20 says "Flat is better than nested" and I think this particularly applies to btrfs. The following is also a hard deal-breaker for all the sysadmins I know: "borgmatic rewrites the snapshot file paths".

Could you say more about this? borgmatic rewrites snapshot file paths so that, within the Borg archive, they appear at their original location (their paths prior to snapshotting). The rationale is that borgmatic is transparently and temporarily creating these snapshots behind the scenes; they are not user-facing snapshots whose paths need preservation.

Principle aside, does borgmatic have restore functionality that unrewrites snapshot file paths and restores subvolumes? Restoring from backup is one of the elementary challenges of maintaining btrfs systems, and one that must inform the backup strategy.

Because the backed up paths in the Borg archive appears at their original location, the restore process is the same as restoring any other non-Btrfs file (borgmatic extract or borgmatic mount). For instance, if /etc is on Btrfs and you ask borgmatic to back it up, then it will appear in the Borg archive at /etc and will be restorable to /etc (or anywhere else you want it for that matter).

The most simple case supported by any mainstream distribution is a single subvolume named "@rootfs" (Debian). The most complex topology at the time of installation is provided by SUSE. Btrfs-enabled software will tend to create a new subvolume for itself and this is [almost?] always a nested subvolume. These subvolumes must to be recreated when restoring.

Why?

The most safe and simple way to handle the emergent complexity is to do what SUSE does and mount all filesystem roots to an admin location with secure permissions, and then take take out-of-band snapshots. (either to /btrfs-admin/volume-root/snapshots/@dataset_on_date directory or a /btrfs-admin/volume-root/@snapshots/@dataset_on_date).

ZFS is nice because because it has magic built-in to help cope with its complexity, but it's not elegant nor reliable to think of btrfs using ZFS semantics. Case and point: there is still no tool to recursively and deterministically create snapshots for a tree of subvolumes, when this is something that "just works" in ZFS. Yes, arguably this should be part of the core python-btrfs...

I've included info about a moderate case under "other notes / implementation ideas" as well as some possible solutions.

I'm not sure I understand the ask in this ticket.. Is it just that borgmatic doesn't support a specific (and common) Btrfs use case / topology as you outlined in "other notes"? Could you say more about that gap?

> Thank you for your continued work on borgmatic. I'm the Debian maintainer for btrfs-progs, the one who introduced installation to a subvolume in Debian, and a btrfs user for 11 years. I'd like to help make borgmatic effortlessly easy to use on typical btrfs-using systems. Awesome, thanks for your interest and for the detailed ticket! > I'm sorry that the following will be direct, and I hope that you'll appreciate that I'm trying to save time with a declarative style: > > In the online documentation on torsion.org, it says "Btrfs does not support snapshotting read-only subvolumes." which is reproducibly false. Maybe I'm misunderstanding the error message I get when I try that...? ```bash # btrfs property set /mnt/subvolume ro true # btrfs subvolume snapshot -r /mnt/subvolume @snapshot ERROR: cannot snapshot '/mnt/subvolume': Read-only file system ``` > I'm utterly baffled by the complexity of the documentation and what it suggests about the implementation. I'm open to suggestions on reducing its complexity! > PEP 20 says "Flat is better than nested" and I think this particularly applies to btrfs. The following is also a hard deal-breaker for all the sysadmins I know: "borgmatic rewrites the snapshot file paths". Could you say more about this? borgmatic rewrites snapshot file paths so that, within the Borg archive, they appear at their original location (their paths prior to snapshotting). The rationale is that borgmatic is transparently and temporarily creating these snapshots behind the scenes; they are not user-facing snapshots whose paths need preservation. > Principle aside, does borgmatic have restore functionality that unrewrites snapshot file paths and restores subvolumes? Restoring from backup is one of the elementary challenges of maintaining btrfs systems, and one that must inform the backup strategy. Because the backed up paths in the Borg archive appears at their original location, the restore process is the same as restoring any other non-Btrfs file (`borgmatic extract` or `borgmatic mount`). For instance, if `/etc` is on Btrfs and you ask borgmatic to back it up, then it will appear in the Borg archive at `/etc` and will be restorable to `/etc` (or anywhere else you want it for that matter). > The most simple case supported by any mainstream distribution is a single subvolume named "@rootfs" (Debian). The most complex topology at the time of installation is provided by SUSE. Btrfs-enabled software will tend to create a new subvolume for itself and this is [almost?] always a nested subvolume. These subvolumes must to be recreated when restoring. Why? > The most safe and simple way to handle the emergent complexity is to do what SUSE does and mount all filesystem roots to an admin location with secure permissions, and then take take out-of-band snapshots. (either to /btrfs-admin/volume-root/snapshots/@dataset_on_date directory or a /btrfs-admin/volume-root/@snapshots/@dataset_on_date). > > ZFS is nice because because it has magic built-in to help cope with its complexity, but it's not elegant nor reliable to think of btrfs using ZFS semantics. Case and point: there is still no tool to recursively and deterministically create snapshots for a tree of subvolumes, when this is something that "just works" in ZFS. Yes, arguably this should be part of the core python-btrfs... > > I've included info about a moderate case under "other notes / implementation ideas" as well as some possible solutions. I'm not sure I understand the ask in this ticket.. Is it just that borgmatic doesn't support a specific (and common) Btrfs use case / topology as you outlined in "other notes"? Could you say more about that gap?

I'm having issues with btrfs snapshot functionality and systemd service at the moment. I can't get borgmatic.service working, because as @sten noted, findmnt -t btrfs --json --list output differs when run in native shell, and in systemd unit sandbox. Logic in btrfs.py is thrown off by this, and tries to work with non-existent subvolumes

jun 10 09:15:13 perun borgmatic[89180]: INFO backupserver: Snapshotting Btrfs subvolumes
jun 10 09:15:13 perun systemd-inhibit[89191]: ERROR: Could not get subvolume flags: Invalid argument
jun 10 09:15:13 perun borgmatic[89180]: CRITICAL backupserver: Error running actions for repository
jun 10 09:15:13 perun borgmatic[89180]: CRITICAL backupserver: Command '('btrfs', 'property', 'get', '-t', 'subvol', '/root', 'ro')' returned non-zero exit status 1.
jun 10 09:15:13 perun borgmatic[89180]: CRITICAL /etc/borgmatic/config.yaml: Error running configuration
jun 10 09:15:13 perun borgmatic[89180]: CRITICAL /etc/borgmatic/config.yaml: An error occurred

@witten On the topic of read-only subvolumes and snapshots: here are results of an experiment on my machine.

root@perun /h/d/src# sudo btrfs subvolume create /mnt/subvolume/
Create subvolume '/mnt/subvolume' 
root@perun /h/d/src# sudo btrfs property set -t subvol /mnt/subvolume ro true
root@perun /h/d/src# sudo btrfs property get -t subvol /mnt/subvolume ro 
ro=true
root@perun /h/d/src# sudo btrfs subvolume snapshot -r /mnt/subvolume/ /mnt/snapshot/
Create readonly snapshot of '/mnt/subvolume/' in '/mnt/snapshot//subvolume'

I'd have to read up on btrfs some more to weigh in on how to handle read-only subvolumes correctly.

I'll continue research sometime later, and I can create specific issues for the problems I'm having, if you prefer. That may require adjustments in borgmatic.service file, which is a different topic.

I'm having issues with btrfs snapshot functionality and systemd service at the moment. I can't get borgmatic.service working, because as @sten noted, `findmnt -t btrfs --json --list` output differs when run in native shell, and in systemd unit sandbox. Logic in `btrfs.py` is thrown off by this, and tries to work with non-existent subvolumes ``` jun 10 09:15:13 perun borgmatic[89180]: INFO backupserver: Snapshotting Btrfs subvolumes jun 10 09:15:13 perun systemd-inhibit[89191]: ERROR: Could not get subvolume flags: Invalid argument jun 10 09:15:13 perun borgmatic[89180]: CRITICAL backupserver: Error running actions for repository jun 10 09:15:13 perun borgmatic[89180]: CRITICAL backupserver: Command '('btrfs', 'property', 'get', '-t', 'subvol', '/root', 'ro')' returned non-zero exit status 1. jun 10 09:15:13 perun borgmatic[89180]: CRITICAL /etc/borgmatic/config.yaml: Error running configuration jun 10 09:15:13 perun borgmatic[89180]: CRITICAL /etc/borgmatic/config.yaml: An error occurred ``` @witten On the topic of read-only subvolumes and snapshots: here are results of an experiment on my machine. ``` root@perun /h/d/src# sudo btrfs subvolume create /mnt/subvolume/ Create subvolume '/mnt/subvolume' root@perun /h/d/src# sudo btrfs property set -t subvol /mnt/subvolume ro true root@perun /h/d/src# sudo btrfs property get -t subvol /mnt/subvolume ro ro=true root@perun /h/d/src# sudo btrfs subvolume snapshot -r /mnt/subvolume/ /mnt/snapshot/ Create readonly snapshot of '/mnt/subvolume/' in '/mnt/snapshot//subvolume' ``` I'd have to read up on btrfs some more to weigh in on how to handle read-only subvolumes correctly. I'll continue research sometime later, and I can create specific issues for the problems I'm having, if you prefer. That may require adjustments in `borgmatic.service` file, which is a different topic.
Author

Hi Dan,

Sorry for the delay. Something seems to have gone wrong when I tried replying by email. It's my first time using Gitea, and I avoid using web interfaces whenever possible.

"Dan Helfman" projects@torsion.org writes:

In the online documentation on torsion.org, it says "Btrfs does not
support snapshotting read-only subvolumes." which is reproducibly false.

Maybe I'm misunderstanding the error message I get when I try that...?

btrfs property set /mnt/subvolume ro true

When is this a better idea than taking a read-only snapshot, and why?

btrfs subvolume snapshot -r /mnt/subvolume @snapshot ERROR: cannot snapshot '/mnt/subvolume' : Read-only file system

Your reproducer doesn't reproduce that error. Here is a tested reproducer that you can use to confirm this:

mkdir /btrfs-admin mount $(mount | grep ' / ' | awk '{print $1}') -o subvolid=5 /btrfs-admin cd /btrfs-admin btrfs sub create test_rw btrfs sub create test_ro1 btrfs property set test_rw mv test_rw test_ro # 0. indicates that ro subvols can be # renamed btrfs property set test_ro1

mkdir snapshots
cd snapshots
btrfs sub snap -r ../test_ro1 ./test_ro1  # 1. reproducibly proves that
                                          # ro snapshots are snapshotable
btrfs sub snap -r ../test_ro ./test_ro    # 2. reproducibly proves that a
                                          # renamed subvol is also fine
btrfs sub snap -r ../test_ro1 ./test_ro1_copy2 # 3. ro snapshot of a ro
                                               # snapshot is fine too.

This is with linux-6.12.x LTS (either upstream or Debian's). I'd need to find and check my historical notes, but I'm pretty sure that this reproducer has worked since 4.4, and I vaguely remember that it has worked since SUSE-patched 3.16, which is where I started testing btrfs for safety and consistency.

btrfs property set is new and is...incomplete...to put it nicely.

I'm utterly baffled by the complexity of the documentation and what it
suggests about the implementation.

I'm open to suggestions on reducing its complexity!

I'm delighted to hear that!

PEP 20 says "Flat is better than nested" and I think this particularly
applies to btrfs. The following is also a hard deal-breaker for all the
sysadmins I know: "borgmatic rewrites the snapshot file paths".

Could you say more about this?

What are you interested to know about? In the above there are two philosophical principles, a practical/engineering one, an implementation fact, a ~10 page article, and a statement of fact about a statement of fact.

I've now tested borgmatic 2.0.6, studied the source, and more than the docs need work.

The most safe and simple way to handle the emergent complexity is to do
what SUSE does and mount all filesystem roots to an admin location with
secure permissions, and then take take out-of-band snapshots. (either to
/btrfs-admin/volume-root/snapshots/@dataset_on_date directory or a
/btrfs-admin/volume-root/@snapshots/@dataset_on_date).

I've included info about a moderate case under "other notes /
implementation ideas" as well as some possible solutions.

I'm not sure I understand the ask in this ticket.. Is it just that borgmatic doesn't support a specific (and common) Btrfs use case / topology as you outlined in "other notes"? Could you say more about that gap?

I began this ticket with what I thought was just a documentation issue, and attempted to gently demonstrate why various aspects of borgmatic 2.0.6 documented btrfs support are nonfunctional, risky, or perceived as risky (ie: when reading the documentation) and I hoped that you would look through the data I provided and have one or more engineer "aha!" moments :)

Having now tested borgmatic 2.0.6, I found its btrfs support nonfunctional No Btrfs subvolumes found to snapshot, even when using it the way it appears to be designed to be used (configuration for human user view of the rootfs rather than operating on the actual filesystem tree). Thus, of course I read the source to find out why, and what I found is that the foundations of borgmatic's own btrfs plugin will be rewritten sooner or later.

How would you like to proceed? With the information I provided you can write tests, and then code for those tests. I can also make implementation recommendations (ie: Don't use findmnt, because it will never provide an accurate btrfs view. Longterm, you'll probably switch to the more reliable btrfs python module. Short-term, calling btrfs cli command will work for the required simple cases).

Meanwhile it would be significantly faster and easier to write a plugin that leverages an existing snapshotting solution, and this has the advantage of UNIX philosophy (do one thing and do it well), not destroying the hardware of non-enterprise rotational disks and users' warranties by rereading all data for every backup when using borg 1.x. (Rotational disks are now rated for volume of reads per day/week/month, criminal though this should be) This approach also allows you to ignore distribution-specific implementation challenges; here the support burden will fall on the snapshotting creation and rotation software. Ie: Snapper already handles all of the corner cases of SUSE's complex layout, so borgmatic doesn't need to reimplement that logic.

Will MRs/PRs be a high-friction series of arguments? Are there Hetzner-funded bug bounties for adding features and fixing bugs?

Regards,
Nicholas

Hi Dan, Sorry for the delay. Something seems to have gone wrong when I tried replying by email. It's my first time using Gitea, and I avoid using web interfaces whenever possible. "Dan Helfman" <projects@torsion.org> writes: >> In the online documentation on torsion.org, it says "Btrfs does not >> support snapshotting read-only subvolumes." which is reproducibly false. >> >> > > Maybe I'm misunderstanding the error message I get when I try that...? > > # btrfs property set /mnt/subvolume ro true When is this a better idea than taking a read-only snapshot, and why? > # btrfs subvolume snapshot -r /mnt/subvolume @snapshot ERROR: cannot snapshot '/mnt/subvolume' : Read-only file system Your reproducer doesn't reproduce that error. Here is a tested reproducer that you can use to confirm this: ``` mkdir /btrfs-admin mount $(mount | grep ' / ' | awk '{print $1}') -o subvolid=5 /btrfs-admin cd /btrfs-admin btrfs sub create test_rw btrfs sub create test_ro1 btrfs property set test_rw mv test_rw test_ro # 0. indicates that ro subvols can be # renamed btrfs property set test_ro1 mkdir snapshots cd snapshots btrfs sub snap -r ../test_ro1 ./test_ro1 # 1. reproducibly proves that # ro snapshots are snapshotable btrfs sub snap -r ../test_ro ./test_ro # 2. reproducibly proves that a # renamed subvol is also fine btrfs sub snap -r ../test_ro1 ./test_ro1_copy2 # 3. ro snapshot of a ro # snapshot is fine too. ``` This is with linux-6.12.x LTS (either upstream or Debian's). I'd need to find and check my historical notes, but I'm pretty sure that this reproducer has worked since 4.4, and I vaguely remember that it has worked since SUSE-patched 3.16, which is where I started testing btrfs for safety and consistency. `btrfs property set` is new and is...incomplete...to put it nicely. >> I'm utterly baffled by the complexity of the documentation and what it >> suggests about the implementation. >> > I'm open to suggestions on reducing its complexity! I'm delighted to hear that! >> PEP 20 says "Flat is better than nested" and I think this particularly >> applies to btrfs. The following is also a hard deal-breaker for all the >> sysadmins I know: "borgmatic rewrites the snapshot file paths". >> > > Could you say more about this? What are you interested to know about? In the above there are two philosophical principles, a practical/engineering one, an implementation fact, a ~10 page article, and a statement of fact about a statement of fact. <snip> I've now tested borgmatic 2.0.6, studied the source, and more than the docs need work. >> The most safe and simple way to handle the emergent complexity is to do >> what SUSE does and mount all filesystem roots to an admin location with >> secure permissions, and then take take out-of-band snapshots. (either to >> /btrfs-admin/volume-root/snapshots/@dataset_on_date directory or a >> /btrfs-admin/volume-root/@snapshots/@dataset_on_date). <snip> >> I've included info about a moderate case under "other notes / >> implementation ideas" as well as some possible solutions. > > I'm not sure I understand the ask in this ticket.. Is it just that borgmatic doesn't support a specific (and common) Btrfs use case / topology as you outlined in "other notes"? Could you say more about that gap? I began this ticket with what I thought was just a documentation issue, and attempted to gently demonstrate why various aspects of borgmatic 2.0.6 documented btrfs support are nonfunctional, risky, or perceived as risky (ie: when reading the documentation) and I hoped that you would look through the data I provided and have one or more engineer "aha!" moments :) Having now tested borgmatic 2.0.6, I found its btrfs support nonfunctional `No Btrfs subvolumes found to snapshot`, even when using it the way it appears to be designed to be used (configuration for human user view of the rootfs rather than operating on the actual filesystem tree). Thus, of course I read the source to find out why, and what I found is that the foundations of borgmatic's own btrfs plugin will be rewritten sooner or later. How would you like to proceed? With the information I provided you can write tests, and then code for those tests. I can also make implementation recommendations (ie: Don't use findmnt, because it will never provide an accurate btrfs view. Longterm, you'll probably switch to the more reliable btrfs python module. Short-term, calling `btrfs` cli command will work for the required simple cases). Meanwhile it would be significantly faster and easier to write a plugin that leverages an existing snapshotting solution, and this has the advantage of UNIX philosophy (do one thing and do it well), not destroying the hardware of non-enterprise rotational disks and users' warranties by rereading all data for every backup when using borg 1.x. (Rotational disks are now rated for volume of reads per day/week/month, criminal though this should be) This approach also allows you to ignore distribution-specific implementation challenges; here the support burden will fall on the snapshotting creation and rotation software. Ie: Snapper already handles all of the corner cases of SUSE's complex layout, so borgmatic doesn't need to reimplement that logic. Will MRs/PRs be a high-friction series of arguments? Are there Hetzner-funded bug bounties for adding features and fixing bugs? Regards, Nicholas
Owner

I'd have to read up on btrfs some more to weigh in on how to handle read-only subvolumes correctly.

I'll continue research sometime later, and I can create specific issues for the problems I'm having, if you prefer. That may require adjustments in borgmatic.service file, which is a different topic.

@dmitry-t7ko Yes, research on snapshotting read-only subvolumes and a separate issue for your systemd problem would both be appreciated!

> I'd have to read up on btrfs some more to weigh in on how to handle read-only subvolumes correctly. > > I'll continue research sometime later, and I can create specific issues for the problems I'm having, if you prefer. That may require adjustments in borgmatic.service file, which is a different topic. @dmitry-t7ko Yes, research on snapshotting read-only subvolumes and a separate issue for your systemd problem would both be appreciated!
Owner

@sten

Sorry for the delay. Something seems to have gone wrong when I tried replying by email. It's my first time using Gitea, and I avoid using web interfaces whenever possible.

Yeah, I don't think Gitea has comment-by-email functionality like Debian's BTS has.

When is this a better idea than taking a read-only snapshot, and why?

Above, we were discussing snapshotting read-only subvolumes (and the borgmatic documentation's claim that "Btrfs does not support snapshotting read-only subvolumes."). So I was first making an example subvolume read-only so that I could demonstrate what happened on my machine when I tried to take a read-only snapshot of it.

Your reproducer doesn't reproduce that error. Here is a tested reproducer that you can use to confirm this:

Unfortunately this doesn't work on my system, because I'm not running a Btrfs root. (I'm running ext4.) Here's the mount error I get from the mount:

mount: /btrfs-admin: fsconfig() failed: ext4: Unknown parameter 'subvolid'.
       dmesg(1) may have more information after failed mount system call.

Also, the formatting in your example is a little hard to read for me.. I couldn't determine if you were actually setting the ro property on your original subvolume. Assuming you were, maybe the defining difference is that you're running a Btrfs root while I'm not? And that's why my example works without error on your machine?

Could you say more about this?

What are you interested to know about? In the above there are two philosophical principles, a practical/engineering one, an implementation fact, a ~10 page article, and a statement of fact about a statement of fact.

I meant specifically: Can you say more about how this concern applies to borgmatic's Btrfs support? For instance, does borgmatic somehow assume nested subvolumes rather than flat?

I've now tested borgmatic 2.0.6, studied the source, and more than the docs need work.

Feedback is of course welcome. PRs are too.

How would you like to proceed?

I'm not sure I'm following all of the concerns / suggestions so far, so maybe getting that ironed out would be a good place to start! Additionally I have a few questions on your other comments below.

I can also make implementation recommendations (ie: Don't use findmnt, because it will never provide an accurate btrfs view. Longterm, you'll probably switch to the more reliable btrfs python module. Short-term, calling btrfs cli command will work for the required simple cases).

I think implementation recommendations would be good here, because I need to understand the approach even if I'm ultimately just reviewing a PR. You say to use the btrfs CLI instead of findmnt. Great! Can you maybe provide a stand-alone example of how that would work? I think I used findmnt because I couldn't find a way with btrfs to list all Btrfs mount points. And I need mount points in particular in order to match those paths against source paths to backup. Similarly, if the btrfs Python module is better, I'd appreciate an example.

Meanwhile it would be significantly faster and easier to write a plugin that leverages an existing snapshotting solution

When the borgmatic Btrfs feature was originally being built, at least one user requested borgmatic not to take a dependency on Snapper for this: #251 (comment) ... We could revisit the decision now of course, but that's the history anyway. If I'm understanding your suggestion though, you're perhaps suggesting that borgmatic relies on Snapper's scheduled snapshots rather than taking manual (Snapper) snapshots prior to backup. I'm not sure that would work for many user's use cases, however, because then the snapshots could be stale in relation to when the backup is taken.

Having said that though, I could see adding a separate Snapper hook that relies on Snapper integration for Btrfs users who also happen to be using Snapper.

Will MRs/PRs be a high-friction series of arguments?

Two points here:

  1. Just in general, I think it's good to iron out an approach prior to submitting PRs because that avoids a bunch of rework for the PR submitter. So if you're game, I'd be happy to work out the approach here first. Alternatively, if you don't mind rework, you could submit your "approach" in the form of a WIP PR.

  2. I've been told I'm a stickler for code style considerations in PRs, although this is hopefully not a big concern because it's less substantive / requires less rework.

Are there Hetzner-funded bug bounties for adding features and fixing bugs?

Nope! No bug bounties currently for borgmatic, even if Borg has 'em.

Thank you!

@sten > Sorry for the delay. Something seems to have gone wrong when I tried replying by email. It's my first time using Gitea, and I avoid using web interfaces whenever possible. Yeah, I don't think Gitea has comment-by-email functionality like Debian's BTS has. > When is this a better idea than taking a read-only snapshot, and why? Above, we were discussing snapshotting read-only subvolumes (and the borgmatic documentation's claim that "Btrfs does not support snapshotting read-only subvolumes."). So I was first making an example subvolume read-only so that I could demonstrate what happened on my machine when I tried to take a read-only snapshot of it. > Your reproducer doesn't reproduce that error. Here is a tested reproducer that you can use to confirm this: Unfortunately this doesn't work on my system, because I'm not running a Btrfs root. (I'm running ext4.) Here's the mount error I get from the `mount`: ``` mount: /btrfs-admin: fsconfig() failed: ext4: Unknown parameter 'subvolid'. dmesg(1) may have more information after failed mount system call. ``` Also, the formatting in your example is a little hard to read for me.. I couldn't determine if you were actually setting the `ro` property on your original subvolume. Assuming you were, maybe the defining difference is that you're running a Btrfs root while I'm not? And that's why my example works without error on your machine? > > Could you say more about this? > > What are you interested to know about? In the above there are two philosophical principles, a practical/engineering one, an implementation fact, a ~10 page article, and a statement of fact about a statement of fact. I meant specifically: Can you say more about how this concern applies to borgmatic's Btrfs support? For instance, does borgmatic somehow assume nested subvolumes rather than flat? > I've now tested borgmatic 2.0.6, studied the source, and more than the docs need work. Feedback is of course welcome. PRs are too. > How would you like to proceed? I'm not sure I'm following all of the concerns / suggestions so far, so maybe getting that ironed out would be a good place to start! Additionally I have a few questions on your other comments below. > I can also make implementation recommendations (ie: Don't use findmnt, because it will never provide an accurate btrfs view. Longterm, you'll probably switch to the more reliable btrfs python module. Short-term, calling btrfs cli command will work for the required simple cases). I think implementation recommendations would be good here, because I need to understand the approach even if I'm ultimately just reviewing a PR. You say to use the `btrfs` CLI instead of `findmnt`. Great! Can you maybe provide a stand-alone example of how that would work? I think I used `findmnt` because I couldn't find a way with `btrfs` to list all Btrfs mount points. And I need mount points in particular in order to match those paths against source paths to backup. Similarly, if the `btrfs` Python module is better, I'd appreciate an example. > Meanwhile it would be significantly faster and easier to write a plugin that leverages an existing snapshotting solution When the borgmatic Btrfs feature was originally being built, at least one user requested borgmatic not to take a dependency on Snapper for this: https://projects.torsion.org/borgmatic-collective/borgmatic/issues/251#issuecomment-8211 ... We could revisit the decision now of course, but that's the history anyway. If I'm understanding your suggestion though, you're perhaps suggesting that borgmatic relies on Snapper's scheduled snapshots rather than taking manual (Snapper) snapshots prior to backup. I'm not sure that would work for many user's use cases, however, because then the snapshots could be stale in relation to when the backup is taken. Having said that though, I could see adding a *separate* Snapper hook that relies on Snapper integration for Btrfs users who also happen to be using Snapper. > Will MRs/PRs be a high-friction series of arguments? Two points here: 1. Just in general, I think it's good to iron out an approach prior to submitting PRs because that avoids a bunch of rework for the PR submitter. So if you're game, I'd be happy to work out the approach here first. Alternatively, if you don't mind rework, you could submit your "approach" in the form of a WIP PR. 2. I've been told I'm a stickler for code style considerations in PRs, although this is hopefully not a big concern because it's less substantive / requires less rework. > Are there Hetzner-funded bug bounties for adding features and fixing bugs? Nope! No bug bounties currently for borgmatic, even if Borg has 'em. Thank you!
Owner

Quoting myself here from above:

Can you maybe provide a stand-alone example of how that would work? I think I used findmnt because I couldn't find a way with btrfs to list all Btrfs mount points. And I need mount points in particular in order to match those paths against source paths to backup.

Here's an idea from a related ticket (#1043):

IMO having the btrfs hook do a first pass of source_directories using btrfs subvolume show (and checking for level 5 prior to running findmnt would solve this problem and be essentially transparent to users. Point borgmatic to a directory and it will snapshot it if possible or find a parent to snapshot.

Maybe something like that would work? So loop through the source directories to backup, running btrfs subvolume show on each path to determine if it's a Btrfs subvolume? If it is, use findmnt just on that path to get its mount point...?

Quoting myself here from above: > Can you maybe provide a stand-alone example of how that would work? I think I used findmnt because I couldn't find a way with btrfs to list all Btrfs mount points. And I need mount points in particular in order to match those paths against source paths to backup. Here's an idea from a related ticket (#1043): > IMO having the btrfs hook do a first pass of source_directories using btrfs subvolume show <path>(and checking for level 5 prior to running findmnt <path> would solve this problem and be essentially transparent to users. Point borgmatic to a directory and it will snapshot it if possible or find a parent to snapshot. Maybe something like that would work? So loop through the source directories to backup, running `btrfs subvolume show` on each path to determine if it's a Btrfs subvolume? If it is, use `findmnt` just on that path to get its mount point...?
Owner

In #1113, I have a proposed WIP implementation of this kind of introspection. It does still relies on findmnt as a first step, but it's (hopefully) no longer conflating Btrfs subvolumes with mount points. And so it should better support "flat" (vs. nested) subvolumes.

In https://projects.torsion.org/borgmatic-collective/borgmatic/pulls/1113, I have a proposed WIP implementation of this kind of introspection. It does still relies on `findmnt` as a first step, but it's (hopefully) no longer conflating Btrfs subvolumes with mount points. And so it should better support "flat" (vs. nested) subvolumes.
Owner

That PR has been merged now as part of #1043.

That PR has been merged now as part of #1043.

I wanted to ask if it would be possible to activate snapshots for btrfs in general.
As I understand it so far, the function in borgmatic is only implemented for subvolumes.
So far I have used borgmatic action to create a snapshot of a folder before backing it up.
This works fine, but unfortunately the path is moved to the snapshot and not the actual folder.

I wanted to ask if it would be possible to activate snapshots for btrfs in general. As I understand it so far, the function in borgmatic is only implemented for subvolumes. So far I have used borgmatic action to create a snapshot of a folder before backing it up. This works fine, but unfortunately the path is moved to the snapshot and not the actual folder.
Owner

I wanted to ask if it would be possible to activate snapshots for btrfs in general.
As I understand it so far, the function in borgmatic is only implemented for subvolumes.

Could you say more about what you have in mind here? Like, what would you want snapshotted besides subvolumes, and how do you foresee that being used?

So far I have used borgmatic action to create a snapshot of a folder before backing it up.
This works fine, but unfortunately the path is moved to the snapshot and not the actual folder.

Could you also say more about this? And what version of Borg are you using? The stored snapshot path within the Borg archive should be the actual folder path if you're using Borg 1.4+. Older versions of Borg (e.g. 1.2) don't support this, so the stored archive path will contain the snapshot directory when using these older Borg versions.

> I wanted to ask if it would be possible to activate snapshots for btrfs in general. > As I understand it so far, the function in borgmatic is only implemented for subvolumes. Could you say more about what you have in mind here? Like, what would you want snapshotted besides subvolumes, and how do you foresee that being used? > So far I have used borgmatic action to create a snapshot of a folder before backing it up. > This works fine, but unfortunately the path is moved to the snapshot and not the actual folder. Could you also say more about this? And what version of Borg are you using? The stored snapshot path within the Borg archive should be the actual folder path if you're using Borg 1.4+. Older versions of Borg (e.g. 1.2) don't support this, so the stored archive path will contain the snapshot directory when using these older Borg versions.

I have a NAS with shared Samba folders.
Each folder has its own use and a different backup interval.
All shared folders are on the same btrfs volume and are marked as subvolumes.
When I want to make a backup of one of these folders, I create a snapshot of it so that no files are changed during the backup process.
The problem is the new path.
borgmatic saves the path to the snapshot and not the folder itself that I want to backup.

I refer to the borgmatic documentation:
https://torsion.org/borgmatic/docs/how-to/snapshot-your-filesystems/

Additionally, borgmatic rewrites the snapshot file paths so that they appear at their original subvolume locations in a Borg archive. For instance, if your subvolume path is /var/subvolume, then the snapshotted files will appear in an archive at /var/subvolume as well—even if borgmatic has to mount the snapshot somewhere in /var/subvolume/.borgmatic-snapshot-1234/ to perform the backup."

That's what I want to achieve for my backup.

This is one of my borgmatic configurations:

<<: !include /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Repo/Repo-USBHDD2.yaml

source_directories:
    - /volume1/Daten.snapshot

archive_name_format: '{hostname}-Daten-{now:%Y-%m-%dT%H:%M}'

keep_monthly: 12

keep_yearly: 2

commands:
    - before: action
      when: [create]
      run:
          - echo "Backup von Daten gestartet."
          - if [ -d /volume1/Daten.snapshot ]; then btrfs subvolume delete /volume1/Daten.snapshot > /dev/null; fi
          - btrfs subvolume snapshot -r /volume1/Daten /volume1/Daten.snapshot > /dev/null

    - after: action
      when: [create]
      run:
          - btrfs subvolume delete /volume1/Daten.snapshot > /dev/null
          - echo "Backup von Daten beendet."

But when I use your btrfs flag instead of my commands

<<: !include /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Repo/Repo-USBHDD2.yaml

source_directories:
    - /volume1/Daten

archive_name_format: '{hostname}-Daten-{now:%Y-%m-%dT%H:%M}'

keep_monthly: 12

keep_yearly: 2

commands:
    - before: action
      when: [create]
      run:
          - echo "Backup von Daten gestartet."

    - after: action
      when: [create]
      run:
          - echo "Backup von Daten beendet."

btrfs:

I get this message:

No Btrfs subvolumes found to snapshot.

And no snapshot is created during the backup.

Setup:
System: Synology NAS 1819+ (DSM 7.2.2-72806 Update 3)
Borg: 1.4.1 (via SynoCommunity 1.4.1-18)
borgmatic: 2.0.3 (via SynoCommunity 1.4.1-18)

I have a NAS with shared Samba folders. Each folder has its own use and a different backup interval. All shared folders are on the same btrfs volume and are marked as subvolumes. When I want to make a backup of one of these folders, I create a snapshot of it so that no files are changed during the backup process. The problem is the new path. borgmatic saves the path to the snapshot and not the folder itself that I want to backup. I refer to the borgmatic documentation: https://torsion.org/borgmatic/docs/how-to/snapshot-your-filesystems/ >Additionally, borgmatic rewrites the snapshot file paths so that they appear at their original subvolume locations in a Borg archive. For instance, if your subvolume path is /var/subvolume, then the snapshotted files will appear in an archive at /var/subvolume as well—even if borgmatic has to mount the snapshot somewhere in /var/subvolume/.borgmatic-snapshot-1234/ to perform the backup." That's what I want to achieve for my backup. This is one of my borgmatic configurations: ``` <<: !include /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Repo/Repo-USBHDD2.yaml source_directories: - /volume1/Daten.snapshot archive_name_format: '{hostname}-Daten-{now:%Y-%m-%dT%H:%M}' keep_monthly: 12 keep_yearly: 2 commands: - before: action when: [create] run: - echo "Backup von Daten gestartet." - if [ -d /volume1/Daten.snapshot ]; then btrfs subvolume delete /volume1/Daten.snapshot > /dev/null; fi - btrfs subvolume snapshot -r /volume1/Daten /volume1/Daten.snapshot > /dev/null - after: action when: [create] run: - btrfs subvolume delete /volume1/Daten.snapshot > /dev/null - echo "Backup von Daten beendet." ``` But when I use your btrfs flag instead of my commands ``` <<: !include /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Repo/Repo-USBHDD2.yaml source_directories: - /volume1/Daten archive_name_format: '{hostname}-Daten-{now:%Y-%m-%dT%H:%M}' keep_monthly: 12 keep_yearly: 2 commands: - before: action when: [create] run: - echo "Backup von Daten gestartet." - after: action when: [create] run: - echo "Backup von Daten beendet." btrfs: ``` I get this message: > No Btrfs subvolumes found to snapshot. And no snapshot is created during the backup. Setup: System: Synology NAS 1819+ (DSM 7.2.2-72806 Update 3) Borg: 1.4.1 (via SynoCommunity 1.4.1-18) borgmatic: 2.0.3 (via SynoCommunity 1.4.1-18)
Owner

A few things:

  • I recommend upgrading borgmatic to 2.0.7 and trying again. There were a few Btrfs improvements since borgmatic 2.0.3 that may be affecting things here.
  • Does /volume1/Daten show up in findmnt output as a btrfs filesystem?
  • What btrfs subvolume show /volume1/Daten output?
  • Seeing your borgmatic logs with --verbose 2 would be helpful here. (Feel free to redact.)
A few things: * I recommend upgrading borgmatic to 2.0.7 and trying again. There were a few Btrfs improvements since borgmatic 2.0.3 that may be affecting things here. * Does `/volume1/Daten` show up in `findmnt` output as a `btrfs` filesystem? * What `btrfs subvolume show /volume1/Daten` output? * Seeing your borgmatic logs with `--verbose 2` would be helpful here. (Feel free to redact.)

Q: I recommend upgrading borgmatic to 2.0.7 and trying again. There were a few Btrfs improvements since borgmatic 2.0.3 that may be affecting things here.
A: pipx is unfortunately not available on the Synology system. Docker will probably not work due to the access to the host system. I used to be able to install borgmatic without SynoCommunity, but that was over 4 years ago.

Q: Does /volume1/Daten show up in findmnt output as a btrfs filesystem?
A: No, because it has no mountpoint, it is more like a nested subvolume.
https://btrfs.readthedocs.io/en/latest/Subvolumes.html

root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# findmnt
TARGET                             SOURCE                         FSTYPE     OPTIONS
/                                  /dev/md0                       ext4       rw,noatime,prjquota,rootprjquota,data=ordered
...
├─/volume1                         /dev/mapper/cachedev_0[/@syno] btrfs      rw,nodev,noatime,ssd,synoacl,space_cache=v2,auto_reclaim_space,metadata_ratio=50,
│ └─/volume1/@accountdb/@accountcache
│                                  /dev/loop1                     ext4       rw,noatime,data=ordered
...

Q: What btrfs subvolume show /volume1/Daten output?

root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# btrfs subvolume show /volume1/Daten/
/volume1/Daten
        Name:                   Daten
        UUID:                   a1b9da8f-19d6-bc42-907f-6d8abaf1e5d8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2022-11-11 21:06:29 +0100
        Subvolume ID:           274
        Generation:             56734253
        Gen at creation:        306
        Parent ID:              256
        Top level ID:           256
        Flags:                  -
        Snapshot(s):
root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# btrfs subvolume show /volume1
/volume1
        Name:                   @syno
        UUID:                   ce6d9a93-44d2-5747-8fad-81860154d7b3
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2022-11-11 19:24:29 +0100
        Subvolume ID:           256
        Generation:             56734255
        Gen at creation:        9
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Snapshot(s):
root@Hermes:/volume1# btrfs subvolume list /volume1
ID 256 gen 56734255 top level 5 path @syno
...
ID 274 gen 56734255 top level 256 path Daten
...

btrfs subvolume show /volume1/Daten/ after creating a snapshot

root@Hermes:/volume1# btrfs subvolume show /volume1/Daten/
/volume1/Daten
        Name:                   Daten
        UUID:                   a1b9da8f-19d6-bc42-907f-6d8abaf1e5d8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2022-11-11 21:06:29 +0100
        Subvolume ID:           274
        Generation:             56734256
        Gen at creation:        306
        Parent ID:              256
        Top level ID:           256
        Flags:                  -
        Snapshot(s):
                                @syno/Daten.snapshot
root@Hermes:/volume1# btrfs subvolume show /volume1/Daten.snapshot
/volume1/Daten.snapshot
        Name:                   Daten.snapshot
        UUID:                   9a9cf00d-41db-6648-bd4b-c2e75193e8d4
        Parent UUID:            a1b9da8f-19d6-bc42-907f-6d8abaf1e5d8
        Received UUID:          9a9cf00d-41db-6648-bd4b-c2e75193e8d4
        Creation time:          2025-07-29 01:20:40 +0200
        Subvolume ID:           8789
        Generation:             56734256
        Gen at creation:        56734256
        Parent ID:              256
        Top level ID:           256
        Flags:                  readonly
        Snapshot(s):
root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# btrfs subvolume show /volume1/
/volume1
        Name:                   @syno
        UUID:                   ce6d9a93-44d2-5747-8fad-81860154d7b3
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2022-11-11 19:24:29 +0100
        Subvolume ID:           256
        Generation:             56734266
        Gen at creation:        9
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Snapshot(s):
root@Hermes:/volume1# btrfs subvolume list /volume1
ID 256 gen 56734266 top level 5 path @syno
...
ID 274 gen 56734256 top level 256 path Daten
...
ID 8789 gen 56734256 top level 256 path Daten.snapshot

Q: Seeing your borgmatic logs with --verbose 2 would be helpful here. (Feel free to redact.)

root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# borgmatic -C -v 2 -c ./Daten-new.yaml
Running 2 commands for before everything hook
BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** if [ -f /volume1/local/log/borgmatic-USBHDD.log ]; then rm /volume1/local/log/borgmatic-USBHDD.log > /dev/null; fi
BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** echo "Backup gestartet."
Backup gestartet.
/volume1/local/etc/borgmatic.d/Repo-USBHDD2/Daten-new.yaml: BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** BORG_SECURITY_DIR=*** BORG_KEYS_DIR=*** BORG_PASSPHRASE_FD=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc
/volume1/local/etc/borgmatic.d/Repo-USBHDD2/Daten-new.yaml: Borg 1.4.1
Seagate Expansion Desktop 16TB: Running actions for repository
Seagate Expansion Desktop 16TB: Running before create action command hook
Seagate Expansion Desktop 16TB: BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** echo "Backup von Daten gestartet."
Backup von Daten gestartet.
Seagate Expansion Desktop 16TB: Creating archive
Seagate Expansion Desktop 16TB: Using runtime directory /tmp/borgmatic-7repwdj9/borgmatic
Seagate Expansion Desktop 16TB: Calling bootstrap hook function remove_data_source_dumps
Seagate Expansion Desktop 16TB: Looking for bootstrap manifest files to remove in /tmp/borgmatic-*/borgmatic/bootstrap
Seagate Expansion Desktop 16TB: Calling btrfs hook function remove_data_source_dumps
Seagate Expansion Desktop 16TB: findmnt -t btrfs --json --list
Seagate Expansion Desktop 16TB: btrfs property get -t subvol /volume1 ro
Seagate Expansion Desktop 16TB: Looking for snapshots to remove in /volume1/.borgmatic-snapshot-*/volume1
Seagate Expansion Desktop 16TB: Calling lvm hook function remove_data_source_dumps
Seagate Expansion Desktop 16TB: Calling mariadb hook function remove_data_source_dumps
Seagate Expansion Desktop 16TB: Removing MariaDB data source dumps
Seagate Expansion Desktop 16TB: Calling mongodb hook function remove_data_source_dumps
Seagate Expansion Desktop 16TB: Removing MongoDB data source dumps
Seagate Expansion Desktop 16TB: Calling mysql hook function remove_data_source_dumps
Seagate Expansion Desktop 16TB: Removing MySQL data source dumps
Seagate Expansion Desktop 16TB: Calling postgresql hook function remove_data_source_dumps
Seagate Expansion Desktop 16TB: Removing PostgreSQL data source dumps
Seagate Expansion Desktop 16TB: Calling sqlite hook function remove_data_source_dumps
Seagate Expansion Desktop 16TB: Removing SQLite data source dumps
Seagate Expansion Desktop 16TB: Calling zfs hook function remove_data_source_dumps
Seagate Expansion Desktop 16TB: Calling bootstrap hook function dump_data_sources
Seagate Expansion Desktop 16TB: Calling btrfs hook function dump_data_sources
Seagate Expansion Desktop 16TB: Snapshotting Btrfs subvolumes
Seagate Expansion Desktop 16TB: findmnt -t btrfs --json --list
Seagate Expansion Desktop 16TB: btrfs property get -t subvol /volume1 ro
Seagate Expansion Desktop 16TB: No Btrfs subvolumes found to snapshot
Seagate Expansion Desktop 16TB: Writing patterns to /tmp/borgmatic-7repwdj9/borgmatic/tmpi1opkpxk:
R /volume1/Daten
- R /
- **/#recycle
- **/#snapshot
- **/$RECYCLE.BIN
- **/.@__thumb
- **/._*
- **/.DS_Store
- **/.TemporaryItems
- **/@Recycle
- **/@eaDir
- **/@recycle
- **/@tmp
- **/desktop.ini
- **/SYNO@.fileindexdb
- **/Thumbs.db
R /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Daten-new.yaml
R /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Repo/Repo-USBHDD2.yaml
R /volume1/local/etc/borgmatic/common.yaml
R /tmp/borgmatic-7repwdj9/./borgmatic/bootstrap
Seagate Expansion Desktop 16TB: BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** BORG_SECURITY_DIR=*** BORG_KEYS_DIR=*** BORG_PASSPHRASE_FD=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg create --patterns-from /tmp/borgmatic-7repwdj9/borgmatic/tmpi1opkpxk --compression auto,zstd,6 --debug --show-rc /volumeUSB1/usbshare1-1/Borg/backup.borg::{hostname}-Daten-{now:%Y-%m-%dT%H:%M}
using builtin fallback logging configuration
33 self tests completed in 0.44 seconds
Verified integrity of /volumeUSB1/usbshare1-1/Borg/backup.borg/index.1923
TAM-verified manifest
security: read previous location '/volumeUSB1/usbshare1-1/Borg/backup.borg'
security: read manifest timestamp '2025-07-27T11:41:06.125883'
security: determined newest manifest timestamp as 2025-07-27T11:41:06.125883
security: repository checks ok, allowing access
Creating archive at "/volumeUSB1/usbshare1-1/Borg/backup.borg::Hermes-Daten-2025-07-29T01:48"
Verified integrity of /volume1/local/var/cache/borg/7800679435a0d564a42ce9dbcf92024517d5a012c0c13ca43a3b677c497f496d/chunks
Reading files cache ...
Verified integrity of /volume1/local/var/cache/borg/7800679435a0d564a42ce9dbcf92024517d5a012c0c13ca43a3b677c497f496d/files
security: read previous location '/volumeUSB1/usbshare1-1/Borg/backup.borg'
security: read manifest timestamp '2025-07-27T11:41:06.125883'
security: determined newest manifest timestamp as 2025-07-27T11:41:06.125883
security: repository checks ok, allowing access
Processing files ...
Q: I recommend upgrading borgmatic to 2.0.7 and trying again. There were a few Btrfs improvements since borgmatic 2.0.3 that may be affecting things here. A: pipx is unfortunately not available on the Synology system. Docker will probably not work due to the access to the host system. I used to be able to install borgmatic without SynoCommunity, but that was over 4 years ago. Q: Does /volume1/Daten show up in findmnt output as a btrfs filesystem? A: No, because it has no mountpoint, it is more like a nested subvolume. https://btrfs.readthedocs.io/en/latest/Subvolumes.html ``` root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# findmnt TARGET SOURCE FSTYPE OPTIONS / /dev/md0 ext4 rw,noatime,prjquota,rootprjquota,data=ordered ... ├─/volume1 /dev/mapper/cachedev_0[/@syno] btrfs rw,nodev,noatime,ssd,synoacl,space_cache=v2,auto_reclaim_space,metadata_ratio=50, │ └─/volume1/@accountdb/@accountcache │ /dev/loop1 ext4 rw,noatime,data=ordered ... ``` Q: What btrfs subvolume show /volume1/Daten output? ``` root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# btrfs subvolume show /volume1/Daten/ /volume1/Daten Name: Daten UUID: a1b9da8f-19d6-bc42-907f-6d8abaf1e5d8 Parent UUID: - Received UUID: - Creation time: 2022-11-11 21:06:29 +0100 Subvolume ID: 274 Generation: 56734253 Gen at creation: 306 Parent ID: 256 Top level ID: 256 Flags: - Snapshot(s): ``` ``` root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# btrfs subvolume show /volume1 /volume1 Name: @syno UUID: ce6d9a93-44d2-5747-8fad-81860154d7b3 Parent UUID: - Received UUID: - Creation time: 2022-11-11 19:24:29 +0100 Subvolume ID: 256 Generation: 56734255 Gen at creation: 9 Parent ID: 5 Top level ID: 5 Flags: - Snapshot(s): ``` ``` root@Hermes:/volume1# btrfs subvolume list /volume1 ID 256 gen 56734255 top level 5 path @syno ... ID 274 gen 56734255 top level 256 path Daten ... ``` btrfs subvolume show /volume1/Daten/ after creating a snapshot ``` root@Hermes:/volume1# btrfs subvolume show /volume1/Daten/ /volume1/Daten Name: Daten UUID: a1b9da8f-19d6-bc42-907f-6d8abaf1e5d8 Parent UUID: - Received UUID: - Creation time: 2022-11-11 21:06:29 +0100 Subvolume ID: 274 Generation: 56734256 Gen at creation: 306 Parent ID: 256 Top level ID: 256 Flags: - Snapshot(s): @syno/Daten.snapshot ``` ``` root@Hermes:/volume1# btrfs subvolume show /volume1/Daten.snapshot /volume1/Daten.snapshot Name: Daten.snapshot UUID: 9a9cf00d-41db-6648-bd4b-c2e75193e8d4 Parent UUID: a1b9da8f-19d6-bc42-907f-6d8abaf1e5d8 Received UUID: 9a9cf00d-41db-6648-bd4b-c2e75193e8d4 Creation time: 2025-07-29 01:20:40 +0200 Subvolume ID: 8789 Generation: 56734256 Gen at creation: 56734256 Parent ID: 256 Top level ID: 256 Flags: readonly Snapshot(s): ``` ``` root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# btrfs subvolume show /volume1/ /volume1 Name: @syno UUID: ce6d9a93-44d2-5747-8fad-81860154d7b3 Parent UUID: - Received UUID: - Creation time: 2022-11-11 19:24:29 +0100 Subvolume ID: 256 Generation: 56734266 Gen at creation: 9 Parent ID: 5 Top level ID: 5 Flags: - Snapshot(s): ``` ``` root@Hermes:/volume1# btrfs subvolume list /volume1 ID 256 gen 56734266 top level 5 path @syno ... ID 274 gen 56734256 top level 256 path Daten ... ID 8789 gen 56734256 top level 256 path Daten.snapshot ``` Q: Seeing your borgmatic logs with --verbose 2 would be helpful here. (Feel free to redact.) ``` root@Hermes:/volume1/local/etc/borgmatic.d/Repo-USBHDD2# borgmatic -C -v 2 -c ./Daten-new.yaml Running 2 commands for before everything hook BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** if [ -f /volume1/local/log/borgmatic-USBHDD.log ]; then rm /volume1/local/log/borgmatic-USBHDD.log > /dev/null; fi BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** echo "Backup gestartet." Backup gestartet. /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Daten-new.yaml: BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** BORG_SECURITY_DIR=*** BORG_KEYS_DIR=*** BORG_PASSPHRASE_FD=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Daten-new.yaml: Borg 1.4.1 Seagate Expansion Desktop 16TB: Running actions for repository Seagate Expansion Desktop 16TB: Running before create action command hook Seagate Expansion Desktop 16TB: BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** echo "Backup von Daten gestartet." Backup von Daten gestartet. Seagate Expansion Desktop 16TB: Creating archive Seagate Expansion Desktop 16TB: Using runtime directory /tmp/borgmatic-7repwdj9/borgmatic Seagate Expansion Desktop 16TB: Calling bootstrap hook function remove_data_source_dumps Seagate Expansion Desktop 16TB: Looking for bootstrap manifest files to remove in /tmp/borgmatic-*/borgmatic/bootstrap Seagate Expansion Desktop 16TB: Calling btrfs hook function remove_data_source_dumps Seagate Expansion Desktop 16TB: findmnt -t btrfs --json --list Seagate Expansion Desktop 16TB: btrfs property get -t subvol /volume1 ro Seagate Expansion Desktop 16TB: Looking for snapshots to remove in /volume1/.borgmatic-snapshot-*/volume1 Seagate Expansion Desktop 16TB: Calling lvm hook function remove_data_source_dumps Seagate Expansion Desktop 16TB: Calling mariadb hook function remove_data_source_dumps Seagate Expansion Desktop 16TB: Removing MariaDB data source dumps Seagate Expansion Desktop 16TB: Calling mongodb hook function remove_data_source_dumps Seagate Expansion Desktop 16TB: Removing MongoDB data source dumps Seagate Expansion Desktop 16TB: Calling mysql hook function remove_data_source_dumps Seagate Expansion Desktop 16TB: Removing MySQL data source dumps Seagate Expansion Desktop 16TB: Calling postgresql hook function remove_data_source_dumps Seagate Expansion Desktop 16TB: Removing PostgreSQL data source dumps Seagate Expansion Desktop 16TB: Calling sqlite hook function remove_data_source_dumps Seagate Expansion Desktop 16TB: Removing SQLite data source dumps Seagate Expansion Desktop 16TB: Calling zfs hook function remove_data_source_dumps Seagate Expansion Desktop 16TB: Calling bootstrap hook function dump_data_sources Seagate Expansion Desktop 16TB: Calling btrfs hook function dump_data_sources Seagate Expansion Desktop 16TB: Snapshotting Btrfs subvolumes Seagate Expansion Desktop 16TB: findmnt -t btrfs --json --list Seagate Expansion Desktop 16TB: btrfs property get -t subvol /volume1 ro Seagate Expansion Desktop 16TB: No Btrfs subvolumes found to snapshot Seagate Expansion Desktop 16TB: Writing patterns to /tmp/borgmatic-7repwdj9/borgmatic/tmpi1opkpxk: R /volume1/Daten - R / - **/#recycle - **/#snapshot - **/$RECYCLE.BIN - **/.@__thumb - **/._* - **/.DS_Store - **/.TemporaryItems - **/@Recycle - **/@eaDir - **/@recycle - **/@tmp - **/desktop.ini - **/SYNO@.fileindexdb - **/Thumbs.db R /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Daten-new.yaml R /volume1/local/etc/borgmatic.d/Repo-USBHDD2/Repo/Repo-USBHDD2.yaml R /volume1/local/etc/borgmatic/common.yaml R /tmp/borgmatic-7repwdj9/./borgmatic/bootstrap Seagate Expansion Desktop 16TB: BORG_CACHE_DIR=*** BORG_CONFIG_DIR=*** PGDATA=*** BORG_SECURITY_DIR=*** BORG_KEYS_DIR=*** BORG_PASSPHRASE_FD=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg create --patterns-from /tmp/borgmatic-7repwdj9/borgmatic/tmpi1opkpxk --compression auto,zstd,6 --debug --show-rc /volumeUSB1/usbshare1-1/Borg/backup.borg::{hostname}-Daten-{now:%Y-%m-%dT%H:%M} using builtin fallback logging configuration 33 self tests completed in 0.44 seconds Verified integrity of /volumeUSB1/usbshare1-1/Borg/backup.borg/index.1923 TAM-verified manifest security: read previous location '/volumeUSB1/usbshare1-1/Borg/backup.borg' security: read manifest timestamp '2025-07-27T11:41:06.125883' security: determined newest manifest timestamp as 2025-07-27T11:41:06.125883 security: repository checks ok, allowing access Creating archive at "/volumeUSB1/usbshare1-1/Borg/backup.borg::Hermes-Daten-2025-07-29T01:48" Verified integrity of /volume1/local/var/cache/borg/7800679435a0d564a42ce9dbcf92024517d5a012c0c13ca43a3b677c497f496d/chunks Reading files cache ... Verified integrity of /volume1/local/var/cache/borg/7800679435a0d564a42ce9dbcf92024517d5a012c0c13ca43a3b677c497f496d/files security: read previous location '/volumeUSB1/usbshare1-1/Borg/backup.borg' security: read manifest timestamp '2025-07-27T11:41:06.125883' security: determined newest manifest timestamp as 2025-07-27T11:41:06.125883 security: repository checks ok, allowing access Processing files ... ```
Owner

Thanks for all of the additional details. In regards to upgrading, you don't have to use pipx to install borgmatic. You can even use pip install or pip install --user if Synology has that available.

The "good news" is that you don't actually need to upgrade right now because upgrading won't fix your problem—because borgmatic doesn't yet support snapshotting unmounted Btrfs subvolumes. The bad news is any eventual fix for this will still require a borgmatic upgrade.

In terms of solutions, here's what I can think of:

  • I can look into whether borgmatic can be updated to support snapshotting unmounted Btrfs subvolumes. I would appreciate if you file a separate ticket for that though.
  • Or: As a workaround, you can just mount the subvolume, and then presumably borgmatic would discover it.

Also, would you mind telling me how this unmounted subvolume was created to begin with, either here or in whatever ticket you file? That would help me reproduce your setup.

Thanks for all of the additional details. In regards to upgrading, you don't have to use pipx to install borgmatic. You can even use `pip install` or `pip install --user` [if Synology has that available](https://kb.synology.com/en-us/DSM/tutorial/Set_up_Python_virtual_environment_on_NAS). The "good news" is that you don't actually need to upgrade right now because upgrading won't fix your problem—because borgmatic doesn't yet support snapshotting unmounted Btrfs subvolumes. The bad news is any eventual fix for this will still require a borgmatic upgrade. In terms of solutions, here's what I can think of: - I can look into whether borgmatic can be updated to support snapshotting unmounted Btrfs subvolumes. I would appreciate if you file a separate ticket for that though. - *Or:* As a workaround, you can just mount the subvolume, and then presumably borgmatic would discover it. Also, would you mind telling me how this unmounted subvolume was created to begin with, either here or in whatever ticket you file? That would help me reproduce your setup.
Author

The "good news" is that you don't actually need to upgrade right now because upgrading won't fix your problem—because borgmatic doesn't yet support snapshotting unmounted Btrfs subvolumes. The bad news is any eventual fix for this will still require a borgmatic upgrade.

There is no such thing "unmounted Btrfs subvolumes". findmnt will never support normal subvolumes, because normal subvolumes do not, and should not, appear in /etc/fstab, /etc/mtab, or /proc/self/mountinfo.

In terms of solutions, here's what I can think of:

  • I can look into whether borgmatic can be updated to support snapshotting unmounted Btrfs subvolumes. I would appreciate if you file a separate ticket for that though.

Stop using findmnt and either call btrfs subvolume list or (recommended) use the python module.

  • Or: As a workaround, you can just mount the subvolume, and then presumably borgmatic would discover it.

Also, would you mind telling me how this unmounted subvolume was created to begin with, either here or in whatever ticket you file? That would help me reproduce your setup.

There's no such thing as an "unmounted subvolume", and it doesn't matter if it was created with mkfs.btrfs or with btrfs subvolume create. You mount the fs using the block device. Specifying a subvolume is a btrfs-specific implementation of an optional namespacing feature that even ext4 now supports (here it uses a directory as the / of the mount).

> The "good news" is that you don't actually need to upgrade right now because upgrading won't fix your problem—because borgmatic doesn't yet support snapshotting unmounted Btrfs subvolumes. The bad news is any eventual fix for this will still require a borgmatic upgrade. There is no such thing "unmounted Btrfs subvolumes". `findmnt` will never support **normal subvolumes**, because normal subvolumes do not, and should not, appear in /etc/fstab, /etc/mtab, or /proc/self/mountinfo. > In terms of solutions, here's what I can think of: > > - I can look into whether borgmatic can be updated to support snapshotting unmounted Btrfs subvolumes. I would appreciate if you file a separate ticket for that though. Stop using `findmnt` and either call `btrfs subvolume list` or (recommended) use the python module. > - *Or:* As a workaround, you can just mount the subvolume, and then presumably borgmatic would discover it. > > Also, would you mind telling me how this unmounted subvolume was created to begin with, either here or in whatever ticket you file? That would help me reproduce your setup. There's no such thing as an "unmounted subvolume", and it doesn't matter if it was created with mkfs.btrfs or with `btrfs subvolume create`. You mount the fs using the block device. Specifying a subvolume is a btrfs-specific implementation of an optional namespacing feature that even ext4 now supports (here it uses a directory as the / of the mount).
Author

What? Argh.. web things.. Edititing now...

What? Argh.. web things.. Edititing now...
Author

Sorry for the delay. Something seems to have gone wrong when I tried replying by email. It's my first time using Gitea, and I avoid using web interfaces whenever possible.

Yeah, I don't think Gitea has comment-by-email functionality like Debian's BTS has.

Isn't Gitea the odd one out here? I assume you've used Github, Gitlab, Buzilla, etc, all of which have functional reply-by-email? ;)

When is this a better idea than taking a read-only snapshot, and why?

Above, we were discussing snapshotting read-only subvolumes (and the borgmatic documentation's claim that "Btrfs does not support snapshotting read-only subvolumes."). So I was first making an example subvolume read-only so that I could demonstrate what happened on my machine when I tried to take a read-only snapshot of it.

Yes, I understand that, but please answer the question. Why is mucking with special properties (and then unmucking) a better idea than creating an ephemeral read-only snapshot and leaving the source untouched?

Please provide a reproducer so I can see why your machine is failing at basic functionality. At this point one explanation is that your system is affected by bugs affecting btrfs special properties...

Your reproducer doesn't reproduce that error. Here is a tested reproducer that you can use to confirm this:

Unfortunately this doesn't work on my system, because I'm not running a Btrfs root. (I'm running ext4.) Here's the mount error I get from the mount:

mount: /btrfs-admin: fsconfig() failed: ext4: Unknown parameter 'subvolid'.
       dmesg(1) may have more information after failed mount system call.

Ah, yes my convenient setup commands assume you've booted a VM that has a btrfs rootfs. Those will need to be modified for /arbitrary/mount/point, but I'd hope that borgmatic is being tested on a real system like users use.

Also, the formatting in your example is a little hard to read for me.. I couldn't determine if you were actually setting the ro property on your original subvolume.

My reproducer demonstrates that the claim that btrfs cannot snapshot a ro subvolume is false for the special property mucking case as well as the more reliable best-practises (ie create ro snapshot of a ro snapshot) cases.

Assuming you were, maybe the defining difference is that you're running a Btrfs root while I'm not?

I mean, yeah, you'll need to modify the command I provided to get the block device for / if you're trying to get it for /some_mnt/. But booting off of btrfs? There is no special magic there. It will take a few minutes to install a VM and run my reproducer. Actually, on that topic, does borgmatic have access to a VM-backed CI? It seems to me that these would make good sanity checks, before doing CI on borgmatics btrfs functionality.

And that's why my example works without error on your machine?

No, there is something else on your test-bed that is leading to idiosyncratic results. Please provide a full reproducer.

I can also make implementation recommendations (ie: Don't use findmnt, because it will never provide an accurate btrfs view. Longterm, you'll probably switch to the more reliable btrfs python module. Short-term, calling btrfs cli command will work for the required simple cases).

I think implementation recommendations would be good here, because I need to understand the approach even if I'm ultimately just reviewing a PR. You say to use the btrfs CLI instead of findmnt. Great! Can you maybe provide a stand-alone example of how that would work? I think I used findmnt because I couldn't find a way with btrfs to list all Btrfs mount points. And I need mount points in particular in order to match those paths against source paths to backup. Similarly, if the btrfs Python module is better, I'd appreciate an example.

The standard btrfs CLI is /usr/bin/btrfs and its subcommands. (ie: btrfs subvolume list /mount/point) Have you read the examples for the python module here yet: https://github.com/knorrie/python-btrfs ?

Meanwhile it would be significantly faster and easier to write a plugin that leverages an existing snapshotting solution
[snip]
Having said that though, I could see adding a separate Snapper hook that relies on Snapper integration for Btrfs users who also happen to be using Snapper.

Yes, that's why I called it a plugin ;) I'm not talking about replacing the difficult-to-implement-correctly-and-reliably btrfs support with support for a specific blessed snapshot manager and then calling that borgmatic's btrfs support. In addition to snapper, there is an Ubuntu-specific one, and yabsnap. Please point me in the direction of the kind of interface you'd expect in the config.

If we're talking interfaces, the excellent choice to use YAML means that a take_new_snapshot boolean property can be added globally, or per-thing :)

Will MRs/PRs be a high-friction series of arguments?

Two points here:

  1. Just in general, I think it's good to iron out an approach prior to submitting PRs because that avoids a bunch of rework for the PR submitter. So if you're game, I'd be happy to work out the approach here first. Alternatively, if you don't mind rework, you could submit your "approach" in the form of a WIP PR.

Yes, this is what I'm asking about. I'm interested in implementing a snapshot-manager plugin because then I don't need to teach you btrfs ;) Would you please point me to a design/schema/interfaces document? What do you mean by "approach"? What I'm proposing is arguably just enabling syntactic sugar for the YAML config, plus two or three ultra-short example configurations as documentation. The objective is to make it near effortless for users.

  1. I've been told I'm a stickler for code style considerations in PRs, although this is hopefully not a big concern because it's less substantive / requires less rework.

That's fine with me :) It's potential fundamental irreconcilable differences that I'm worried about.

> > Sorry for the delay. Something seems to have gone wrong when I tried replying by email. It's my first time using Gitea, and I avoid using web interfaces whenever possible. > > Yeah, I don't think Gitea has comment-by-email functionality like Debian's BTS has. Isn't Gitea the odd one out here? I assume you've used Github, Gitlab, Buzilla, etc, all of which have functional reply-by-email? ;) > > When is this a better idea than taking a read-only snapshot, and why? > > Above, we were discussing snapshotting read-only subvolumes (and the borgmatic documentation's claim that "Btrfs does not support snapshotting read-only subvolumes."). So I was first making an example subvolume read-only so that I could demonstrate what happened on my machine when I tried to take a read-only snapshot of it. Yes, I understand that, but please answer the question. Why is mucking with special properties (and then unmucking) a better idea than creating an ephemeral read-only snapshot and leaving the source untouched? Please provide a reproducer so I can see why your machine is failing at basic functionality. At this point one explanation is that your system is affected by bugs affecting btrfs special properties... > > Your reproducer doesn't reproduce that error. Here is a tested reproducer that you can use to confirm this: > > Unfortunately this doesn't work on my system, because I'm not running a Btrfs root. (I'm running ext4.) Here's the mount error I get from the `mount`: > > ``` > mount: /btrfs-admin: fsconfig() failed: ext4: Unknown parameter 'subvolid'. > dmesg(1) may have more information after failed mount system call. > ``` Ah, yes my convenient setup commands assume you've booted a VM that has a btrfs rootfs. Those will need to be modified for /arbitrary/mount/point, but I'd hope that borgmatic is being tested on a real system like users use. > Also, the formatting in your example is a little hard to read for me.. I couldn't determine if you were actually setting the `ro` property on your original subvolume. My reproducer demonstrates that the claim that btrfs cannot snapshot a ro subvolume is false for the special property mucking case as well as the more reliable best-practises (ie create ro snapshot of a ro snapshot) cases. >Assuming you were, maybe the defining difference is that you're running a Btrfs root while I'm not? I mean, yeah, you'll need to modify the command I provided to get the block device for / if you're trying to get it for /some_mnt/. But booting off of btrfs? There is no special magic there. It will take a few minutes to install a VM and run my reproducer. Actually, on that topic, does borgmatic have access to a VM-backed CI? It seems to me that these would make good sanity checks, before doing CI on borgmatics btrfs functionality. > And that's why my example works without error on your machine? No, there is something else on your test-bed that is leading to idiosyncratic results. Please provide a full reproducer. > > I can also make implementation recommendations (ie: Don't use findmnt, because it will never provide an accurate btrfs view. Longterm, you'll probably switch to the more reliable btrfs python module. Short-term, calling btrfs cli command will work for the required simple cases). > > I think implementation recommendations would be good here, because I need to understand the approach even if I'm ultimately just reviewing a PR. You say to use the `btrfs` CLI instead of `findmnt`. Great! Can you maybe provide a stand-alone example of how that would work? I think I used `findmnt` because I couldn't find a way with `btrfs` to list all Btrfs mount points. And I need mount points in particular in order to match those paths against source paths to backup. Similarly, if the `btrfs` Python module is better, I'd appreciate an example. The standard btrfs CLI is `/usr/bin/btrfs` and its subcommands. (ie: `btrfs subvolume list /mount/point`) Have you read the examples for the python module here yet: https://github.com/knorrie/python-btrfs ? > > Meanwhile it would be significantly faster and easier to write a plugin that leverages an existing snapshotting solution [snip] > Having said that though, I could see adding a *separate* Snapper hook that relies on Snapper integration for Btrfs users who also happen to be using Snapper. Yes, that's why I called it a plugin ;) I'm not talking about replacing the difficult-to-implement-correctly-and-reliably btrfs support with support for a specific blessed snapshot manager and then calling that borgmatic's btrfs support. In addition to snapper, there is an Ubuntu-specific one, and yabsnap. Please point me in the direction of the kind of interface you'd expect in the config. If we're talking interfaces, the excellent choice to use YAML means that a take_new_snapshot boolean property can be added globally, or per-thing :) > > Will MRs/PRs be a high-friction series of arguments? > > Two points here: > > 1. Just in general, I think it's good to iron out an approach prior to submitting PRs because that avoids a bunch of rework for the PR submitter. So if you're game, I'd be happy to work out the approach here first. Alternatively, if you don't mind rework, you could submit your "approach" in the form of a WIP PR. Yes, this is what I'm asking about. I'm interested in implementing a snapshot-manager plugin because then I don't need to teach you btrfs ;) Would you please point me to a design/schema/interfaces document? What do you mean by "approach"? What I'm proposing is arguably just enabling syntactic sugar for the YAML config, plus two or three ultra-short example configurations as documentation. The objective is to make it near effortless for users. > 2. I've been told I'm a stickler for code style considerations in PRs, although this is hopefully not a big concern because it's less substantive / requires less rework. That's fine with me :) It's potential fundamental irreconcilable differences that I'm worried about.

Unfortunately, I can't tell you exactly how Synology creates the subvolumes.
The OS is Linux but it is very modified.
The subvolume creation is controlled by scripts.
When a Samba shared folder is created via the web interface, a subvolume with the same name is created.

What I can tell you is that Synology does not use btrfs throughout, as some features of btrfs are not yet considered stable (e.g. RAID56).

With Synology, in a RAID 5 installation, each data disk is divided into 3 partitions.
In each of these partitions, a RAID is created across all disks.
The OS is installed on RAID A, a SWAP storage is created on RAID B and an LVM VG is created in RAID C.
All hard disks with their RAID partitions and the LVM VG are called a storage pool.
LVs are then created in the LVM VG which can be formatted either with EXT4 or btrfs. These are called volumes.

By now there is a lot of text in this issue, so even I can hardly get through it,
but to make it short, subvolumes in btrfs are file extent-based.

So they are always included in the hirachy of the btrfs FS-Tree.
This results in two possibilities for dealing with subvolumes:

  1. as file extent-based FS-Tree (directory structure) of the btrfs partition or often called nested. (For me this is the natural way.)
  2. as a mountpoint within the linux kernel system. This has more to do with bending. It has its applications but does not reflect the structure on the btrfs partition.

https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/SysadminGuide.html#Subvolumes

No matter how the subvolume is used later, the subvolume is created as a file extent-based FS-Tree within the btrfs partition.
The command is:
btrfs subvolume create <path/name>

While “findmnt” only shows mount points and gives you the content of /proc/self/mountinfo in a fine structured form,
"btrfs subvolume show " is better suited to find out if a folder/path directs to btrfs subvolume and what properties it has (snapshots, parent subvolumes, ...).

Here is a very minimalistic python script to get a json output (Python is not my primary language):

import subprocess
import sys
import json

def get_btrfs_subvolume_info(path: str):
    try:
        result = subprocess.run(
            ['btrfs', 'subvolume', 'show', path],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            text=True,
            check=True
        )
    except subprocess.CalledProcessError as e:
        print("Error executing btrfs:", e.stderr.strip())
        sys.exit(1)

    info = {}

    for line in result.stdout.splitlines():
        line = line.strip()
        if not line:
            continue

        parts = line.split(":", 1)
        if len(parts) == 2:
            key = parts[0].strip()
            value = parts[1].strip()
            info[key] = value

    return info


def main():
    if len(sys.argv) != 2:
        print("Usage: python btrfs_subvolume_info.py <path_to_subvolume>")
        sys.exit(1)

    path = sys.argv[1]
    info = get_btrfs_subvolume_info(path)
    print(json.dumps(info, indent=2))


if __name__ == "__main__":
    main()

Problems with this script:

  1. Error handling for non btrfs subvolumes
  2. parsing of subvolume snapshots
Unfortunately, I can't tell you exactly how Synology creates the subvolumes. The OS is Linux but it is very modified. The subvolume creation is controlled by scripts. When a Samba shared folder is created via the web interface, a subvolume with the same name is created. What I can tell you is that Synology does not use btrfs throughout, as some features of btrfs are not yet considered stable (e.g. RAID56). With Synology, in a RAID 5 installation, each data disk is divided into 3 partitions. In each of these partitions, a RAID is created across all disks. The OS is installed on RAID A, a SWAP storage is created on RAID B and an LVM VG is created in RAID C. All hard disks with their RAID partitions and the LVM VG are called a storage pool. LVs are then created in the LVM VG which can be formatted either with EXT4 or btrfs. These are called volumes. By now there is a lot of text in this issue, so even I can hardly get through it, but to make it short, subvolumes in btrfs are file extent-based. So they are always included in the hirachy of the btrfs FS-Tree. This results in two possibilities for dealing with subvolumes: 1. as file extent-based FS-Tree (directory structure) of the btrfs partition or often called nested. (For me this is the natural way.) 2. as a mountpoint within the linux kernel system. This has more to do with bending. It has its applications but does not reflect the structure on the btrfs partition. https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/SysadminGuide.html#Subvolumes No matter how the subvolume is used later, the subvolume is created as a file extent-based FS-Tree within the btrfs partition. The command is: btrfs subvolume create <path/name> While “findmnt” only shows mount points and gives you the content of /proc/self/mountinfo in a fine structured form, "btrfs subvolume show <path>" is better suited to find out if a folder/path directs to btrfs subvolume and what properties it has (snapshots, parent subvolumes, ...). Here is a very minimalistic python script to get a json output (Python is not my primary language): ``` import subprocess import sys import json def get_btrfs_subvolume_info(path: str): try: result = subprocess.run( ['btrfs', 'subvolume', 'show', path], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=True ) except subprocess.CalledProcessError as e: print("Error executing btrfs:", e.stderr.strip()) sys.exit(1) info = {} for line in result.stdout.splitlines(): line = line.strip() if not line: continue parts = line.split(":", 1) if len(parts) == 2: key = parts[0].strip() value = parts[1].strip() info[key] = value return info def main(): if len(sys.argv) != 2: print("Usage: python btrfs_subvolume_info.py <path_to_subvolume>") sys.exit(1) path = sys.argv[1] info = get_btrfs_subvolume_info(path) print(json.dumps(info, indent=2)) if __name__ == "__main__": main() ``` Problems with this script: 1. Error handling for non btrfs subvolumes 2. parsing of subvolume snapshots

I asked ChatGPT to help me write a script to output the herachy on the btrfs partition.

Only subvolumes, no folders or files.

Searching for Btrfs-Mountpoints at: /


Mountpoint: /volume1
/volume1
└── volume1 [subvolume]
    └── @syno [subvolume]
        ├── @docker [subvolume]
        │   └── btrfs [subvolume]
        │       └── subvolumes [subvolume]
        │           ├── 01ed6a5de3fa7ebc3dd1d88af58124d84f17042dd45005d8e19dbc7378c836d5 [subvolume]
        │           ├── 08248e33160da3db036756cf7a65d433fd2c93fc21d2d44ee358108ef2e41365 [subvolume]
        │           ├── 089fb4c9f057ba1e568c9d1409039e66bd9f40abb7ec45af4d73f74ab172504e [subvolume]
        │           ├── 09a047cae26f02927416522262baafc7d2e3e8f559b2ca5b6f99434f28d7ca31 [subvolume]
        │           ├── 0a2eb2f442a09f6b5502626a5ce6beaf08bf5d0b64071dbcfb2a7c360423d82b [subvolume]
        │           ├── 0ac794558f7a37debcdfc98f3c4d476970cf51e88743857368ff430883eb0004 [subvolume]
        │           ├── 0c8934fab0e3cc317a4d6c06c7825101ce64bdfee201bf15f0524113f3e370a2 [subvolume]
        │           ├── 0cc0fqchlbvblf8fhv4alxf6o [subvolume]
        │           ├── 116ffc2a5e66d2badc87c4dcd73d8342a10f1cbd43731964ee1a6c571c82fad6 [subvolume]
        │           ├── 11e74216e4a446fdb9a6bbd38963b139aab2b247f317449fb05fa154b8abf2b8 [subvolume]
        │           ├── 169a6cd4ac7e46c7c3fe5ff745b567902e6ed78f570614c02ba78ed3eea299f7 [subvolume]
        │           ├── 1a522b69132a0b310c0f610c02847d8685ab6b802f7382c5d631c64c3ec76a7c [subvolume]
        │           ├── 1bb473f1050845e5451b8bec053f7f1d168ddb26d885ce47767f92a38c9c8b20 [subvolume]
        │           ├── 1bbae6f2a412a3207eae88159c58398bb1a0667c391001cbeb79a579db25f27a [subvolume]
        │           ├── 1c69c7b8735b6a1935cbe59bf3e1c87870b1328fdf206b9b6b048ff22954a9a8 [subvolume]
        │           ├── 1e3fb266c6551c95732c442892a639635300ff120fb9e8e40a2ae565e7e8fa37 [subvolume]
        │           ├── 1f1a7bf25e5a73802f037b3b4beeec796f771e58862fef37b3d36b7936f153c9 [subvolume]
        │           ├── 1t9cyxj7zsld1yezjiwqueazq [subvolume]
        │           ├── 208283c2f698e605ae90d21da63b4fd2c748e4e529df3db03b769d13e010c521 [subvolume]
        │           ├── 21f9113f209b49cb090f73e2449d066d89ce21bc456e35479b0e9aaf1b48b67b [subvolume]
        │           ├── 230587dc6c369c3a29827a073247f04301f99d3da62a80a5f664ead445f71475 [subvolume]
        │           ├── 283c490744055400ab48633982eb30f754fc562fb31d7de7917627f395c13cd8 [subvolume]
        │           ├── 28cca22fe873c689f131b0f87dfba570bf35a2c608c39f5621d5f84713a1a7fa [subvolume]
        │           ├── 28cca22fe873c689f131b0f87dfba570bf35a2c608c39f5621d5f84713a1a7fa-init [subvolume]
        │           ├── 2c1278d035ae9f328624b72ae24c9e6ae78adf7b5baa9b660ca6c294e44a290d [subvolume]
        │           ├── 2d0a07f7c564d195513b714696a750be9eb697cafdf639cd1aa1f08b05507227 [subvolume]
        │           ├── 2d0e78788290115b5642352d481afd0e2f6a8ca6b0e6aa23827daed886933e0d [subvolume]
        │           ├── 2d236797bfa071a22982d5d46df7c1fc16f4753c52b08322a157e7571f0d4ec7 [subvolume]
        │           ├── 2f06144f993548f92b0dd1cfce2bee35a7cd537f82f7c79df77b8b8d70ed9a01 [subvolume]
        │           ├── 2fc62f71092fe9b882b86019485101653ac14a3da6d9e4a6de277e55ffbc57ed [subvolume]
        │           ├── 30b9ecf2e66976f3e9c5bf7f462f465735fbdd3730cedc01e6467af16887fd8f [subvolume]
        │           ├── 33b34fe468069c4aedb36ba61389a5c447f63f2cc915d2c6371ad8480aabfdf6 [subvolume]
        │           ├── 35b84b1c51f8a86e454b9fa2200005ec44ec7495181d3c6bcf2ea48af75a585a [subvolume]
        │           ├── 386093b0e3e37e27906bba7e9cf880060d3b47a77e1116d0f74f400ddcdcd1a4 [subvolume]
        │           ├── 386093b0e3e37e27906bba7e9cf880060d3b47a77e1116d0f74f400ddcdcd1a4-init [subvolume]
        │           ├── 3a4bcb0ddb54c54e8ce721d816e41a4433f44ceea03bb7544ad927d3b1f3f39c [subvolume]
        │           ├── 3a618ee7ff19a65e63654983fe954c584adaaee4bfbdaf5167cfbadcffe5ed93 [subvolume]
        │           ├── 3a930598d4d6207526f1b59ceb32ba033738358a243972926abe213ea0f9f4d9 [subvolume]
        │           ├── 3ac0a58c70e34ea0f955632f7e42224b0dbf65f25cefe1b4df3ed2cd176c6606 [subvolume]
        │           ├── 3af46b58bfc28ed9a10c9a418584f38e7c59854fd48379dcb7ba28ed55d214e8 [subvolume]
        │           ├── 3b413dddf484f347a0dc8f279da707b279debb7f0153c68bcfa987e5b0fa847a [subvolume]
        │           ├── 3b413dddf484f347a0dc8f279da707b279debb7f0153c68bcfa987e5b0fa847a-init [subvolume]
        │           ├── 3c39c8cef0b3cc931d34c8920f7439f62cb8e90ed45f35216b743128834eb2fd [subvolume]
        │           ├── 3d6ddc4cad0ef57df9e1b2643214346b7e0114460fa73a4d936ed4c0dd9ad93e [subvolume]
        │           ├── 3d6ddc4cad0ef57df9e1b2643214346b7e0114460fa73a4d936ed4c0dd9ad93e-init [subvolume]
        │           ├── 3f3f4a5498d74b06bf761973cf5a10d678da0cd54fa9557214fc8b01509536cb [subvolume]
        │           ├── 3f4939cab2f9b22e242126926eb9ea5e83afd2ad686567e63b85791409b045b8 [subvolume]
        │           ├── 3f6ecc626e5018dfacfa461de4285accf0738ff4f831cf6d1bed7d9126379729 [subvolume]
        │           ├── 3f6ecc626e5018dfacfa461de4285accf0738ff4f831cf6d1bed7d9126379729-init [subvolume]
        │           ├── 411e384d5269d4b85dd0e6595892ed666ba48bdc1ec1bdab3b02c8f1df59885b [subvolume]
        │           ├── 43823fc66b381e050ac80c01d84f8650770bfb4f8ec0efe10fd8e0f45668edc3 [subvolume]
        │           ├── 43d6da5b107dd46f2f308c4d8b6883f5c5ba69e7883ec3df704d9b4d23f378d2 [subvolume]
        │           ├── 43d6da5b107dd46f2f308c4d8b6883f5c5ba69e7883ec3df704d9b4d23f378d2-init [subvolume]
        │           ├── 444b15745d88af88dd58ad32016cacfb7fb25847919b5698a00f2155922c85c3 [subvolume]
        │           ├── 46790aedd7971533374e30fc8f1049ffdeee5f2d400172ff888e449667ea9a22 [subvolume]
        │           ├── 4710cadb8487f7213d443136756a991aaea89d1eee8920245c29fd46b47886af [subvolume]
        │           ├── 492a077915a3dadec5a4e2607efa38fd2c55049477a03b2d54fbb79289f58328 [subvolume]
        │           ├── 49b5ee5da64835ddb4f1ff4f7c6d02a871420add0a797671dfb88138eb6dda25 [subvolume]
        │           ├── 4e08330a77ebd9458fb31294f6b98f07f954d3f9d190cdd04b428c31d3131c32 [subvolume]
        │           ├── 4e59f1539e80b181e197ea4cfa54aef89e870a510eee1c2478270a08e7cb2fbf [subvolume]
        │           ├── 50f4b8700af31361d01c2dfa4796a28bdcb0c69ca59358d9031b878af47fda7f [subvolume]
        │           ├── 529d8fb87c1c508fe5f2476f2a01027b31ad19faa671a7c39e3c53e950b04b67 [subvolume]
        │           ├── 53469a2ab1a71c979c706b99817bd134cdec41df740edf4d0423bde012aa44aa [subvolume]
        │           ├── 53469a2ab1a71c979c706b99817bd134cdec41df740edf4d0423bde012aa44aa-init [subvolume]
        │           ├── 541f902b33bbfb3fc4c5f0a88dd425648dd96d2e20eb12681b57741b4c74d080 [subvolume]
        │           ├── 54c6aa8edb403f487f60ba1e5dfaa35f32ca3db945015a87512a3661d83274b5 [subvolume]
        │           ├── 55098a9cfd9aba0ac9ce093d67018ce241e13fe33741b0b9d252907163b10f7b [subvolume]
        │           ├── 55af514f0c31662f94070525caf4c061561da9c40b92edb6b2a6089604be878e [subvolume]
        │           ├── 56e3b8dec17e4b5cb4bd5b5e66066fcff95161d0ed2d7d0af4585fb581b13bb4 [subvolume]
        │           ├── 57e4f8a41deafda76b5f13d197e6d46cfc6b3b4a14151f6e58f935d9e47c9422 [subvolume]
        │           ├── 57e4f8a41deafda76b5f13d197e6d46cfc6b3b4a14151f6e58f935d9e47c9422-init [subvolume]
        │           ├── 585cecc90545e3f70940d09d4ef23dfaae8d9963732e7048eebd2cf33b741c7e [subvolume]
        │           ├── 59c88001f628129b9d8037e693af2462db7d524eba8a11a96635d6066ce3843f [subvolume]
        │           ├── 59f393df990ec26c251d1273816761b5cdad83be779df3d2ce9fd9e2724f92d5 [subvolume]
        │           ├── 5a051215a2e46493511130f16c0d692bcf804ba96cce72d08d3f4d6794087fe2 [subvolume]
        │           ├── 5a819a3de400b275abee53d7d07734c1b10d3b0bae2731921b29d831dd3afc05 [subvolume]
        │           ├── 5ecc6f84729361ffe5cc09f943f72d3a03f9388d27de1a3b18097139f4bfa971 [subvolume]
        │           ├── 6297631778ca5f002393afbd5a82ce97d8d59261ae37f4cd05b4e75d993b6c52 [subvolume]
        │           ├── 6324bac7af03d1d403eb6a873bab388b2e87c9332e7b8b05cfa275fb093ed615 [subvolume]
        │           ├── 64a0a872961f121b6b19094c5342132699611ce92f09761d9099e21737e15c2c [subvolume]
        │           ├── 64a8d43eca8f53b65c24616dc7cb95fcfdba380083ff001caca77107f193591c [subvolume]
        │           ├── 66f09accafe95c8550d47d041fb618c966bd2c78bc823f745d1bb23437868266 [subvolume]
        │           ├── 683b51dd0cbebb08e0d6229b6b4d25628b9e20fdf876c0e07cc3ceb5f61fc8ec [subvolume]
        │           ├── 687013f4be00e9c9faa29b5f62d648b3129fd6df80e85ec426673ba820f93857 [subvolume]
        │           ├── 6acea9d328779085dc9a49c165c9244c42a71fd3b5060c63afe0f2cc57d4b351 [subvolume]
        │           ├── 6b0b7c100e2d0b90b95903088ada3b5c6a4e5e9efa691d596611ba59f09550c8 [subvolume]
        │           ├── 6d75f23a0ee1b5564e43a2e497d9ed0b1b20c9383ccc1bdc0d5f7bea3da49196 [subvolume]
        │           ├── 6f2431b864fdaa0e3d00f81d7430e05e1431665c5f66a70790a0593d1a7f79ba [subvolume]
        │           ├── 6f2431b864fdaa0e3d00f81d7430e05e1431665c5f66a70790a0593d1a7f79ba-init [subvolume]
        │           ├── 6f7f8754b8e45eb2766fe6ed62f7a5cff7b456a2031ea71d6adcd9a894523a8e [subvolume]
        │           ├── 7014c14c62afb1f20e6cebc701f729ade017121e51d0dfbece810794cb5971db [subvolume]
        │           ├── 70e45d81e45f1b07016285acde2c097770d900738985b86bb4145ff77ed27099 [subvolume]
        │           ├── 72039ec90925deda551007ce998c69e824e2ca62a70023538d1dc9bdf2a091c2 [subvolume]
        │           ├── 727915f85d15106d14b1191cdfe24fbb0639c395a8ce705a179423e33ec49051 [subvolume]
        │           ├── 751eeba363001c22019175bbbfbe22d1ecc5becc00f912970f19a2e87dda0fe5 [subvolume]
        │           ├── 773e3f643e5199a6b0cb87633b43bcf77a2b6cb19a181dfae38d373ace6b44a1 [subvolume]
        │           ├── 7896d6e671403b1a9b05daa2e48512d48e283d346e5ff3bf91cb74ed62cee922 [subvolume]
        │           ├── 7ac3d2b711073ae4186d53b93517ce897b638bf88a7be1e1685c9789aa0e20ca [subvolume]
        │           ├── 7b6cee91e19eb26a315c9b9c0ebe30574b59c503f6a467bf05df913097d73592 [subvolume]
        │           ├── 7ce4c1801e1bd45aec21498284429eafd774cee18d590a83bc0066d0b88b8de6 [subvolume]
        │           ├── 7ce4c1801e1bd45aec21498284429eafd774cee18d590a83bc0066d0b88b8de6-init [subvolume]
        │           ├── 7e0a3f3e9c3be0301409f742f1812f38d0254ca7204dd1fb3430dd48652e551e [subvolume]
        │           ├── 8306769524e18152ef8f27074d24293b59f1963b116187de8bca91916e26b890 [subvolume]
        │           ├── 83c9f6055cefe61ede88bf3c44666a98014a9a4c43c8c8f551005537bdb62300 [subvolume]
        │           ├── 8497000cf4812a198cef9693104a53b5a11d9b0705deea6e7f093b015b7bf1e1 [subvolume]
        │           ├── 84e905defe4787fd870f6b13b49ffa9bb457b0667a2d984c44ed8521602fff8a [subvolume]
        │           ├── 85be5b2a7f6b43cd46f3386c0ba5dffbf3ffc34357ba275d8a888e37513e6521 [subvolume]
        │           ├── 85be5b2a7f6b43cd46f3386c0ba5dffbf3ffc34357ba275d8a888e37513e6521-init [subvolume]
        │           ├── 86284ab7b12331cc115b9072db5e113381151d398dc8381df4a05afa5b94f407 [subvolume]
        │           ├── 8cf32751b64ca0f0d2523810c8b6cc78392147c587944070941c344e264ebac9 [subvolume]
        │           ├── 8d5d53171077de1107a83293d0001ca9b3a08f099af7863502be9ae5e60e958c [subvolume]
        │           ├── 8f6d7b3858643ebd30a9089e53bf1c1a434838341af2df116f4597b172374db6 [subvolume]
        │           ├── 8f6d7b3858643ebd30a9089e53bf1c1a434838341af2df116f4597b172374db6-init [subvolume]
        │           ├── 8fa663d16cb3f1862cd377d496f1b120e4c9899c7a2c5b896aac7e1045457336 [subvolume]
        │           ├── 92cbbe1c09630e69b13c2ddf3fdd9477d3cf483cd1d31798f439ab2f38c6328f [subvolume]
        │           ├── 9360a106a1498fe5cb8cca96ff2c42eb1bb79c60515d88fe2b836a3d14b7946e [subvolume]
        │           ├── 93719ed5760948159576f8310d544cb4ac4daa8d9dd20ea83144bbac32d4397e [subvolume]
        │           ├── 93b1542b909c77da7aa18bf87d10f78be04fb671ad6e54b7c62b5208b1161691 [subvolume]
        │           ├── 941f31481801a932552fdcf4fb6eced68a516af8d7a9fa11fe07de0c381a1888 [subvolume]
        │           ├── 94305ea796ce1994cea86bdecca0d7b1bf6276bb13f6a706d2f32d3bb9a4e0de [subvolume]
        │           ├── 94305ea796ce1994cea86bdecca0d7b1bf6276bb13f6a706d2f32d3bb9a4e0de-init [subvolume]
        │           ├── 97555ee79e921ffd6e3bc262c49dfdbfb7e0395131cef6d126850709fc6be148 [subvolume]
        │           ├── 98141ecba94de807613587ac4e46bb99b9b335d5806380caa8d671b74da086e8 [subvolume]
        │           ├── 9c1c9a1eec3f1641fe8bdeaf09e3b0dc41d5cc749a51ed9e62cc15b27e520b01 [subvolume]
        │           ├── 9d3a320f463a01fb20faa8ec783f0e82988336d3cfb7c57cc8013e07117ef305 [subvolume]
        │           ├── 9d869bec242da95f79d4d1af772555a5149ce2b609728ac755f3d246d0d112be [subvolume]
        │           ├── 9da283d0c65fb875e78a3b713455e61f54a713f0363ea2b6e20c75113ea7df4c [subvolume]
        │           ├── 9f1e3416badb7888cfafe9fdc3b420cf41a7c7da7816f5a074802abf66ada5c2 [subvolume]
        │           ├── 9f7cc6b76bb8b69dd8bd7cb0b4bd6e44e6387d6acf1ae8f17c557b487c818217 [subvolume]
        │           ├── 9f7f66680fa76570519122a7648f045587017f9631f8040b57bb2908b1ad04c3 [subvolume]
        │           ├── a1808b8920755631faefa20891128bf30af1fc4f6adcf3356860d87e305a1b2e [subvolume]
        │           ├── a2eae06694ca15f0fc3afe866f33b1b7748dbb3c285738b325778af6ba4cac1e [subvolume]
        │           ├── a3e715c52fe6e885ac4878b6fc75bd401efa022f09cb776b0a9629232e4fa645 [subvolume]
        │           ├── a60830e9bb68afe02663d6570f1558b5abfe3871576a6ea1d7a006a56fbda596 [subvolume]
        │           ├── a6750642ebf2365bb29d8da7905a3ea436c04e2d3fcae21493eda1b68c957bc3 [subvolume]
        │           ├── a6750642ebf2365bb29d8da7905a3ea436c04e2d3fcae21493eda1b68c957bc3-init [subvolume]
        │           ├── a8ecae99d724033904ff6ebe54d675cdd7d00ea075adb5e3a582f99075a343fd [subvolume]
        │           ├── a9a55daecaff114b424ca3abdebab0dac94c37c33cef7e5ba105e234e6daa937 [subvolume]
        │           ├── abca69b96177e689fd1721d23e485de3ba11e3d38df262e89313b2e8aedafff6 [subvolume]
        │           ├── ac11601f36e0ed57654c5e954de9a680ac2a12720f90b1ceacf61f9f01b4683b [subvolume]
        │           ├── ac68d35770a3169202195e83da3a5bc48b371a8721f6496fb7bad3616caca8e1 [subvolume]
        │           ├── ac82ce486754564b8ceb9c6f49be6dc09830741095923b83c0dc21f763d5ea06 [subvolume]
        │           ├── ad39cfe865d9cd79c0bbcac5c533fe94c73bfeb1319e89c63f998feca90e7507 [subvolume]
        │           ├── ad6efb06c0340367da4c6f9a5c0208e21126cbb1b5228306c7d32fd367e31cfb [subvolume]
        │           ├── ae4b1477a30ae9aec93db3d809d42ca4ebcc67f69be1a3a7d1ac22c4c913c979 [subvolume]
        │           ├── ae4b1477a30ae9aec93db3d809d42ca4ebcc67f69be1a3a7d1ac22c4c913c979-init [subvolume]
        │           ├── ae70f16ad4f512042e74632c44487e55c40da9c14eab35f891e03d6744b603d7 [subvolume]
        │           ├── af1588068252c9fa4b652f70bf7c2be36e74970dd2d25f833351207ef8df4f8a [subvolume]
        │           ├── af831b2019d573b588fc4b23d0f9621ba49344a0e49e07e1931941d74a02f41c [subvolume]
        │           ├── b213744d000af4f808aeef0b6b581e1fece3f55fcbb10923aefb0cda1bf032cb [subvolume]
        │           ├── b21514e253ed84146219804e1fb479069cf94ce4951c3cc006dfdeac50e7e3b6 [subvolume]
        │           ├── b21514e253ed84146219804e1fb479069cf94ce4951c3cc006dfdeac50e7e3b6-init [subvolume]
        │           ├── b278ac2ced8e5be5a5637cfccb6b060a563797fc7f0b1f7fd09bbd9bd52178c5 [subvolume]
        │           ├── b323b8ba55c574ad290eeb085274d3a06153261895640da2299ba59b574e1987 [subvolume]
        │           ├── b6811d266477bf6838f7651352422d1c4fcdfd587f283c1b1945331c87052497 [subvolume]
        │           ├── bbb6e3d4538b18a2c09438ddb635b93b48768f2de34b91476013d67fb70bda13 [subvolume]
        │           ├── bbea3577b2f32ca75f269d7b7819804c501dae85758910174e014dc0911782e3 [subvolume]
        │           ├── be3e5baeac649613d931d57fb3c276a94f483d1857fe2d613491ab046e455b4f [subvolume]
        │           ├── c137d0e822712cc3470d503250f58a07f862eb068efd3ec178b4ab64f9a8ebbe [subvolume]
        │           ├── c303af21ef3d4ab575ca2fc5e22ebd2990266045fed63d7d177425e509d3eac3 [subvolume]
        │           ├── c42ad2269db897ab6cad63341a50198441dbe95f68e9afd35ce95108bdf6b01b [subvolume]
        │           ├── c96313cb4bf38a89766326c4d2862317435ec89f8ea7742df462405e622b8cc2 [subvolume]
        │           ├── c968b25cb26874b208fd87ac65b0f4353513856a52422f26a05ba0d80a35927e [subvolume]
        │           ├── cb4d9ff547b00bba399a66ec0ca6535a36340ac79a0d593dd1883f3827971125 [subvolume]
        │           ├── cedc94f61194dbfb4777469a3c471897bd0c37574e86f10052574ad67a770cdb [subvolume]
        │           ├── cf6d34821472b37ab938f2aed34180a3e307d03498a7f9556e4b28064c5ff5fe [subvolume]
        │           ├── d1a2ba01b0d8fa1aaa41b833990dc6e07029e6e05f2799ddf9e99ba77f996a38 [subvolume]
        │           ├── d1b195a4cf5eb30806b025e084cbaf60db0d41318374ce37c10bdd558acf4455 [subvolume]
        │           ├── d39f173759b5cb00ad4b94dc5bbfb46f668c14d8a8a57d2781bff797e236c40c [subvolume]
        │           ├── d408ab2674b65e585ed38c0aff9a3b7e4bc5b99323fa0a3785d1fbc9b18f28f3 [subvolume]
        │           ├── d682b839090896b6191cea0cafeb5d120a53349628ed3608a59bec2a1e7cf03a [subvolume]
        │           ├── d7aba4d418676d4b5fc30b7277263ff1b2ddae78cc42cb0506ca9a8a7ef8b0d2 [subvolume]
        │           ├── d8155b0c9b3288d95cf0b34737e7c6e59dd18746a7f5c23a7d2471a0f84d995d [subvolume]
        │           ├── e061c9fc235eadcc9bbfad1d331b2319a233bc11ccb8fca877c0b4f3f6194093 [subvolume]
        │           ├── e394b6b29d20d33987d31e72b8cd8d61e1830b4d19c88068043c543c76b50091 [subvolume]
        │           ├── e90ea7e0ccb1704fcc0bfa84a6c5d69cd8dfa7e71f0978acdd77e246866d86c4 [subvolume]
        │           ├── e9de67111f915329077f37d35d27cf8ab0fd06da52f78150c117c43f788fd436 [subvolume]
        │           ├── eb1f6d8354222fe2785457129536a274672ee0b701eda6e11b37a832a60db4fe [subvolume]
        │           ├── ec905a247c90606cb1c1c6f8de70a2dcdbb878807029c4a0e7282cd508df0a88 [subvolume]
        │           ├── ecc6ea1489a6824862368cc696de62e1de59e91f95bb32a8be9062dd6ebb91e0 [subvolume]
        │           ├── ed5ca91a59e7af54d53e26aa9d36fe808977bf9108062c2c0ad6459f71bda28a [subvolume]
        │           ├── f1cd905a529b29c781046b938e7d0c4d304b5a8b72ae3e421b4e6b0741e16225 [subvolume]
        │           ├── f44985236424c3fe7ee3c1f03b96cdf900237525834cf08e2ae20a006befa894 [subvolume]
        │           ├── f5ab6f9527d9a4005ac0d5fff67d5ffe3c76c63d838f874b0f6f5e48cbe449c5 [subvolume]
        │           ├── f5e521d8836784952f5284bedf2eb21609aabe4a635b69a5ec3173b8ae985c79 [subvolume]
        │           ├── f98a7a592f8037112beacf83ea57018eeaa02b373846ee3e5cb7d92614bf887d [subvolume]
        │           ├── fa72ab0d40ee0f6f0c7983f29e6f18912e15f0adfa186601310dc51cb074c71e [subvolume]
        │           ├── fe47f2523538d4d0dbcffd9bcc9988b56307408ba7aa43efd4f98c6c6e32c053 [subvolume]
        │           ├── ffbb7e81c40a12f14272aa7f513afcb8b6d9d9434a79d61eb9708e550cfc14ec [subvolume]
        │           ├── ffc63fd2cb384d5947be41ad3ebc833fbe640972d7dab1d8d2e8c8f0f2f26ae8 [subvolume]
        │           ├── gausatk48ykmtsctelpjlgl5q [subvolume]
        │           ├── ha2ezibnz7kp9e8qbffo4uev8 [subvolume]
        │           ├── hz756ye21dlyixrusywzbkmld [subvolume]
        │           ├── ifovzax05f2qeoq38viuuzt2j [subvolume]
        │           ├── k1dja4oii0t0iez8eh83shdum [subvolume]
        │           ├── kpgbkv2vupiwlmf39mhrqwb97 [subvolume]
        │           ├── r5iobjjar16wpvxkahxiuycis [subvolume]
        │           ├── t9z5xwwjyo9vowykavqtwwdu9 [subvolume]
        │           ├── txguncb9q75hcfdyidpp3s13f [subvolume]
        │           ├── wvx9s06pqe1thcklwqyzbmyfw [subvolume]
        │           └── y5260lpkjd414b1y290xdfx10 [subvolume]
        ├── @sharesnap [subvolume]
        ├── Backups [subvolume]
        ├── Bilder [subvolume]
        ├── Daten [subvolume]
        ├── Daten.snapshot [subvolume]
        ├── Downloads [subvolume]
        ├── Filme [subvolume]
        ├── NetBackup [subvolume]
        ├── NewMusik [subvolume]
        ├── Profiles [subvolume]
        ├── Programme [subvolume]
        ├── Remote [subvolume]
        ├── Scanner [subvolume]
        ├── Serien [subvolume]
        ├── borg [subvolume]
        ├── docker [subvolume]
        ├── eBooks [subvolume]
        ├── local [subvolume]
        ├── music [subvolume]
        ├── synology [subvolume]
        ├── video [subvolume]
        ├── web [subvolume]
        └── web_packages [subvolume]
I asked ChatGPT to help me write a script to output the herachy on the btrfs partition. Only subvolumes, no folders or files. ``` Searching for Btrfs-Mountpoints at: / Mountpoint: /volume1 /volume1 └── volume1 [subvolume] └── @syno [subvolume] ├── @docker [subvolume] │ └── btrfs [subvolume] │ └── subvolumes [subvolume] │ ├── 01ed6a5de3fa7ebc3dd1d88af58124d84f17042dd45005d8e19dbc7378c836d5 [subvolume] │ ├── 08248e33160da3db036756cf7a65d433fd2c93fc21d2d44ee358108ef2e41365 [subvolume] │ ├── 089fb4c9f057ba1e568c9d1409039e66bd9f40abb7ec45af4d73f74ab172504e [subvolume] │ ├── 09a047cae26f02927416522262baafc7d2e3e8f559b2ca5b6f99434f28d7ca31 [subvolume] │ ├── 0a2eb2f442a09f6b5502626a5ce6beaf08bf5d0b64071dbcfb2a7c360423d82b [subvolume] │ ├── 0ac794558f7a37debcdfc98f3c4d476970cf51e88743857368ff430883eb0004 [subvolume] │ ├── 0c8934fab0e3cc317a4d6c06c7825101ce64bdfee201bf15f0524113f3e370a2 [subvolume] │ ├── 0cc0fqchlbvblf8fhv4alxf6o [subvolume] │ ├── 116ffc2a5e66d2badc87c4dcd73d8342a10f1cbd43731964ee1a6c571c82fad6 [subvolume] │ ├── 11e74216e4a446fdb9a6bbd38963b139aab2b247f317449fb05fa154b8abf2b8 [subvolume] │ ├── 169a6cd4ac7e46c7c3fe5ff745b567902e6ed78f570614c02ba78ed3eea299f7 [subvolume] │ ├── 1a522b69132a0b310c0f610c02847d8685ab6b802f7382c5d631c64c3ec76a7c [subvolume] │ ├── 1bb473f1050845e5451b8bec053f7f1d168ddb26d885ce47767f92a38c9c8b20 [subvolume] │ ├── 1bbae6f2a412a3207eae88159c58398bb1a0667c391001cbeb79a579db25f27a [subvolume] │ ├── 1c69c7b8735b6a1935cbe59bf3e1c87870b1328fdf206b9b6b048ff22954a9a8 [subvolume] │ ├── 1e3fb266c6551c95732c442892a639635300ff120fb9e8e40a2ae565e7e8fa37 [subvolume] │ ├── 1f1a7bf25e5a73802f037b3b4beeec796f771e58862fef37b3d36b7936f153c9 [subvolume] │ ├── 1t9cyxj7zsld1yezjiwqueazq [subvolume] │ ├── 208283c2f698e605ae90d21da63b4fd2c748e4e529df3db03b769d13e010c521 [subvolume] │ ├── 21f9113f209b49cb090f73e2449d066d89ce21bc456e35479b0e9aaf1b48b67b [subvolume] │ ├── 230587dc6c369c3a29827a073247f04301f99d3da62a80a5f664ead445f71475 [subvolume] │ ├── 283c490744055400ab48633982eb30f754fc562fb31d7de7917627f395c13cd8 [subvolume] │ ├── 28cca22fe873c689f131b0f87dfba570bf35a2c608c39f5621d5f84713a1a7fa [subvolume] │ ├── 28cca22fe873c689f131b0f87dfba570bf35a2c608c39f5621d5f84713a1a7fa-init [subvolume] │ ├── 2c1278d035ae9f328624b72ae24c9e6ae78adf7b5baa9b660ca6c294e44a290d [subvolume] │ ├── 2d0a07f7c564d195513b714696a750be9eb697cafdf639cd1aa1f08b05507227 [subvolume] │ ├── 2d0e78788290115b5642352d481afd0e2f6a8ca6b0e6aa23827daed886933e0d [subvolume] │ ├── 2d236797bfa071a22982d5d46df7c1fc16f4753c52b08322a157e7571f0d4ec7 [subvolume] │ ├── 2f06144f993548f92b0dd1cfce2bee35a7cd537f82f7c79df77b8b8d70ed9a01 [subvolume] │ ├── 2fc62f71092fe9b882b86019485101653ac14a3da6d9e4a6de277e55ffbc57ed [subvolume] │ ├── 30b9ecf2e66976f3e9c5bf7f462f465735fbdd3730cedc01e6467af16887fd8f [subvolume] │ ├── 33b34fe468069c4aedb36ba61389a5c447f63f2cc915d2c6371ad8480aabfdf6 [subvolume] │ ├── 35b84b1c51f8a86e454b9fa2200005ec44ec7495181d3c6bcf2ea48af75a585a [subvolume] │ ├── 386093b0e3e37e27906bba7e9cf880060d3b47a77e1116d0f74f400ddcdcd1a4 [subvolume] │ ├── 386093b0e3e37e27906bba7e9cf880060d3b47a77e1116d0f74f400ddcdcd1a4-init [subvolume] │ ├── 3a4bcb0ddb54c54e8ce721d816e41a4433f44ceea03bb7544ad927d3b1f3f39c [subvolume] │ ├── 3a618ee7ff19a65e63654983fe954c584adaaee4bfbdaf5167cfbadcffe5ed93 [subvolume] │ ├── 3a930598d4d6207526f1b59ceb32ba033738358a243972926abe213ea0f9f4d9 [subvolume] │ ├── 3ac0a58c70e34ea0f955632f7e42224b0dbf65f25cefe1b4df3ed2cd176c6606 [subvolume] │ ├── 3af46b58bfc28ed9a10c9a418584f38e7c59854fd48379dcb7ba28ed55d214e8 [subvolume] │ ├── 3b413dddf484f347a0dc8f279da707b279debb7f0153c68bcfa987e5b0fa847a [subvolume] │ ├── 3b413dddf484f347a0dc8f279da707b279debb7f0153c68bcfa987e5b0fa847a-init [subvolume] │ ├── 3c39c8cef0b3cc931d34c8920f7439f62cb8e90ed45f35216b743128834eb2fd [subvolume] │ ├── 3d6ddc4cad0ef57df9e1b2643214346b7e0114460fa73a4d936ed4c0dd9ad93e [subvolume] │ ├── 3d6ddc4cad0ef57df9e1b2643214346b7e0114460fa73a4d936ed4c0dd9ad93e-init [subvolume] │ ├── 3f3f4a5498d74b06bf761973cf5a10d678da0cd54fa9557214fc8b01509536cb [subvolume] │ ├── 3f4939cab2f9b22e242126926eb9ea5e83afd2ad686567e63b85791409b045b8 [subvolume] │ ├── 3f6ecc626e5018dfacfa461de4285accf0738ff4f831cf6d1bed7d9126379729 [subvolume] │ ├── 3f6ecc626e5018dfacfa461de4285accf0738ff4f831cf6d1bed7d9126379729-init [subvolume] │ ├── 411e384d5269d4b85dd0e6595892ed666ba48bdc1ec1bdab3b02c8f1df59885b [subvolume] │ ├── 43823fc66b381e050ac80c01d84f8650770bfb4f8ec0efe10fd8e0f45668edc3 [subvolume] │ ├── 43d6da5b107dd46f2f308c4d8b6883f5c5ba69e7883ec3df704d9b4d23f378d2 [subvolume] │ ├── 43d6da5b107dd46f2f308c4d8b6883f5c5ba69e7883ec3df704d9b4d23f378d2-init [subvolume] │ ├── 444b15745d88af88dd58ad32016cacfb7fb25847919b5698a00f2155922c85c3 [subvolume] │ ├── 46790aedd7971533374e30fc8f1049ffdeee5f2d400172ff888e449667ea9a22 [subvolume] │ ├── 4710cadb8487f7213d443136756a991aaea89d1eee8920245c29fd46b47886af [subvolume] │ ├── 492a077915a3dadec5a4e2607efa38fd2c55049477a03b2d54fbb79289f58328 [subvolume] │ ├── 49b5ee5da64835ddb4f1ff4f7c6d02a871420add0a797671dfb88138eb6dda25 [subvolume] │ ├── 4e08330a77ebd9458fb31294f6b98f07f954d3f9d190cdd04b428c31d3131c32 [subvolume] │ ├── 4e59f1539e80b181e197ea4cfa54aef89e870a510eee1c2478270a08e7cb2fbf [subvolume] │ ├── 50f4b8700af31361d01c2dfa4796a28bdcb0c69ca59358d9031b878af47fda7f [subvolume] │ ├── 529d8fb87c1c508fe5f2476f2a01027b31ad19faa671a7c39e3c53e950b04b67 [subvolume] │ ├── 53469a2ab1a71c979c706b99817bd134cdec41df740edf4d0423bde012aa44aa [subvolume] │ ├── 53469a2ab1a71c979c706b99817bd134cdec41df740edf4d0423bde012aa44aa-init [subvolume] │ ├── 541f902b33bbfb3fc4c5f0a88dd425648dd96d2e20eb12681b57741b4c74d080 [subvolume] │ ├── 54c6aa8edb403f487f60ba1e5dfaa35f32ca3db945015a87512a3661d83274b5 [subvolume] │ ├── 55098a9cfd9aba0ac9ce093d67018ce241e13fe33741b0b9d252907163b10f7b [subvolume] │ ├── 55af514f0c31662f94070525caf4c061561da9c40b92edb6b2a6089604be878e [subvolume] │ ├── 56e3b8dec17e4b5cb4bd5b5e66066fcff95161d0ed2d7d0af4585fb581b13bb4 [subvolume] │ ├── 57e4f8a41deafda76b5f13d197e6d46cfc6b3b4a14151f6e58f935d9e47c9422 [subvolume] │ ├── 57e4f8a41deafda76b5f13d197e6d46cfc6b3b4a14151f6e58f935d9e47c9422-init [subvolume] │ ├── 585cecc90545e3f70940d09d4ef23dfaae8d9963732e7048eebd2cf33b741c7e [subvolume] │ ├── 59c88001f628129b9d8037e693af2462db7d524eba8a11a96635d6066ce3843f [subvolume] │ ├── 59f393df990ec26c251d1273816761b5cdad83be779df3d2ce9fd9e2724f92d5 [subvolume] │ ├── 5a051215a2e46493511130f16c0d692bcf804ba96cce72d08d3f4d6794087fe2 [subvolume] │ ├── 5a819a3de400b275abee53d7d07734c1b10d3b0bae2731921b29d831dd3afc05 [subvolume] │ ├── 5ecc6f84729361ffe5cc09f943f72d3a03f9388d27de1a3b18097139f4bfa971 [subvolume] │ ├── 6297631778ca5f002393afbd5a82ce97d8d59261ae37f4cd05b4e75d993b6c52 [subvolume] │ ├── 6324bac7af03d1d403eb6a873bab388b2e87c9332e7b8b05cfa275fb093ed615 [subvolume] │ ├── 64a0a872961f121b6b19094c5342132699611ce92f09761d9099e21737e15c2c [subvolume] │ ├── 64a8d43eca8f53b65c24616dc7cb95fcfdba380083ff001caca77107f193591c [subvolume] │ ├── 66f09accafe95c8550d47d041fb618c966bd2c78bc823f745d1bb23437868266 [subvolume] │ ├── 683b51dd0cbebb08e0d6229b6b4d25628b9e20fdf876c0e07cc3ceb5f61fc8ec [subvolume] │ ├── 687013f4be00e9c9faa29b5f62d648b3129fd6df80e85ec426673ba820f93857 [subvolume] │ ├── 6acea9d328779085dc9a49c165c9244c42a71fd3b5060c63afe0f2cc57d4b351 [subvolume] │ ├── 6b0b7c100e2d0b90b95903088ada3b5c6a4e5e9efa691d596611ba59f09550c8 [subvolume] │ ├── 6d75f23a0ee1b5564e43a2e497d9ed0b1b20c9383ccc1bdc0d5f7bea3da49196 [subvolume] │ ├── 6f2431b864fdaa0e3d00f81d7430e05e1431665c5f66a70790a0593d1a7f79ba [subvolume] │ ├── 6f2431b864fdaa0e3d00f81d7430e05e1431665c5f66a70790a0593d1a7f79ba-init [subvolume] │ ├── 6f7f8754b8e45eb2766fe6ed62f7a5cff7b456a2031ea71d6adcd9a894523a8e [subvolume] │ ├── 7014c14c62afb1f20e6cebc701f729ade017121e51d0dfbece810794cb5971db [subvolume] │ ├── 70e45d81e45f1b07016285acde2c097770d900738985b86bb4145ff77ed27099 [subvolume] │ ├── 72039ec90925deda551007ce998c69e824e2ca62a70023538d1dc9bdf2a091c2 [subvolume] │ ├── 727915f85d15106d14b1191cdfe24fbb0639c395a8ce705a179423e33ec49051 [subvolume] │ ├── 751eeba363001c22019175bbbfbe22d1ecc5becc00f912970f19a2e87dda0fe5 [subvolume] │ ├── 773e3f643e5199a6b0cb87633b43bcf77a2b6cb19a181dfae38d373ace6b44a1 [subvolume] │ ├── 7896d6e671403b1a9b05daa2e48512d48e283d346e5ff3bf91cb74ed62cee922 [subvolume] │ ├── 7ac3d2b711073ae4186d53b93517ce897b638bf88a7be1e1685c9789aa0e20ca [subvolume] │ ├── 7b6cee91e19eb26a315c9b9c0ebe30574b59c503f6a467bf05df913097d73592 [subvolume] │ ├── 7ce4c1801e1bd45aec21498284429eafd774cee18d590a83bc0066d0b88b8de6 [subvolume] │ ├── 7ce4c1801e1bd45aec21498284429eafd774cee18d590a83bc0066d0b88b8de6-init [subvolume] │ ├── 7e0a3f3e9c3be0301409f742f1812f38d0254ca7204dd1fb3430dd48652e551e [subvolume] │ ├── 8306769524e18152ef8f27074d24293b59f1963b116187de8bca91916e26b890 [subvolume] │ ├── 83c9f6055cefe61ede88bf3c44666a98014a9a4c43c8c8f551005537bdb62300 [subvolume] │ ├── 8497000cf4812a198cef9693104a53b5a11d9b0705deea6e7f093b015b7bf1e1 [subvolume] │ ├── 84e905defe4787fd870f6b13b49ffa9bb457b0667a2d984c44ed8521602fff8a [subvolume] │ ├── 85be5b2a7f6b43cd46f3386c0ba5dffbf3ffc34357ba275d8a888e37513e6521 [subvolume] │ ├── 85be5b2a7f6b43cd46f3386c0ba5dffbf3ffc34357ba275d8a888e37513e6521-init [subvolume] │ ├── 86284ab7b12331cc115b9072db5e113381151d398dc8381df4a05afa5b94f407 [subvolume] │ ├── 8cf32751b64ca0f0d2523810c8b6cc78392147c587944070941c344e264ebac9 [subvolume] │ ├── 8d5d53171077de1107a83293d0001ca9b3a08f099af7863502be9ae5e60e958c [subvolume] │ ├── 8f6d7b3858643ebd30a9089e53bf1c1a434838341af2df116f4597b172374db6 [subvolume] │ ├── 8f6d7b3858643ebd30a9089e53bf1c1a434838341af2df116f4597b172374db6-init [subvolume] │ ├── 8fa663d16cb3f1862cd377d496f1b120e4c9899c7a2c5b896aac7e1045457336 [subvolume] │ ├── 92cbbe1c09630e69b13c2ddf3fdd9477d3cf483cd1d31798f439ab2f38c6328f [subvolume] │ ├── 9360a106a1498fe5cb8cca96ff2c42eb1bb79c60515d88fe2b836a3d14b7946e [subvolume] │ ├── 93719ed5760948159576f8310d544cb4ac4daa8d9dd20ea83144bbac32d4397e [subvolume] │ ├── 93b1542b909c77da7aa18bf87d10f78be04fb671ad6e54b7c62b5208b1161691 [subvolume] │ ├── 941f31481801a932552fdcf4fb6eced68a516af8d7a9fa11fe07de0c381a1888 [subvolume] │ ├── 94305ea796ce1994cea86bdecca0d7b1bf6276bb13f6a706d2f32d3bb9a4e0de [subvolume] │ ├── 94305ea796ce1994cea86bdecca0d7b1bf6276bb13f6a706d2f32d3bb9a4e0de-init [subvolume] │ ├── 97555ee79e921ffd6e3bc262c49dfdbfb7e0395131cef6d126850709fc6be148 [subvolume] │ ├── 98141ecba94de807613587ac4e46bb99b9b335d5806380caa8d671b74da086e8 [subvolume] │ ├── 9c1c9a1eec3f1641fe8bdeaf09e3b0dc41d5cc749a51ed9e62cc15b27e520b01 [subvolume] │ ├── 9d3a320f463a01fb20faa8ec783f0e82988336d3cfb7c57cc8013e07117ef305 [subvolume] │ ├── 9d869bec242da95f79d4d1af772555a5149ce2b609728ac755f3d246d0d112be [subvolume] │ ├── 9da283d0c65fb875e78a3b713455e61f54a713f0363ea2b6e20c75113ea7df4c [subvolume] │ ├── 9f1e3416badb7888cfafe9fdc3b420cf41a7c7da7816f5a074802abf66ada5c2 [subvolume] │ ├── 9f7cc6b76bb8b69dd8bd7cb0b4bd6e44e6387d6acf1ae8f17c557b487c818217 [subvolume] │ ├── 9f7f66680fa76570519122a7648f045587017f9631f8040b57bb2908b1ad04c3 [subvolume] │ ├── a1808b8920755631faefa20891128bf30af1fc4f6adcf3356860d87e305a1b2e [subvolume] │ ├── a2eae06694ca15f0fc3afe866f33b1b7748dbb3c285738b325778af6ba4cac1e [subvolume] │ ├── a3e715c52fe6e885ac4878b6fc75bd401efa022f09cb776b0a9629232e4fa645 [subvolume] │ ├── a60830e9bb68afe02663d6570f1558b5abfe3871576a6ea1d7a006a56fbda596 [subvolume] │ ├── a6750642ebf2365bb29d8da7905a3ea436c04e2d3fcae21493eda1b68c957bc3 [subvolume] │ ├── a6750642ebf2365bb29d8da7905a3ea436c04e2d3fcae21493eda1b68c957bc3-init [subvolume] │ ├── a8ecae99d724033904ff6ebe54d675cdd7d00ea075adb5e3a582f99075a343fd [subvolume] │ ├── a9a55daecaff114b424ca3abdebab0dac94c37c33cef7e5ba105e234e6daa937 [subvolume] │ ├── abca69b96177e689fd1721d23e485de3ba11e3d38df262e89313b2e8aedafff6 [subvolume] │ ├── ac11601f36e0ed57654c5e954de9a680ac2a12720f90b1ceacf61f9f01b4683b [subvolume] │ ├── ac68d35770a3169202195e83da3a5bc48b371a8721f6496fb7bad3616caca8e1 [subvolume] │ ├── ac82ce486754564b8ceb9c6f49be6dc09830741095923b83c0dc21f763d5ea06 [subvolume] │ ├── ad39cfe865d9cd79c0bbcac5c533fe94c73bfeb1319e89c63f998feca90e7507 [subvolume] │ ├── ad6efb06c0340367da4c6f9a5c0208e21126cbb1b5228306c7d32fd367e31cfb [subvolume] │ ├── ae4b1477a30ae9aec93db3d809d42ca4ebcc67f69be1a3a7d1ac22c4c913c979 [subvolume] │ ├── ae4b1477a30ae9aec93db3d809d42ca4ebcc67f69be1a3a7d1ac22c4c913c979-init [subvolume] │ ├── ae70f16ad4f512042e74632c44487e55c40da9c14eab35f891e03d6744b603d7 [subvolume] │ ├── af1588068252c9fa4b652f70bf7c2be36e74970dd2d25f833351207ef8df4f8a [subvolume] │ ├── af831b2019d573b588fc4b23d0f9621ba49344a0e49e07e1931941d74a02f41c [subvolume] │ ├── b213744d000af4f808aeef0b6b581e1fece3f55fcbb10923aefb0cda1bf032cb [subvolume] │ ├── b21514e253ed84146219804e1fb479069cf94ce4951c3cc006dfdeac50e7e3b6 [subvolume] │ ├── b21514e253ed84146219804e1fb479069cf94ce4951c3cc006dfdeac50e7e3b6-init [subvolume] │ ├── b278ac2ced8e5be5a5637cfccb6b060a563797fc7f0b1f7fd09bbd9bd52178c5 [subvolume] │ ├── b323b8ba55c574ad290eeb085274d3a06153261895640da2299ba59b574e1987 [subvolume] │ ├── b6811d266477bf6838f7651352422d1c4fcdfd587f283c1b1945331c87052497 [subvolume] │ ├── bbb6e3d4538b18a2c09438ddb635b93b48768f2de34b91476013d67fb70bda13 [subvolume] │ ├── bbea3577b2f32ca75f269d7b7819804c501dae85758910174e014dc0911782e3 [subvolume] │ ├── be3e5baeac649613d931d57fb3c276a94f483d1857fe2d613491ab046e455b4f [subvolume] │ ├── c137d0e822712cc3470d503250f58a07f862eb068efd3ec178b4ab64f9a8ebbe [subvolume] │ ├── c303af21ef3d4ab575ca2fc5e22ebd2990266045fed63d7d177425e509d3eac3 [subvolume] │ ├── c42ad2269db897ab6cad63341a50198441dbe95f68e9afd35ce95108bdf6b01b [subvolume] │ ├── c96313cb4bf38a89766326c4d2862317435ec89f8ea7742df462405e622b8cc2 [subvolume] │ ├── c968b25cb26874b208fd87ac65b0f4353513856a52422f26a05ba0d80a35927e [subvolume] │ ├── cb4d9ff547b00bba399a66ec0ca6535a36340ac79a0d593dd1883f3827971125 [subvolume] │ ├── cedc94f61194dbfb4777469a3c471897bd0c37574e86f10052574ad67a770cdb [subvolume] │ ├── cf6d34821472b37ab938f2aed34180a3e307d03498a7f9556e4b28064c5ff5fe [subvolume] │ ├── d1a2ba01b0d8fa1aaa41b833990dc6e07029e6e05f2799ddf9e99ba77f996a38 [subvolume] │ ├── d1b195a4cf5eb30806b025e084cbaf60db0d41318374ce37c10bdd558acf4455 [subvolume] │ ├── d39f173759b5cb00ad4b94dc5bbfb46f668c14d8a8a57d2781bff797e236c40c [subvolume] │ ├── d408ab2674b65e585ed38c0aff9a3b7e4bc5b99323fa0a3785d1fbc9b18f28f3 [subvolume] │ ├── d682b839090896b6191cea0cafeb5d120a53349628ed3608a59bec2a1e7cf03a [subvolume] │ ├── d7aba4d418676d4b5fc30b7277263ff1b2ddae78cc42cb0506ca9a8a7ef8b0d2 [subvolume] │ ├── d8155b0c9b3288d95cf0b34737e7c6e59dd18746a7f5c23a7d2471a0f84d995d [subvolume] │ ├── e061c9fc235eadcc9bbfad1d331b2319a233bc11ccb8fca877c0b4f3f6194093 [subvolume] │ ├── e394b6b29d20d33987d31e72b8cd8d61e1830b4d19c88068043c543c76b50091 [subvolume] │ ├── e90ea7e0ccb1704fcc0bfa84a6c5d69cd8dfa7e71f0978acdd77e246866d86c4 [subvolume] │ ├── e9de67111f915329077f37d35d27cf8ab0fd06da52f78150c117c43f788fd436 [subvolume] │ ├── eb1f6d8354222fe2785457129536a274672ee0b701eda6e11b37a832a60db4fe [subvolume] │ ├── ec905a247c90606cb1c1c6f8de70a2dcdbb878807029c4a0e7282cd508df0a88 [subvolume] │ ├── ecc6ea1489a6824862368cc696de62e1de59e91f95bb32a8be9062dd6ebb91e0 [subvolume] │ ├── ed5ca91a59e7af54d53e26aa9d36fe808977bf9108062c2c0ad6459f71bda28a [subvolume] │ ├── f1cd905a529b29c781046b938e7d0c4d304b5a8b72ae3e421b4e6b0741e16225 [subvolume] │ ├── f44985236424c3fe7ee3c1f03b96cdf900237525834cf08e2ae20a006befa894 [subvolume] │ ├── f5ab6f9527d9a4005ac0d5fff67d5ffe3c76c63d838f874b0f6f5e48cbe449c5 [subvolume] │ ├── f5e521d8836784952f5284bedf2eb21609aabe4a635b69a5ec3173b8ae985c79 [subvolume] │ ├── f98a7a592f8037112beacf83ea57018eeaa02b373846ee3e5cb7d92614bf887d [subvolume] │ ├── fa72ab0d40ee0f6f0c7983f29e6f18912e15f0adfa186601310dc51cb074c71e [subvolume] │ ├── fe47f2523538d4d0dbcffd9bcc9988b56307408ba7aa43efd4f98c6c6e32c053 [subvolume] │ ├── ffbb7e81c40a12f14272aa7f513afcb8b6d9d9434a79d61eb9708e550cfc14ec [subvolume] │ ├── ffc63fd2cb384d5947be41ad3ebc833fbe640972d7dab1d8d2e8c8f0f2f26ae8 [subvolume] │ ├── gausatk48ykmtsctelpjlgl5q [subvolume] │ ├── ha2ezibnz7kp9e8qbffo4uev8 [subvolume] │ ├── hz756ye21dlyixrusywzbkmld [subvolume] │ ├── ifovzax05f2qeoq38viuuzt2j [subvolume] │ ├── k1dja4oii0t0iez8eh83shdum [subvolume] │ ├── kpgbkv2vupiwlmf39mhrqwb97 [subvolume] │ ├── r5iobjjar16wpvxkahxiuycis [subvolume] │ ├── t9z5xwwjyo9vowykavqtwwdu9 [subvolume] │ ├── txguncb9q75hcfdyidpp3s13f [subvolume] │ ├── wvx9s06pqe1thcklwqyzbmyfw [subvolume] │ └── y5260lpkjd414b1y290xdfx10 [subvolume] ├── @sharesnap [subvolume] ├── Backups [subvolume] ├── Bilder [subvolume] ├── Daten [subvolume] ├── Daten.snapshot [subvolume] ├── Downloads [subvolume] ├── Filme [subvolume] ├── NetBackup [subvolume] ├── NewMusik [subvolume] ├── Profiles [subvolume] ├── Programme [subvolume] ├── Remote [subvolume] ├── Scanner [subvolume] ├── Serien [subvolume] ├── borg [subvolume] ├── docker [subvolume] ├── eBooks [subvolume] ├── local [subvolume] ├── music [subvolume] ├── synology [subvolume] ├── video [subvolume] ├── web [subvolume] └── web_packages [subvolume] ```
Owner

Yeah, I don't think Gitea has comment-by-email functionality like Debian's BTS has.

Isn't Gitea the odd one out here? I assume you've used Github, Gitlab, Buzilla, etc, all of which have functional reply-by-email? ;)

Looks like it actually does; it's just not configured here.

When is this a better idea than taking a read-only snapshot, and why?

Above, we were discussing snapshotting read-only subvolumes (and the borgmatic documentation's claim that "Btrfs does not support snapshotting read-only subvolumes."). So I was first making an example subvolume read-only so that I could demonstrate what happened on my machine when I tried to take a read-only snapshot of it.

Yes, I understand that, but please answer the question. Why is mucking with special properties (and then unmucking) a better idea than creating an ephemeral read-only snapshot and leaving the source untouched?

Changing the source subvolume's properties was an attempt to demonstrate what happens when snapshotting a read-only subvolume on my system. I'm not sure how to demonstrate that without ... starting with a read-only subvolume.

Are you instead suggesting that, rather than ever snapshotting a read-only subvolume, one should instead make a read-only snapshot of a read-write subvolume? I mean, sure, that seems like a reasonable thing to do. But it also seems orthogonal to the disputed claim that "Btrfs does not support snapshotting read-only subvolumes." Which incidentally I would be happy to be proven wrong about...

Please provide a reproducer so I can see why your machine is failing at basic functionality. At this point one explanation is that your system is affected by bugs affecting btrfs special properties...

Here you go... This is what I'm running as root on Linux kernel 6.12.44-3-MANJARO:

dd if=/dev/zero of=/root/btrfs.img bs=1M count=110
losetup /dev/loop2 /root/btrfs.img
mkfs.btrfs /dev/loop2
mount /dev/loop2 /mnt/subvolume
btrfs property set /mnt/subvolume ro true
btrfs subvolume snapshot -r /mnt/subvolume /mnt/subvolume/@snapshot

And this is what I get:

ERROR: cannot snapshot '/mnt/subvolume': Read-only file system

Ah, yes my convenient setup commands assume you've booted a VM that has a btrfs rootfs. Those will need to be modified for /arbitrary/mount/point, but I'd hope that borgmatic is being tested on a real system like users use.

If you're suggesting that there be manual testing on a btrfs-rooted system, then no, that currently doesn't happen.

I mean, yeah, you'll need to modify the command I provided to get the block device for / if you're trying to get it for /some_mnt/. But booting off of btrfs? There is no special magic there. It will take a few minutes to install a VM and run my reproducer. Actually, on that topic, does borgmatic have access to a VM-backed CI? It seems to me that these would make good sanity checks, before doing CI on borgmatics btrfs functionality.

Nope, CI is currently only container-based.

No, there is something else on your test-bed that is leading to idiosyncratic results. Please provide a full reproducer.

See above. Hopefully you can spot what I'm doing wrong.

The standard btrfs CLI is /usr/bin/btrfs and its subcommands. (ie: btrfs subvolume list /mount/point) Have you read the examples for the python module here yet: https://github.com/knorrie/python-btrfs ?

I'll check those out and see if I can ditch findmnt for btrfs. But that might require doing probing along the components of a path like I think https://github.com/knorrie/python-btrfs/blob/master/examples/show_subvolumes.py is doing. Something like:

  • for each configured borgmatic source directory:
    • btrfs subvolume show that directory to determine if it's a subvolume (if found, done for this directory)
    • repeat through all of its parent and grandparent directories until a subvolume is found or there are no more parents

Yes, that's why I called it a plugin ;) I'm not talking about replacing the difficult-to-implement-correctly-and-reliably btrfs support with support for a specific blessed snapshot manager and then calling that borgmatic's btrfs support. In addition to snapper, there is an Ubuntu-specific one, and yabsnap. Please point me in the direction of the kind of interface you'd expect in the config.

It really depends on the needs of the plugin/hook and the functionality it's exposing. For instance, here's the config for the existing Btrfs hook:

# Configuration for integration with the Btrfs filesystem.
# btrfs:
    # Command to use instead of "btrfs".
    # btrfs_command: /usr/local/bin/btrfs

    # Command to use instead of "findmnt".
    # findmnt_command: /usr/local/bin/findmnt

So the minimal config needed to turn on the hook is literally:

btrfs:

Yes, this is what I'm asking about. I'm interested in implementing a snapshot-manager plugin because then I don't need to teach you btrfs ;) Would you please point me to a design/schema/interfaces document? What do you mean by "approach"? What I'm proposing is arguably just enabling syntactic sugar for the YAML config, plus two or three ultra-short example configurations as documentation. The objective is to make it near effortless for users.

By "approach" I just mean implementation design: What you're planning on doing in the code behind the interface, what you're planning on adding to the config schema, etc. There isn't a formal design/schema/interfaces document for writing plugins/hooks in particular, but there is this: https://torsion.org/borgmatic/docs/reference/source-code/

Also, looking at an existing plugin/hook should hopefully be pretty clear in terms of the interface. The Btrfs hook might be a good place to start: https://projects.torsion.org/borgmatic-collective/borgmatic/src/branch/main/borgmatic/hooks/data_source/btrfs.py ... The functions that need implementation for any snapshot-oriented hook are:

  • use_streaming
  • dump_data_sources
  • remove_data_source_dumps
  • make_data_source_dump_patterns
  • restore_data_source_dump
  1. I've been told I'm a stickler for code style considerations in PRs, although this is hopefully not a big concern because it's less substantive / requires less rework.

That's fine with me :) It's potential fundamental irreconcilable differences that I'm worried about.

Fair enough.

> > Yeah, I don't think Gitea has comment-by-email functionality like Debian's BTS has. > > Isn't Gitea the odd one out here? I assume you've used Github, Gitlab, Buzilla, etc, all of which have functional reply-by-email? ;) Looks like [it actually does](https://docs.gitea.com/usage/incoming-email); it's just not configured here. > > > When is this a better idea than taking a read-only snapshot, and why? > > > > Above, we were discussing snapshotting read-only subvolumes (and the borgmatic documentation's claim that "Btrfs does not support snapshotting read-only subvolumes."). So I was first making an example subvolume read-only so that I could demonstrate what happened on my machine when I tried to take a read-only snapshot of it. > > Yes, I understand that, but please answer the question. Why is mucking with special properties (and then unmucking) a better idea than creating an ephemeral read-only snapshot and leaving the source untouched? Changing the source subvolume's properties was an attempt to demonstrate what happens when snapshotting a read-only subvolume on my system. I'm not sure how to demonstrate that without ... starting with a read-only subvolume. Are you instead suggesting that, rather than ever snapshotting a read-only subvolume, one should instead make a read-only snapshot of a read-write subvolume? I mean, sure, that seems like a reasonable thing to do. But it also seems orthogonal to the disputed claim that "Btrfs does not support snapshotting read-only subvolumes." Which incidentally I would be happy to be proven wrong about... > Please provide a reproducer so I can see why your machine is failing at basic functionality. At this point one explanation is that your system is affected by bugs affecting btrfs special properties... Here you go... This is what I'm running as root on Linux kernel 6.12.44-3-MANJARO: ```bash dd if=/dev/zero of=/root/btrfs.img bs=1M count=110 losetup /dev/loop2 /root/btrfs.img mkfs.btrfs /dev/loop2 mount /dev/loop2 /mnt/subvolume btrfs property set /mnt/subvolume ro true btrfs subvolume snapshot -r /mnt/subvolume /mnt/subvolume/@snapshot ``` And this is what I get: ```bash ERROR: cannot snapshot '/mnt/subvolume': Read-only file system ``` > Ah, yes my convenient setup commands assume you've booted a VM that has a btrfs rootfs. Those will need to be modified for /arbitrary/mount/point, but I'd hope that borgmatic is being tested on a real system like users use. If you're suggesting that there be manual testing on a btrfs-rooted system, then no, that currently doesn't happen. > I mean, yeah, you'll need to modify the command I provided to get the block device for / if you're trying to get it for /some_mnt/. But booting off of btrfs? There is no special magic there. It will take a few minutes to install a VM and run my reproducer. Actually, on that topic, does borgmatic have access to a VM-backed CI? It seems to me that these would make good sanity checks, before doing CI on borgmatics btrfs functionality. Nope, CI is currently only container-based. > No, there is something else on your test-bed that is leading to idiosyncratic results. Please provide a full reproducer. See above. Hopefully you can spot what I'm doing wrong. > The standard btrfs CLI is `/usr/bin/btrfs` and its subcommands. (ie: `btrfs subvolume list /mount/point`) Have you read the examples for the python module here yet: https://github.com/knorrie/python-btrfs ? I'll check those out and see if I can ditch `findmnt` for `btrfs`. But that might require doing probing along the components of a path like I think https://github.com/knorrie/python-btrfs/blob/master/examples/show_subvolumes.py is doing. Something like: * for each configured borgmatic source directory: * `btrfs subvolume show` that directory to determine if it's a subvolume (if found, done for this directory) * repeat through all of its parent and grandparent directories until a subvolume is found or there are no more parents > Yes, that's why I called it a plugin ;) I'm not talking about replacing the difficult-to-implement-correctly-and-reliably btrfs support with support for a specific blessed snapshot manager and then calling that borgmatic's btrfs support. In addition to snapper, there is an Ubuntu-specific one, and yabsnap. Please point me in the direction of the kind of interface you'd expect in the config. It really depends on the needs of the plugin/hook and the functionality it's exposing. For instance, here's the config for the existing Btrfs hook: ```yaml # Configuration for integration with the Btrfs filesystem. # btrfs: # Command to use instead of "btrfs". # btrfs_command: /usr/local/bin/btrfs # Command to use instead of "findmnt". # findmnt_command: /usr/local/bin/findmnt ``` So the minimal config needed to turn on the hook is literally: ```yaml btrfs: ``` > Yes, this is what I'm asking about. I'm interested in implementing a snapshot-manager plugin because then I don't need to teach you btrfs ;) Would you please point me to a design/schema/interfaces document? What do you mean by "approach"? What I'm proposing is arguably just enabling syntactic sugar for the YAML config, plus two or three ultra-short example configurations as documentation. The objective is to make it near effortless for users. By "approach" I just mean implementation design: What you're planning on doing in the code behind the interface, what you're planning on adding to the config schema, etc. There isn't a formal design/schema/interfaces document for writing plugins/hooks in particular, but there is this: https://torsion.org/borgmatic/docs/reference/source-code/ Also, looking at an existing plugin/hook should hopefully be pretty clear in terms of the interface. The Btrfs hook might be a good place to start: https://projects.torsion.org/borgmatic-collective/borgmatic/src/branch/main/borgmatic/hooks/data_source/btrfs.py ... The functions that need implementation for any snapshot-oriented hook are: * `use_streaming` * `dump_data_sources` * `remove_data_source_dumps` * `make_data_source_dump_patterns` * `restore_data_source_dump` > > 2. I've been told I'm a stickler for code style considerations in PRs, although this is hopefully not a big concern because it's less substantive / requires less rework. > > That's fine with me :) It's potential fundamental irreconcilable differences that I'm worried about. Fair enough.
Owner

@smhrambo Thanks for the detailed response including the script and output. A couple of points:

  • I agree that using btrfs subvolume show as you suggest instead of findmnt would likely address your issue. See my previous comment about one way that might work in regards to borgmatic's source_directories.
  • borgmatic does have support for snapshotting LVM volumes, so that is potentially an alternative to using the Btrfs snapshotting.

I'll keep you updated about what I find in attempting to jettison findmnt!

@smhrambo Thanks for the detailed response including the script and output. A couple of points: - I agree that using `btrfs subvolume show` as you suggest instead of `findmnt` would likely address your issue. See my previous comment about one way that might work in regards to borgmatic's `source_directories`. - borgmatic does have support for [snapshotting LVM volumes](https://torsion.org/borgmatic/docs/how-to/snapshot-your-filesystems/#lvm), so that is potentially an alternative to using the Btrfs snapshotting. I'll keep you updated about what I find in attempting to jettison `findmnt`!

Please provide a reproducer so I can see why your machine is failing at basic functionality. At this point one explanation is that your system is affected by bugs affecting btrfs special properties...

Here you go... This is what I'm running as root on Linux kernel 6.12.44-3-MANJARO:

dd if=/dev/zero of=/root/btrfs.img bs=1M count=110
losetup /dev/loop2 /root/btrfs.img
mkfs.btrfs /dev/loop2
mount /dev/loop2 /mnt/subvolume
btrfs property set /mnt/subvolume ro true
btrfs subvolume snapshot -r /mnt/subvolume /mnt/subvolume/@snapshot

And this is what I get:

ERROR: cannot snapshot '/mnt/subvolume': Read-only file system

That's no surprise.
You are adding a snapshot or subvolume to the read-only subvolume.
Internally, btrfs attempts to create a nested subvolume in the read-only subvolume, which constitutes a change to the read-only subvolume.

try this:

dd if=/dev/zero of=/root/btrfs.img bs=1M count=110
losetup /dev/loop2 /root/btrfs.img
mkfs.btrfs /dev/loop2
mount -m /dev/loop2 /mnt/btrfsrootvolume
btrfs subvolume create /mnt/btrfsrootvolume/subvolume
btrfs property set /mnt/btrfsrootvolume/subvolume ro true
btrfs subvolume snapshot -r /mnt/btrfsrootvolume/subvolume /mnt/btrfsrootvolume/@subvolume

Regarding LVM:
This would negate the advantage of subvolumes in btrfs.
In btrfs, all subvolumes dynamically share the entire storage space available to the BTRFS partition.
This is not the case with LVM.
Although a shared storage pool is also available, it must be "permanently" divided into LVs.
For this solution, I would have to back up all data and set up the entire NAS again.
In addition, Synology encapsulates many of the functions that Linux server administrators are familiar with.
This makes it a gamble every time you tinker with the file system.
That's why I'm staying at the last level (btrfs).
Creating a simple subvolume on the share partition is easier than moving storage space back and forth between LVs.
Yes, there is an LVM with an LV, but that would require me to back up the entire disk with more than 16TB every time, and I have a separate backup strategy for each subvolume/network share.

Regarding source_directories:
I can mount the subvolume in a different location, but that would mean interfering with the Synology system again (which should be avoided at all costs).
The root/OS file system is ext4 and has specific mounting points for the partitions on which the network shares are located.

Here is a small excerpt from one of the configuration files:

cat /etc/samba/smb.conf

# Copyright (c) 2000-2019 Synology Inc. All rights reserved.
#
#
#                          ______     _______
#                        (  __  \   (  ___  )
#                        | (  \  )  | (   ) |
#                        | |   ) |  | |   | |
#                        | |   | |  | |   | |
#                        | |   ) |  | |   | |
#                        | (__/  )  | (___) |
#                        (______/   (_______)
#
#                   _          _______   _________
#                  ( (    /|  (  ___  )  \__   __/
#                  |  \  ( |  | (   ) |     ) (
#                  |   \ | |  | |   | |     | |
#                  | (\ \) |  | |   | |     | |
#                  | | \   |  | |   | |     | |
#                  | )  \  |  | (___) |     | |
#                  |/    )_)  (_______)     )_(
#
#   _______    _______    ______    _________   _______
#  (       )  (  ___  )  (  __  \   \__   __/  (  ____ \  |\     /|
#  | () () |  | (   ) |  | (  \  )     ) (     | (    \/  ( \   / )
#  | || || |  | |   | |  | |   ) |     | |     | (__       \ (_) /
#  | |(_)| |  | |   | |  | |   | |     | |     |  __)       \   /
#  | |   | |  | |   | |  | |   ) |     | |     | (           ) (
#  | )   ( |  | (___) |  | (__/  )  ___) (___  | )           | |
#  |/     \|  (_______)  (______/   \_______/  |/            \_/
#
#
# IMPORTANT: Synology will not provide technical support for any issues
#            caused by unauthorized modification to the configuration.

I know that my next system won't be a Synology, but that's just how it is right now.
If there is a problem during bootup, the only option is to restore the system, but this will delete all data.
So booting into recovery mode and fixing the error is not an option.

it's like fuck around and find out.

> > Please provide a reproducer so I can see why your machine is failing at basic functionality. At this point one explanation is that your system is affected by bugs affecting btrfs special properties... > > Here you go... This is what I'm running as root on Linux kernel 6.12.44-3-MANJARO: > > ```bash > dd if=/dev/zero of=/root/btrfs.img bs=1M count=110 > losetup /dev/loop2 /root/btrfs.img > mkfs.btrfs /dev/loop2 > mount /dev/loop2 /mnt/subvolume > btrfs property set /mnt/subvolume ro true > btrfs subvolume snapshot -r /mnt/subvolume /mnt/subvolume/@snapshot > ``` > > And this is what I get: > > ```bash > ERROR: cannot snapshot '/mnt/subvolume': Read-only file system > ``` That's no surprise. You are adding a snapshot or subvolume to the read-only subvolume. Internally, btrfs attempts to create a nested subvolume in the read-only subvolume, which constitutes a change to the read-only subvolume. try this: ```bash dd if=/dev/zero of=/root/btrfs.img bs=1M count=110 losetup /dev/loop2 /root/btrfs.img mkfs.btrfs /dev/loop2 mount -m /dev/loop2 /mnt/btrfsrootvolume btrfs subvolume create /mnt/btrfsrootvolume/subvolume btrfs property set /mnt/btrfsrootvolume/subvolume ro true btrfs subvolume snapshot -r /mnt/btrfsrootvolume/subvolume /mnt/btrfsrootvolume/@subvolume ``` Regarding `LVM`: This would negate the advantage of subvolumes in btrfs. In btrfs, all subvolumes dynamically share the entire storage space available to the BTRFS partition. This is not the case with LVM. Although a shared storage pool is also available, it must be "permanently" divided into LVs. For this solution, I would have to back up all data and set up the entire NAS again. In addition, Synology encapsulates many of the functions that Linux server administrators are familiar with. This makes it a gamble every time you tinker with the file system. That's why I'm staying at the last level (btrfs). Creating a simple subvolume on the share partition is easier than moving storage space back and forth between LVs. Yes, there is an LVM with an LV, but that would require me to back up the entire disk with more than 16TB every time, and I have a separate backup strategy for each subvolume/network share. Regarding `source_directories`: I can mount the subvolume in a different location, but that would mean interfering with the Synology system again (which should be avoided at all costs). The root/OS file system is ext4 and has specific mounting points for the partitions on which the network shares are located. Here is a small excerpt from one of the configuration files: cat /etc/samba/smb.conf ``` # Copyright (c) 2000-2019 Synology Inc. All rights reserved. # # # ______ _______ # ( __ \ ( ___ ) # | ( \ ) | ( ) | # | | ) | | | | | # | | | | | | | | # | | ) | | | | | # | (__/ ) | (___) | # (______/ (_______) # # _ _______ _________ # ( ( /| ( ___ ) \__ __/ # | \ ( | | ( ) | ) ( # | \ | | | | | | | | # | (\ \) | | | | | | | # | | \ | | | | | | | # | ) \ | | (___) | | | # |/ )_) (_______) )_( # # _______ _______ ______ _________ _______ # ( ) ( ___ ) ( __ \ \__ __/ ( ____ \ |\ /| # | () () | | ( ) | | ( \ ) ) ( | ( \/ ( \ / ) # | || || | | | | | | | ) | | | | (__ \ (_) / # | |(_)| | | | | | | | | | | | | __) \ / # | | | | | | | | | | ) | | | | ( ) ( # | ) ( | | (___) | | (__/ ) ___) (___ | ) | | # |/ \| (_______) (______/ \_______/ |/ \_/ # # # IMPORTANT: Synology will not provide technical support for any issues # caused by unauthorized modification to the configuration. ``` I know that my next system won't be a Synology, but that's just how it is right now. If there is a problem during bootup, the only option is to restore the system, but this will delete all data. So booting into recovery mode and fixing the error is not an option. it's like fuck around and find out.
Owner
ERROR: cannot snapshot '/mnt/subvolume': Read-only file system

That's no surprise.
You are adding a snapshot or subvolume to the read-only subvolume.
Internally, btrfs attempts to create a nested subvolume in the read-only subvolume, which constitutes a change to the read-only subvolume.

Ah that makes sense.. Thanks for explaining! I'm not sure there's a generalized way for borgmatic to take advantage of this though.. e.g., for borgmatic to put its snapshot path outside of the subvolume path being snapshotted. For instance, your example works great if there's a Btrfs root filesystem (or at minimum a parent Btrfs filesystem) and the snapshot is put on it, but AFAIK it won't work if there's some other non-Btrfs root or parent. So it might be easier to just leave the no-read-only-subvolume restriction (and update the docs to clarify that it's a borgmatic limitation and not a Btrfs one).

That's why I'm staying at the last level (btrfs).
Creating a simple subvolume on the share partition is easier than moving storage space back and forth between LVs.
Yes, there is an LVM with an LV, but that would require me to back up the entire disk with more than 16TB every time, and I have a separate backup strategy for each subvolume/network share.

Okay, understood!

Regarding source_directories:
I can mount the subvolume in a different location, but that would mean interfering with the Synology system again (which should be avoided at all costs).
The root/OS file system is ext4 and has specific mounting points for the partitions on which the network shares are located.

I follow the Synology limitations, but I'm not following how this is related to the proposed source_directories probing strategy to find Btrfs subvolumes described above. Or were you talking about something else?

> > ```bash > > ERROR: cannot snapshot '/mnt/subvolume': Read-only file system > > ``` > > That's no surprise. > You are adding a snapshot or subvolume to the read-only subvolume. > Internally, btrfs attempts to create a nested subvolume in the read-only subvolume, which constitutes a change to the read-only subvolume. Ah that makes sense.. Thanks for explaining! I'm not sure there's a generalized way for borgmatic to take advantage of this though.. e.g., for borgmatic to put its snapshot path outside of the subvolume path being snapshotted. For instance, your example works great if there's a Btrfs root filesystem (or at minimum a parent Btrfs filesystem) and the snapshot is put on it, but AFAIK it won't work if there's some other non-Btrfs root or parent. So it might be easier to just leave the no-read-only-subvolume restriction (and update the docs to clarify that it's a borgmatic limitation and not a Btrfs one). > That's why I'm staying at the last level (btrfs). > Creating a simple subvolume on the share partition is easier than moving storage space back and forth between LVs. > Yes, there is an LVM with an LV, but that would require me to back up the entire disk with more than 16TB every time, and I have a separate backup strategy for each subvolume/network share. Okay, understood! > Regarding `source_directories`: > I can mount the subvolume in a different location, but that would mean interfering with the Synology system again (which should be avoided at all costs). > The root/OS file system is ext4 and has specific mounting points for the partitions on which the network shares are located. I follow the Synology limitations, but I'm not following how this is related to the proposed `source_directories` probing strategy to find Btrfs subvolumes described above. Or were you talking about something else?

Regarding source_directories:
I can mount the subvolume in a different location, but that would mean interfering with the Synology system again (which should be avoided at all costs).
The root/OS file system is ext4 and has specific mounting points for the partitions on which the network shares are located.

I follow the Synology limitations, but I'm not following how this is related to the proposed source_directories probing strategy to find Btrfs subvolumes described above. Or were you talking about something else?

Maybe we really did talk past each other.
I was referring to this part:

I agree that using btrfs subvolume show as you suggest instead of findmnt would likely address your issue. See my previous comment about one way that might work in regards to borgmatic's source_directories.

I thought you were referring to this comment:

In terms of solutions, here's what I can think of:

  • I can look into whether borgmatic can be updated to support snapshotting unmounted Btrfs subvolumes. I would appreciate if you file a separate ticket for that though.

  • Or: As a workaround, you can just mount the subvolume, and then presumably borgmatic would discover it.

I would prefer not to create an extra mount point in the root directory of the Synology OS.
Especially when it comes to permanent configuration (fstab).

Oh yes, about btrfs and subvolumes.
This is precisely why we avoid mounting the “root” volume directly "as much as possible".
A subvolume is usually used as the Linux root directory,
in which the directory structure is created either by folders,
nested subvolumes, or separate subvolumes from the btrfs “root” volume.

btrfs root volume

  • subvolume @ <- mounted as / (fstab)
    • subvolume @/var <- not mounted, exists as a nested subvolume
  • subvolume @home <- mounted at /home (fstab)

There are no limits to your imagination.

I spent a lot of time working on this last month.
Dual boot, Windows and CachyOS with secure boot, grub, and btrfs.
What a pleasure (not).

> > Regarding `source_directories`: > > I can mount the subvolume in a different location, but that would mean interfering with the Synology system again (which should be avoided at all costs). > > The root/OS file system is ext4 and has specific mounting points for the partitions on which the network shares are located. > > I follow the Synology limitations, but I'm not following how this is related to the proposed `source_directories` probing strategy to find Btrfs subvolumes described above. Or were you talking about something else? Maybe we really did talk past each other. I was referring to this part: > I agree that using `btrfs subvolume show` as you suggest instead of findmnt would likely address your issue. See my previous comment about one way that might work in regards to borgmatic's `source_directories`. I thought you were referring to this comment: > In terms of solutions, here's what I can think of: > > * I can look into whether borgmatic can be updated to support snapshotting unmounted Btrfs subvolumes. I would appreciate if you file a separate ticket for that though. > > * _Or:_ As a workaround, you can just mount the subvolume, and then presumably borgmatic would discover it. I would prefer not to create an extra mount point in the root directory of the Synology OS. Especially when it comes to permanent configuration (fstab). Oh yes, about btrfs and subvolumes. This is precisely why we avoid mounting the “root” volume directly "as much as possible". A subvolume is usually used as the Linux root directory, in which the directory structure is created either by folders, nested subvolumes, or separate subvolumes from the btrfs “root” volume. btrfs root volume - subvolume @ <- mounted as / (fstab) - subvolume @/var <- not mounted, exists as a nested subvolume - subvolume @home <- mounted at /home (fstab) There are no limits to your imagination. I spent a lot of time working on this last month. Dual boot, Windows and CachyOS with secure boot, grub, and btrfs. What a pleasure (not).
Owner

I follow the Synology limitations, but I'm not following how this is related to the proposed source_directories probing strategy to find Btrfs subvolumes described above. Or were you talking about something else?

Maybe we really did talk past each other.
I was referring to this part:

I agree that using btrfs subvolume show as you suggest instead of findmnt would likely address your issue. See my previous comment about one way that might work in regards to borgmatic's source_directories.

I thought you were referring to this comment:
[...]
I would prefer not to create an extra mount point in the root directory of the Synology OS.
Especially when it comes to permanent configuration (fstab).

Yeah, I think we were talking past each other. (This ticket thread is too long!) I was actually referring to this comment I made earlier:

I'll check those out and see if I can ditch findmnt for btrfs. But that might require doing probing along the components of a path like I think https://github.com/knorrie/python-btrfs/blob/master/examples/show_subvolumes.py is doing. Something like:

  • for each configured borgmatic source directory:
    • btrfs subvolume show that directory to determine if it's a subvolume (if found, done for this directory)
    • repeat through all of its parent and grandparent directories until a subvolume is found or there are no more parents

Does that sound like something that will work for you?

Oh yes, about btrfs and subvolumes.
This is precisely why we avoid mounting the “root” volume directly "as much as possible".
A subvolume is usually used as the Linux root directory,
in which the directory structure is created either by folders,
nested subvolumes, or separate subvolumes from the btrfs “root” volume.

btrfs root volume

  • subvolume @ <- mounted as / (fstab)
    • subvolume @/var <- not mounted, exists as a nested subvolume
  • subvolume @home <- mounted at /home (fstab)

There are no limits to your imagination.

I spent a lot of time working on this last month.
Dual boot, Windows and CachyOS with secure boot, grub, and btrfs.
What a pleasure (not).

Hah, indeed. Okay, what I'm taking from this is that I'll leave the existing borgmatic Btrfs snapshot path construction for now, but we can always revisit later.

> > I follow the Synology limitations, but I'm not following how this is related to the proposed `source_directories` probing strategy to find Btrfs subvolumes described above. Or were you talking about something else? > > Maybe we really did talk past each other. > I was referring to this part: > > > I agree that using `btrfs subvolume show` as you suggest instead of findmnt would likely address your issue. See my previous comment about one way that might work in regards to borgmatic's `source_directories`. > > I thought you were referring to this comment: > [...] > I would prefer not to create an extra mount point in the root directory of the Synology OS. > Especially when it comes to permanent configuration (fstab). Yeah, I think we were talking past each other. (This ticket thread is too long!) I was actually referring to this comment I made earlier: _I'll check those out and see if I can ditch `findmnt` for `btrfs`. But that might require doing probing along the components of a path like I think https://github.com/knorrie/python-btrfs/blob/master/examples/show_subvolumes.py is doing. Something like:_ * _for each configured borgmatic source directory:_ * _`btrfs subvolume show` that directory to determine if it's a subvolume (if found, done for this directory)_ * _repeat through all of its parent and grandparent directories until a subvolume is found or there are no more parents_ Does that sound like something that will work for you? > Oh yes, about btrfs and subvolumes. > This is precisely why we avoid mounting the “root” volume directly "as much as possible". > A subvolume is usually used as the Linux root directory, > in which the directory structure is created either by folders, > nested subvolumes, or separate subvolumes from the btrfs “root” volume. > > > btrfs root volume > - subvolume @ <- mounted as / (fstab) > - subvolume @/var <- not mounted, exists as a nested subvolume > - subvolume @home <- mounted at /home (fstab) > > There are no limits to your imagination. > > I spent a lot of time working on this last month. > Dual boot, Windows and CachyOS with secure boot, grub, and btrfs. > What a pleasure (not). Hah, indeed. Okay, what I'm taking from this is that I'll leave the existing borgmatic Btrfs snapshot path construction for now, but we can always revisit later.
witten referenced this issue from a commit 2025-09-30 06:07:17 +00:00
witten referenced this issue from a commit 2025-10-02 05:29:14 +00:00
Owner

I've removed findmnt entirely from borgmatic main. This update will be part of the next release. So in the interests of keeping things moving, I'm closing this ticket but I'd be happy to continue the discussion. I'd recommend filing new tickets to discuss any other Btrfs issues, such as topics discussed above besides findmnt removal.

I would like to find out if the code that replaces findmmt does end up working for your use cases. If not, we can certainly iterate on the solution.

I've removed `findmnt` entirely from borgmatic main. This update will be part of the next release. So in the interests of keeping things moving, I'm closing this ticket but I'd be happy to continue the discussion. I'd recommend filing new tickets to discuss any other Btrfs issues, such as topics discussed above besides `findmnt` removal. I would like to find out if the code that replaces `findmmt` does end up working for your use cases. If not, we can certainly iterate on the solution.
Owner

Released in borgmatic 2.0.9!

Released in borgmatic 2.0.9!
Sign in to join this conversation.
No milestone
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
borgmatic-collective/borgmatic#1105
No description provided.