Windows 11 and ZFS Snapshot

Recommended Posts

Hello all,

I've setup a new Unraid server with a shared forlder in ZFS, but I cannot seem to get the Shadow Copy working. I followed this guide ( for my setup, with my own alterations ofcourse! I will attach some images of the file structure and config.

The shadow img shows the previous version tab in W11, for a file in my 'nino/documents/' folder. The smbconfig shows the config in the extra options of SMB settings. The snaps shown in the last image, show the files in 'nino/documents/.zfs/snapshots/'.

<a href=""><img src="" alt="shadow" border="0"></a>
<a href=""><img src="" alt="smbconfig" border="0"></a>
<a href=""><img src="" alt="snaps" border="0"></a>


Link to comment
  • 1 month later...
  • 2 months later...

Okay I've checked the "/etc/samba/smb-shares.conf" and the settings in there were incorrect. I have changed these settings, as can be seen in the image. I've removed the %S as seconds, as the 01 in the names is the 'label' attribute set to 01 in my script. I've also added the write list and valid users, all of this without any luck. I have also added the structure of the folders as an image, might be helpful.

Screenshot 2022-06-23 114324.png

Screenshot 2022-06-23 114618_struct.png

Screenshot 2022-06-23 114835_list.png

Link to comment

Quick remark, time is an issue. I just did a run of the sript again at 11:52 and the latest snapshot gives the following. The time in the unraid GUI is correct, so this is a incorrect setting of the time in the creation of the snapshots. Though, i dont exactly know where the time difference is coming from, and weather it affects the workings of previous versions in windows.


Screenshot 2022-06-23 115319_lat.png


Link to comment
Posted (edited)

I think the -u flag in this line in the script changes the time to utc, so either this script has to be changed or local time disabled in the "/etc/samba/smb-shares.conf" settings if I'm correct. (The latter has been done now the config is: 


        path = /mnt/user/nino
        comment = 
        browseable = yes
        # Private
        writeable = yes
        read list = ndreverman
        write list = ndreverman
        valid users =  ndreverman
        read only = no
        create mask = 0770
        directory mask = 0770
        vfs objects = shadow_copy2 catia fruit streams_xattr
        case sensitive = auto
        preserve case = yes
        short preserve case = yes
        shadow: snapdir = .zfs/snapshot
        shadow: sort = desc
        shadow: format = zfs-auto-snap_01-%Y-%m-%d-%H%M
        shadow: localtime = no


Edited by NytoxRex
Link to comment

Changed the path to "path = /mnt/user/nino/nino" to include the symlink, and it works now! sort of... The first image shows the directories working, which is great, but when diving into the four directories none of the files have previous versions... I wish I could have all individual files included as well, such that a single file can be restored. How is this done, seems like a simple -r (recursive) flag or something.


Link to comment

So here is the problem (likely), the snapshots generated by the deimoshdd/nino/documents is stored in deimoshdd/nino/documents/.zfs/snapshots, while the config of the share nino (mnt/user/nino/nino = deimoshdd/nino) makes it search in the given mnt/user/nino/nino/.zfs/snapshots which is equal to deimoshdd/nino/.zfs/snapshots. Of course there is nothing to find, as only the sub folders (or datasets) are flagged to use the snapshot feature.

Now I *could* make a different share for each of the folders, but I would not like to do that, I just want one folder (share) that is used for a single person.

Thus there are two options left:
1) The samba config is configured that it looks in all subfolders for the .zfs/snapshots folders.

2) The snapshots are stored in a the parent folder in its *parent*/.zfs/snapshots and not in the *parent*/documents/.zfs/snapshots


Is there a way to do either one of these? I think this is the problem. Thanks!

Link to comment

Great! I found the solution and it's working almost perfectly now! I just had to add the line 


shadow:snapdirseverywhere = yes

to the "/etc/samba/smb-shares.conf" file. Easy, i would say. The only problem left is that only folders show the previous versions tab, not files. Visible in the two pictures are a folder (with prev. vers.) and a file in that folder (missing prev. vers.). If anyone knows how to fix this and make the system perfect, let me know!



Link to comment



Did a test, and the "Previous Versions" is less dumb and display a result only if a modification is detected, else, there would be no result.


Please, share your actual config, for the others to help you proceed to diagnostic.


My own config is quite simple, but might probably help:

	path = /mnt/fastraid/Documents/
	browseable = yes
	guest ok = no
	writeable = yes
	read only = no
	create mask = 0775
	directory mask = 0775
        write list = margaux
        valid users = margaux	
        strict sync = yes
	vfs objects = shadow_copy2
        shadow: basedir = /mnt/fastraid/Documents/
	shadow: snapdir = .zfs/snapshot
	shadow: sort = desc
	shadow: format = %Y-%m-%d-%H%M%S
	shadow: localtime = yes



Edited by gyto6
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.