Install ZFS snapshot and Enable SAMBA shadow copy ( Previous Versions ) for Windows step by step

  • Successfully installed ZFS snapshot and enabled shadow copy in Windows, have a summary below, could be helpful for everyone.



    1. Install ZFS
    Follow the above link to install.
    After creating a pool, need to change some properties of the pool.

    aclinherit=passthrough

    acltype=posixacl

    set xattr=sa


    2. Install CIFS share and Set permissions

    3. Install ZFS Sanpshot
    Click the above link. It works with OMV6 as well.


    4. Install samba-vfs-modules package

    SSH to OMV as root and run:
    apt install samba-vfs-modules


    5. In OMV GUI, go to Servcies>SMB/CIFS>Shares, Select a share for enabling shadowcopy. Edit. Copy the below one of the configurations to Extra. Can’t include all type of formats, the system will either stop working or only use the last format.


    For frequent snapshots only


    vfs objects = shadow_copy2

    shadow:snapdir = .zfs/snapshot

    shadow:sort = desc

    shadow:format = zfs-auto-snap_frequent-%Y-%m-%d-%H%M


    For hourly snapshots only


    vfs objects = shadow_copy2

    shadow:snapdir = .zfs/snapshot

    shadow:sort = desc

    shadow:format = zfs-auto-snap_hourly-%Y-%m-%d-%H%M


    For weekly snapshots only


    vfs objects = shadow_copy2

    shadow:snapdir = .zfs/snapshot

    shadow:sort = desc

    shadow:format = zfs-auto-snap_weekly-%Y-%m-%d-%H%M


    For monthly snapshots only


    vfs objects = shadow_copy2

    shadow:snapdir = .zfs/snapshot

    shadow:sort = desc

    shadow:format = zfs-auto-snap_monthly-%Y-%m-%d-%H%M

    Edited 3 times, last by chente: Install ZFS Sanpshot​ edited missing link ().

  • charles.yang

    Changed the title of the thread from “Install ZFS snapshot and Enable SAMBA shadow copy ( Previous Versions ) in Windows” to “Install ZFS snapshot and Enable SAMBA shadow copy ( Previous Versions ) for Windows step by step”.
  • Thanks charles.yang, for this very useful guide. I was able to follow it and it worked for me.


    However, I am noticing that while the Previous Versions are visible for folders, they are not for files. As a workaround, I can bring up a previous version of a folder and restore the file I'm looking for. However, it would be nice if I could see the previous versions of the files. What could I be missing, or is this the intended behavior?

  • I also noticed that Windows only displays the previous versions for directories/folders. But I didn't find anyone else to complain about this and the manpage also doesn't mention this behaviour. Does anyone know if this is by design?

  • Anyone following this guide should have a look at shadow:snapprefix in order to show all snapshots and not have to hourly, daily, weekly, monthly.


    Code
    shadow:snapprefix = ^zfs-auto-snap_\(hour\)\{0,1\}\(dai\)\{0,1\}\(week\)\{0,1\}\(month\)\{0,1\}\(year\)\{0,1\}$
    shadow:delimiter = ly-
    shadow:format = ly-%Y-%m-%d-%H%M

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!