Hello. I'm trying the above combination (on FreeBSD). Relevant part of my smb.conf is: vfs objects=full_audit shadow_copy2 shadow:sort = desc shadow:format=-%Y%m%d%H%M%S shadow:delimiter=- shadow:snapprefix=auto_zroot shadow:localtime=yes shadow:snapdir=.zfs/snapshot Seems like it's working, but when using "Previous versions" on Windows 10 I only see a few snapshots, not all. E.g., I have:> # ls /shares/.zfs/snapshot/ > auto_zroot-20210301002800 auto_zroot-20211101002800 auto_zroot-20220211010000 auto_zroot-20220216170000 auto_zroot-20220217120000 > auto_zroot-20210401002800 auto_zroot-20211201002800 auto_zroot-20220212020000 auto_zroot-20220216180000 auto_zroot-20220217130000 > auto_zroot-20210501002800 auto_zroot-20211229090000 auto_zroot-20220213100000 auto_zroot-20220216190000 auto_zroot-20220217140000 > auto_zroot-20210601002800 auto_zroot-20220120090000 auto_zroot-20220214090000 auto_zroot-20220216200000 auto_zroot-20220217150000 > auto_zroot-20210701002800 auto_zroot-20220127080000 auto_zroot-20220215080000 auto_zroot-20220217080000 > auto_zroot-20210801002800 auto_zroot-20220128090000 auto_zroot-20220216080000 auto_zroot-20220217090000 > auto_zroot-20210901002800 auto_zroot-20220203090000 auto_zroot-20220216150000 auto_zroot-20220217100000 > auto_zroot-20211001002800 auto_zroot-20220210080000 auto_zroot-20220216160000 auto_zroot-20220217110000But on Windows I only see "Today", with the last 8 snapshots. Another example: I have> auto_zroot-20210301002800 auto_zroot-20210801002800 auto_zroot-20211201002800 auto_zroot-20211220000700 auto_zroot-20220112170000 > auto_zroot-20210401002800 auto_zroot-20210802180000 auto_zroot-20211206140000 auto_zroot-20211220090000 > auto_zroot-20210408150000 auto_zroot-20210901002800 auto_zroot-20211207000700 auto_zroot-20211220110000 > auto_zroot-20210511100000 auto_zroot-20211001002800 auto_zroot-20211207170000 auto_zroot-20220111170000 > auto_zroot-20210608150000 auto_zroot-20211101002800 auto_zroot-20211219001400 auto_zroot-20220112160000But Windows will only show "Last month" with the last two snapshots (which actually belong to the last day I have snapshots for, while the day before is excluded, in spite of being from "last month" too). Is this something to check Samba side or Windows side? bye & Thanks av.
On 17/02/2022 14:54, Andrea Venturoli via samba wrote:> > Hello. > > I'm trying the above combination (on FreeBSD). > > Relevant part of my smb.conf is: > > ??????? vfs objects=full_audit shadow_copy2 > ??????? shadow:sort = desc > ??????? shadow:format=-%Y%m%d%H%M%S > ??????? shadow:delimiter=- > ??????? shadow:snapprefix=auto_zroot > ??????? shadow:localtime=yes > ??????? shadow:snapdir=.zfs/snapshotI'm running Samba 4.13.17 as provided by the default Ubuntu 20.04 repositories, and have a slightly simpler set of options because my snapshot names are just unix timestamps: shadow:sort = desc shadow:snapdir = .zfs/snapshot shadow:format = %s shadow:localtime = yes However, I wonder if you need the leading "-" in your shadow:format. I'd have guessed that samba will look for dirs named: $(SNAPPREFIX)$(DELIMITER)$(FORMAT) which would lead to two "-"s , whereas your snapshots just have one. I've tcpdumped on the samba server at the point I right click the "Restore previous versions.." option on my Win10 client, and then viewed the pcap in wireshark. I see my client sending a FSCTL_SRV_ENUMERATE_SNAPSHOTS request, and then in the server reply I look at the "Ioctl Response" part of the smb payload. That response includes "Out data" looking like... Number of snapshots: 19 Snapshot: @GMT-2022.02.17-12.54.03 Snapshot: @GMT-2022.02.17-06.54.03 (etc etc) The list of snapshots in the pcap matches what I expect based on running zfs list -r -t snapshot -oname, and all of the snapshots display as expected in the Windows previous version client. (NB I have seen some times when the contents of a .zfs/snapshot directory did not match the actual list of snapshots reported by zfs list and never managed to find out why - but that was quite a few years and OSs and ZFS versions ago!) Thus, a similar tcpdump might give you an idea as to whether your samba set up is not responding with the right list of snapshots, or if the fault lies with the Windows client. Adam