TrueNAS-SCALE-23.10.1.3 Shadow Copies not work on SMB shares

ADENNEDA

Cadet
Joined
Feb 15, 2024
Messages
4
Hello!

Cant access any user to .zfs folder and Previous Version in Windows 10.

testparm -s


[pub]
ea support = No
guest ok = Yes
path = /mnt/ALLDISKS/public
posix locking = No
read only = No
smbd max xattr size = 2097152
vfs objects = zfs_fsrvp fruit streams_xattr shadow_copy_zfs ixnas recycle zfs_core io_uring
recycle:repository = .recycle/%D/%U
fruit:time machine = False
tn:vuid = 654f11c8-9c57-4c41-85fe-f878452e76ef
fruit:time machine max size = 0
fruit:resource = stream
fruit:metadata = stream
nfs4:chown = True
recycle:subdir_mode = 0700
recycle:directory_mode = 0777
recycle:touch = True
recycle:versions = True
recycle:keeptree = True
tn:home = False
tn:path_suffix =
tn:purpose = NO_PRESET


1. Didn't see any "shadow: snapdir" params...
2. Why "vsf objects" are "shadow_copy_zfs"? Samba docs says, what vfs objects need "shadow_copy2"...

zfs list -t snap


...
ALLDISKS/public@fss-2023-05-04_12-41 136K - 232K -
ALLDISKS/public@fss-2023-05-04_12-47 192K - 288K -
ALLDISKS/public@auto-2024-02-12_16-19 272K - 57.8G -
ALLDISKS/public@auto-2024-02-12_16-20 304K - 57.8G -
ALLDISKS/public@auto-2024-02-13_14-47 0B - 57.8G -
ALLDISKS/public@fss-2024-02-13_14-46 0B - 57.8G -
...


zfs get snapdir


...
ALLDISKS/public snapdir visible local
ALLDISKS/public@fss-2023-05-04_12-41 snapdir - -
ALLDISKS/public@fss-2023-05-04_12-47 snapdir - -
ALLDISKS/public@auto-2024-02-12_16-19 snapdir - -
ALLDISKS/public@auto-2024-02-12_16-20 snapdir - -
ALLDISKS/public@auto-2024-02-13_14-47 snapdir - -
ALLDISKS/public@fss-2024-02-13_14-46 snapdir - -
...


As you can see snapdir is visible. But in Windows and Linux client I can't open .zfs folder (also from root user) and Windows 10 "Previous version" list is empty.
Need help...
 

ADENNEDA

Cadet
Joined
Feb 15, 2024
Messages
4
You have enabled fsrvp feature. This will only present snapshots created via FSRVP clients.
As you can see I have fss-* tag on snapshot - and windows didnt see it...

fsrvp was enables for test....

Other share without fsrvp...

testparm -s
[OTK]
access based share enum = Yes
ea support = No
guest ok = Yes
kernel oplocks = Yes
path = /mnt/ALLDISKS/OTK
read only = No
smbd max xattr size = 2097152
vfs objects = fruit streams_xattr shadow_copy_zfs ixnas recycle zfs_core io_uring
fruit:time machine = False
tn:purpose = MULTI_PROTOCOL_NFS
tn:vuid = 3b35b7fb-b5c8-4c35-a463-55b5d013d235
recycle:subdir_mode = 0700
recycle:versions = True
recycle:keeptree = True
recycle:touch = True
recycle:repository = .recycle/%D/%U
recycle:directory_mode = 0777
tn:path_suffix =
fruit:resource = stream
fruit:metadata = stream
fruit:time machine max size = 0
tn:home = False
nfs4:chown = True

Didn't work too...

zfs get snapdir

ALLDISKS/OTK snapdir visible local
ALLDISKS/OTK@auto-2024-02-15_14-28 snapdir - -
ALLDISKS/OTK@auto-2024-02-15_14-30 snapdir - -
 
Joined
Feb 19, 2024
Messages
1
Hello everyone

I have the same issue as Adenneda.

I created a dataset "bs2-poc" which is shared over smb. I set "Snapshot directory" to visible and I can see the .zfs directory in my smb share.
I can access the .zfs and .zfs\snapshot\ directories when connecting via ssh, but not via the smb share. I use the same account for both. For smb, I receive the error "the request is not supported". Also, there are no entries shown in the "previous versions" tab in the windows file explorer.

If I create a symlink to .\zfs\snapshot\manual-2024-02-19_12-18\ I can access the sub directory in the smb share.

Is this a permissions issue?

Any help is highly appreciated!
 

ADENNEDA

Cadet
Joined
Feb 15, 2024
Messages
4
Hello everyone

I have the same issue as Adenneda.

I created a dataset "bs2-poc" which is shared over smb. I set "Snapshot directory" to visible and I can see the .zfs directory in my smb share.
I can access the .zfs and .zfs\snapshot\ directories when connecting via ssh, but not via the smb share. I use the same account for both. For smb, I receive the error "the request is not supported". Also, there are no entries shown in the "previous versions" tab in the windows file explorer.

If I create a symlink to .\zfs\snapshot\manual-2024-02-19_12-18\ I can access the sub directory in the smb share.

Is this a permissions issue?

Any help is highly appreciated!
I think what it's a permission issue, but I'll tryed to change permissions for .zfs folder to 0777 or 0755 - did't help.
Also I'll tryed to connect to SMB share by root user (or any @owner user) - anyway, I'll get same error as you.

I think what TrueNAS Scale does not allow windows to zfs folder, because user can't access to revert snapshot. But documentation says what windows user have readonly access to "Previous versions".

Bug? Or feature?
 

beagle

Explorer
Joined
Jun 15, 2020
Messages
91
@anodos is the expert, but based on what I can understand from his previous post shadow copies and ZFS snapdir visible are incompatible if you use NFSv4 ACL:

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.
 

ADENNEDA

Cadet
Joined
Feb 15, 2024
Messages
4
@anodos is the expert, but based on what I can understand from his previous post shadow copies and ZFS snapdir visible are incompatible if you use NFSv4 ACL:
WOW...

Man! Thank you!!!

Ok. What I have now:

1. I Set Dataset to POSIX
2. I Set Mask, Group to RWX
3. I Created SMB share to dataset

After this settings I can open .zfs folder and now I see "auto-2024-02-21_1200" folder can open it and can see any of snapshot files....

BUT... But I didn't see any snapshot in "Previous version" tab if I open "properties" of root share...

Anyway, it's 90% for resolving this problem...
 
Top