[Samba] Shadowcopy with ZFS Nested Datasets

dag dg dagofthedofg at gmail.com
Fri Feb 5 01:51:14 UTC 2021


Hello. I've had success with getting shadowcopy listings to show on my
Windows clients that access a samba share running on my Fedora 33 server
which has a ZFS volume as a share. I have nested ZFS datasets with the
highest level dataset acting as the root of my share. Any directories that
are stored on the highest level dataset(/storage/Share) including the
dataset itself shows a shadowcopy listing exactly as I desire it every time
consistently. Unfortunately some of the directories under the nested
datasets (such as /storage/Share/Backup) including the nested datasets
themselves only show the shadowcopy entries intermittently. I'm not quite
sure why as when I check the zfs snapshot listings every dataset both those
working and not working show the same pattern of snapshot naming scheme,
etc.

# zfs list
NAME                           USED  AVAIL     REFER  MOUNTPOINT
storage                       31.7T  29.7T      279K  /storage
storage/Share                 31.7T  29.7T     6.78T  /storage/Share
storage/Share/Backup          11.3T  29.7T     9.24T  /storage/Share/Backup
storage/Share/Archive         3.73T  29.7T     3.73T  /storage/Share/Archive
storage/Share/Documents        847M  29.7T      838M
 /storage/Share/Documents
storage/Share/Software        30.1G  29.7T     30.0G
 /storage/Share/Software

[Share]
        comment = Share
        path = /storage/Share
        veto files = /storage/Share/lost+found
        writable = yes
        browseable = yes
        guest ok = yes
        oplocks = False
        level2 oplocks = False
        vfs objects = shadow_copy2
        shadow: snapdir = .zfs/snapshot
        shadow: sort = desc
        shadow: format = -%Y-%m-%d-%H%M
        shadow: snapprefix = ^zfs-auto-snap_.*
        shadow: delimiter = -20
        shadow: snapdirseverywhere = yes
        shadow: crossmountpoints = yes

# smbd --version
Version 4.13.4

[root at media ~]# zfs list -t snapshot storage/Share
NAME                                                   USED  AVAIL
REFER  MOUNTPOINT
storage/Share at zfs-auto-snap_monthly-2020-08-19-0927    250M      -
6.20T  -
storage/Share at zfs-auto-snap_monthly-2020-09-01-0500    252M      -
6.24T  -
storage/Share at zfs-auto-snap_monthly-2020-09-18-0814    259M      -
6.26T  -
storage/Share at zfs-auto-snap_monthly-2020-10-01-0500    260M      -
6.34T  -
storage/Share at zfs-auto-snap_monthly-2020-10-18-0813    266M      -
6.38T  -
storage/Share at zfs-auto-snap_monthly-2020-11-01-0500    274M      -
6.41T  -
storage/Share at zfs-auto-snap_monthly-2020-11-17-1004    275M      -
6.41T  -
storage/Share at zfs-auto-snap_monthly-2020-12-01-0600    304M      -
6.44T  -
.....
storage/Share at zfs-auto-snap_hourly-2021-02-05-0001                      0B
     -     6.78T  -
storage/Share at zfs-auto-snap_frequent-2021-02-05-0045                    0B
     -     6.78T  -
storage/Share at zfs-auto-snap_hourly-2021-02-05-0100                      0B
     -     6.78T  -
storage/Share at zfs-auto-snap_frequent-2021-02-05-0100                    0B
     -     6.78T  -
storage/Share at zfs-auto-snap_hourly-2021-02-05-0101                      0B
     -     6.78T  -
storage/Share at zfs-auto-snap_frequent-2021-02-05-0115                 2.16M
     -     6.78T  -
storage/Share at zfs-auto-snap_frequent-2021-02-05-0130                 2.34M
     -     6.78T  -
.....
storage/Share/Software at zfs-auto-snap_hourly-2021-02-04-2101             0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_hourly-2021-02-04-2200             0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_hourly-2021-02-04-2201             0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_hourly-2021-02-04-2300             0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_hourly-2021-02-04-2301             0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_hourly-2021-02-05-0000             0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_hourly-2021-02-05-0001             0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_frequent-2021-02-05-0045           0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_hourly-2021-02-05-0100             0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_frequent-2021-02-05-0100           0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_hourly-2021-02-05-0101             0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_frequent-2021-02-05-0115           0B
     -     30.0G  -
storage/Share/Software at zfs-auto-snap_frequent-2021-02-05-0130           0B
     -     30.0G  -
.....


It seems pretty consistent that when I first check the shadowcopy entries
for one of the nested dataset directories nothing will be listed, but if I
check immediately afterwards the entries are listed. Not sure if I have a
setting wrong or if this might be a bug(if so with Windows or samba??)?

Any assistance would be appreciated.


More information about the samba mailing list