ZFS sub-Datasets (nested) not writable via SMB


Go to solution Solved by JorgeB,

Recommended Posts

Is it possible to write to nested / sub-datasets in a ZFS array disk via SMB? I chose ZFS for it (next to the parity drive), and I created a share / dataset "/media" and, below, sub-datasets "audio", "video", etc. (instead of folders). But while I can create files from Windows Explorer in the main share-dataset /media, I cannot in the sub-datasets (like in "/media/audio").

 

SMB security for all datasets is "secure", with additional write-permissions to the unraid-user (which is registered in windows and validated for the main share-datasets). But even if I change SMB security to "private" (with permissions for the Unraid user), it does not work...

 

When researching before posting, I found a thread about the ZFS plugin in 2022 stating to chmod 777 the complete dataset - But I am not sure if removal of all access control is the intended design, or just a work-around at an early stage.


I am aware that ZFS is waiting for a lot function to be implemented yet, so I wonder if I am doing it wrong, or if I have to wait for 6.13. The ZFS tutorials by Spaceinvader One to his scripts show that he actually created sub-datasets /appdata for each app - which makes sense to keep the snapshots scope small.

 

A work-around would be to create parallel shares for each type of media (which seems not appropriate, though), or to use folders below the share-dataset and have the snapshots for the whole share for now. Another approach would be to simulate an array with a pendrive and make a full RAIDz pool, but I'd rather keep the flexibility of the Unraid array.

 

I am aware the some advanced features will not work in a non-RAIDz Unraid array - So chosing ZFS for a one-disk plus parity array might seem odd. But I am really keen on the compression and snapshot features that XFS does not offer, and that should work even on a single ZFS disk (as I understand it). So even if ZFS is yet to be fully implemented, it seems to have benefits and no drawbacks I could see over XFS (for a single disk). But I might be on a completely wrong path here because I am pretty new to Unraid and ZFS.

Link to comment

@JorgeB

I used the ZFS Master plugin: Main > ZFS Master > Create Dataset. e.g. "disk1/media/audio" (I left all defaults).

Share security level "secure" was set in the share > SMB menu, with Read/Write user access to my main user.

 

I had already deleted the datasets and created folders, but I reverted that for research here:

root@NAS:~# ls -la /mnt/user/media
total 12
drwxrwxrwx 1 nobody users 4 Mar  5 14:32 ./
drwxrwxrwx 1 nobody users 9 Mar  3 12:09 ../
drwxr-xr-x 1 nobody users 2 Mar  5 14:31 audio/
drwxr-xr-x 1 nobody users 2 Mar  5 14:32 video/

Looking at the owner "nobody" and the permission pattern, I start to wonder how one should specify write access other than chmod 777, actually - as Unraid does not seem to use permission groups to assign to users. The share has chmod 777, so it actually might be that the sub-datasets probably need that, too, then... So Unraid seems to manage permissions with a different mechanism, obviously...?

Link to comment

Solution: It works, even with chmod -R 775 - I realized that "users" is the GID and tried that. So Unraid does support user groups (sorry for the misinterpretation - The post I had that from was in 2018...).

 

I do not know why shares are 777, and why newly created sub-datasets do not inherit the permissions of the share. But that seems to be how Unraid does things.

  • Like 1
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.

Guest
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.