How to use ZFS + zfs-auto-snapshot package + Samba to support Windows Shadow Copy on Ubuntu 18.04
1 min readApr 6, 2020
ZFS and Samba support Windows Shadow Copy.
1. Create a ZFS Mount Directory(Point)
Mount Point: /mnt/shared
How to create a ZFS Mount Directory(Point)? The detail is as the below,
Use ZFS file system on Ubuntu 18.04
2. Auto-Create ZFS Snapshot
The detail is as below,
ZFS Snapshot Auto-Create and Rotate for Ubuntu 18.04
3. Install samba-vfs-modules package
$ sudo bash# apt install -y samba-vfs-modules
4. Edit smb.conf
# vim /etc/samba/smb.conf==============================================================
[shared_folder]
path = /mnt/shared
browseable = yes
writeable = yes
read only = no
create mode = 0660
directory mode = 0770
nt acl support = yes
vfs objects = shadow_copy2
shadow:snapdir = .zfs/snapshot
shadow:sort = desc
shadow:format = zfs-auto-snap_frequent-%Y-%m-%d-%H%M
==============================================================
5. Restart Samba Service
# systemctl restart smbd.service
6. Check the feature of Windows Shadow Copy on Samba.
Use Windows to Connect Samba, and you can check the “Previous Versions” of your share on Windows.