Trouble with snapshots . (Samba, BTRFS & Snapper) reddit / selfhosted ---------------------------------------------------------------------- gryd3 · 2023-12-14 19:11 Not quite sure how to resolve this, but I've found myself without access to my snapshots over the windows 'Previous Versions' dialogue. This used to work when it was first setup a couple years ago. For context I have : \- An Odroid HC2 (32-bit ARM) \- Ubuntu 20.04 (from Hardkernel) updated to 22.04 \- Samba 4.15.13-Ubuntu (with samba-vfs-modules) \- BTRFS partition with btrfs-progs I have also tested Samba 4.19.3 (local build) on Debian 11 (arm64) and had the same issue. Mount btrfs to /mnt/sda and create a subvolume at /mnt/sda/warehouse . (mount subvol warehouse to /mnt/sda/warehouse) Create snapper config which auto-creates a subvolume at /mnt/sda/warehouse/.snaphots Add user accounts to snapper config 'ALLOW\_USERS' and set 'SYNC\_ACL' to yes. add 'vfs objects = snapper' to smb.conf Now I can create snapshots manually with snapper or wait for them to auto-generate. The snaphots appear to work properly. I can mount the share, and view the '.snapshots' directory and subdirectories from within windows.. however when I check the previous versions dialogue, it's either empty or it shows ONLY the top-most directories, but complains they are empty when attempting to browse them. I'm hopeful that someone know what the magic fix is for this. Without a resolution to this, my plan is to remove snapper and use btrbk instead so that I can use the vfs shadow\_copy2 module with a sane snapshot naming convention of date+time instead of what's forced within snapper. ---------------------------------------------------------------------- thekrautboy · 2023-12-14 19:12 Maybe /r/LinuxQuestions? ---------------------------------------------------------------------- gryd3 · 2023-12-14 21:03 I can give that a try if nothing shows up here. It's running on my desk and is certainly a self-hosted item. Figured I'd give it a try here before posting in other subs. ---------------------------------------------------------------------- thekrautboy · 2023-12-14 21:05 > It's running on my desk and is certainly a self-hosted item That doesnt mean that anything even remotely related to that makes this the perfect subreddit for techsupport, right? ---------------------------------------------------------------------- gryd3 · 2023-12-14 22:26 Is it the perfect place? No, but I'm reaching out for help on a self- hosted project for storage. Part of the issue is that there are lots of moving parts, so a specialized sub is likely to pass me off. It involves Linux, Samba, BTRFS, Snapper and Windows, and the exact location of the problem isn't well known. What would be perfect would be finding another self-hoster that has a similar setup on a Pi or spare PC. I realize you don't have the answer, and that's ok. Move on to something more productive. ---------------------------------------------------------------------- thekrautboy · 2023-12-14 22:38 Telling you a more ideal sub to get your problem solved isnt productive? And out of all the "moving parts" only Samba could sort ot be considered something selfhosted. Good luck! ---------------------------------------------------------------------- gryd3 · 2023-12-17 04:22 Switched gears: Unable to resolve the issue with btrfs+snapper & samba+vfs\_snapper . There's no configuration options to alter snapshot names or locations for either the snapper application or the vf smodule. It's supposed to be plug+play, but just stopped working for some reason. New solution was to deply 'btrbk' to manage snapshots and retention policy, and use vfs\_shadowcopy2 instead. That said: btrbk provides a longish-format timestamp (no seconds) and the snapshots have a label prepended to them that is specific to the subvolume you are taking a snapshot of. Example confguration lines to follow: **btrbk-warehouse.conf** timestamp_format long snapshot_preserve_min 18h snapshot_preserve 48h 7d 4w 12m 3y volume /mnt/sda snapshot_dir warehouse/.snapshots subvolume warehouse **smb.conf** [warehouse] vfs objects = shadow_copy2 path = /mnt/sda/warehouse shadow:snapdir = .snapshots shadow:snapprefix = ^warehouse shadow:delimiter = . shadow:format = .%Y%m%dT%H%M shadow:localtime = no shadow:sort = desc Snapshots are now working properly, although the setup here is a little more involved. Those of you using zfs instead can also use the vfs\_shadowcopy module with sanoid instead of btrkbk. (You'll need to adjust some of the shadow: settings. Primarily the prefix, format, and delimiter)