NytoxRex Posted March 18, 2022 Share Posted March 18, 2022 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 (https://forum.level1techs.com/t/zfs-on-unraid-lets-do-it-bonus-shadowcopy-setup-guide-project/148764) 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="https://imgbb.com/"><img src="https://i.ibb.co/hBg6q7C/shadow.jpg" alt="shadow" border="0"></a> <a href="https://ibb.co/X7GYfNP"><img src="https://i.ibb.co/D9jrPsF/smbconfig.png" alt="smbconfig" border="0"></a> <a href="https://imgbb.com/"><img src="https://i.ibb.co/9nVnfsh/snaps.png" alt="snaps" border="0"></a> Quote Link to comment
gyto6 Posted April 23, 2022 Share Posted April 23, 2022 (edited) Hi, First, check the time format there. https://www.samba.org/samba/docs/current/man-html/vfs_shadow_copy2.8.html Are you sure that your time format is correct? Seconds in the begining of names sounds weird to me. Second, I needed to add the attributes "Write lists" and "Valid users" to get my Snapshots Up in the share. Edited April 23, 2022 by gyto6 Quote Link to comment
SimonF Posted April 23, 2022 Share Posted April 23, 2022 On 3/18/2022 at 5:19 PM, NytoxRex said: The images: Does "cat /etc/samba/smb-shares.conf" for nino have the correct settings? as this is the file samba will be using. Quote Link to comment
NytoxRex Posted June 23, 2022 Author Share Posted June 23, 2022 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. Quote Link to comment
NytoxRex Posted June 23, 2022 Author Share Posted June 23, 2022 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. Quote Link to comment
NytoxRex Posted June 23, 2022 Author Share Posted June 23, 2022 (edited) I think the -u flag in this line in the zfs-auto-snapshot.sh 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: Quote [nino] 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 June 23, 2022 by NytoxRex Quote Link to comment
NytoxRex Posted June 23, 2022 Author Share Posted June 23, 2022 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. Quote Link to comment
NytoxRex Posted June 23, 2022 Author Share Posted June 23, 2022 Added the -r flag, as found in the link on the second entry of this thread. Still no luck getting the subfolders/files to have previous versions capabilities. I would like some help here, thanks! Quote Link to comment
NytoxRex Posted June 23, 2022 Author Share Posted June 23, 2022 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! Quote Link to comment
NytoxRex Posted June 23, 2022 Author Share Posted June 23, 2022 Great! I found the solution and it's working almost perfectly now! I just had to add the line Quote 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! Quote Link to comment
gyto6 Posted June 26, 2022 Share Posted June 26, 2022 Indeed, your ZFS snapshots can't be directly used on a file instead of passing through the Folder GUI. I'm not stating that it's impossible, I'm looking what can be done. Quote Link to comment
gyto6 Posted June 26, 2022 Share Posted June 26, 2022 (edited) @NytoxRex 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: [Documents] 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 June 26, 2022 by gyto6 Quote Link to comment
NytoxRex Posted July 21, 2022 Author Share Posted July 21, 2022 Oh I see now, indeed the file needs to be changed, otherwise it will not show up. Thanks all for the help! Quote Link to comment
jURRu12 Posted December 16, 2022 Share Posted December 16, 2022 (edited) Hi I tried to install the script zfs-auto-snapshot from github but i get error by enter the command git merge origin/leecallen Also the command editor is unknow. I started with unraid and linux experience, so i need some aedvise how can i solve this. Thanks Cheers Edited December 16, 2022 by jURRu12 Quote Link to comment
Recommended Posts
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.