Shadow copies visibility in Windows and dataset settings

Anoecto

Cadet
Joined
Jan 15, 2024
Messages
2
Hello all,

I wanted to make this post about an issue I was having in TrueNAS. I don't know if this is a bug or expected but the version I'm on currently is 13.0-U6.1.

I have 4 pools, each pool has it's on SMB share, today I noticed all but 1 I could see previous versions of folders within Windows explorer. I started doing some searching on the forums, some talked about stopping/starting SMB service, re-creating the periodic snapshot task, disabling "enable shadow copies" on the SMB share and stopping/starting SMB services, none of that solved my issue. Because 3 of my other SMB shares were on different datasets and all their SMB share settings/ACL permissions all looked the same for the most part, I then started comparing each dataset and found a difference! So in the 3 datasets with SMB shares that were showing me previous versions in Windows, they all had the "Snapshot directory" set to Invisible but the one that wasn't showing me shadow copies in Windows previous versions had its set to "Visible", so I changed it to "Invisible" then stopped and started SMB and viola, I can now see the shadow copies in Windows previous versions.

So if you have "Enable Shadow Copies" enabled on your (Windows Shares (SMB) in TrueNAS and still can't see previous versions in Windows, then check your dataset and see what "Snapshot Directory" is set to, because it apparently needs to be set to "Invisible", this may be by design and I just never noticed it before

2024-02-03 06_39_41-TrueNAS - myfreenas.local.png


Just wanted to put this out there in case anyone had the same issue I had because I didn't find any posts about this specific switch as being the cause.

Cheers!
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
@anodos this is a curious one. Is this intentional?
 

beagle

Explorer
Joined
Jun 15, 2020
Messages
91
It seems this is intentional:
https://www.truenas.com/community/threads/no-access-to-snapshot-folder-zfs.100976/post-696964
anodos: Yes, I'm familiar with how this area of code works. In case of POSIX1E ACL code path samba synthesizes a generic NT security descriptor based POSIX mode. Similar logic isn't present in NFSv4 code, and so I'm adding for 22.02.2. I will also add logic to disable shadow copies automatically (and maybe generate alert) if ZFS snapdir is visible over SMB since the two options are somewhat incompatible.
 
Top