SOLVED Have to use Unix storage, would like to share over SMB

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
Hi all,

I'm quite new to FreeNAS and I'm trying out a few things before I start migrating away from "two big disks stuffed in my desktop".

I've been trying out the Syncthing plugin and had some problems with permissions/ACLs (see here) Long story short, Syncthing needs to be able to chmod files, which means my sync dataset has to be of Unix variety. I've actually created a small hierarchy of "backup" datasets here:
Code:
/mnt/master
    /backup
      /sync
         /bozho


The idea is that there will be other types of backups in the future, and that Syncthing will have its own dataset with child datasets for each user (please let me know if this is exceedingly dumb idea :)

All three datasets (backup, sync and bozho) have Unix permissions and group ownership set to the backup group:
Code:
[bozho@freenas /]$ ls -al /mnt/master/backup/
total 10
drwxrwxr-x  3 root  backup  3 Jan  3 18:04 .
drwxr-xr-x  7 root  wheel   7 Jan  3 18:03 ..
drwxrwxr-x  3 root  backup  3 Jan  3 18:04 sync

[bozho@freenas /]$ ls -al /mnt/master/backup/sync/
total 2
drwxrwxr-x  3 root   backup  3 Jan  3 18:04 .
drwxrwxr-x  3 root   backup  3 Jan  3 18:04 ..
drwxrwxr-x  4 bozho  backup  4 Jan  3 18:07 bozho

[bozho@freenas /]$ ls -al /mnt/master/backup/sync/bozho/
total 42
drwxrwxr-x   4 bozho  backup    4 Jan  3 18:07 .
drwxrwxr-x   3 root   backup    3 Jan  3 18:04 ..
drwxr-xr-x  55 983    backup  116 Jan  3 18:13 documents
drwxr-xr-x   7 983    backup   14 Jan  3 18:15 phone_photos


All of this works fine. I've created a backup group inside the Syncthing jail with the same GID and added the syncthing user to it and Syncthing happily syncs with my Win10 laptop.

Then, I wanted to test the scenario for sharing this with a Windows machine. Reading about NFS shares, they seem a bit of a faff on Windows. So, I wanted to try sharing the backup dataset over SMB. I promise I tried searching for an answer, I couldn't find a good one.

As soon as I added the backup SMB share, that dataset's permissions got converted to ACLs and permissions type is shown as Windows in the GUI. sync and bozho datasets still show up as having Unix permissions, but lsing seems to show they got converted to ACLs (there's a + in file/directory permissions) and all files are owned by root:backup (originally, the bozho dataset was owned by bozho:backup.

I can connect to the share just fine from Windows (although I was having some problems yesterday on a previous iteration of this test), but Syncthing cannot chmod the files anymore.


TL;DR: If I have to have a Unix dataset and would like to share it to a Windows client, is NFS really my only option, or is there a way to create an SMB share that won't mess up my dataset Unix permissions?

Thank you!
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Just create your share and don't switch it to windows permissions. This is how I have every single one of my shares configured.
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
Just create your share and don't switch it to windows permissions.

The shared dataset gets its permissions switched to Windows permissions automatically when creating an SMB share, it would seem. This is on FreeeNAS 11.2
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Even when you uncheck the default permissions box?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@bozho Don't set default perms on a SMB share when you want UNIX perms. Did you not notice this warning message?

share_warn.jpeg
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
@KrisBee I've tried creating an SMB share for a Unix dataset both in basic and advanced mode and didn't get the permissions warning. In both cases permissions on the test dataset got silently switched to Windows...
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@bozho It worked, or it didn't ? I cannot reproduce your error. Make sure you selecte the correct ACL type on your dataset.

share_acl.jpeg
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
@KrisBee, sorry. It does work if I uncheck "Default Permissions" when creating a share, but I don't get the warning you posted if I don't.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@KrisBee, sorry. It does work if I uncheck "Default Permissions" when creating a share, but I don't get the warning you posted if I don't.
Then it's working as expected and there is no error.
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
It is working, but it would be nice to get a warning if you don't uncheck it (the warning screenshot you posted above). Mind you, I'm on 11.2-U1 and from your signature, I assume you're 11.1-U5
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
It is working, but it would be nice to get a warning if you don't uncheck it (the warning screenshot you posted above). Mind you, I'm on 11.2-U1 and from your signature, I assume you're 11.1-U5

Wrong assumption - tested on 11.2-U1.
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
@KrisBee you get that warning when creating a new SMB share from a Unix dataset with the "Default Permissions" checkbox checked? I do not.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@KrisBee you get that warning when creating a new SMB share from a Unix dataset with the "Default Permissions" checkbox checked? I do not.
I get that, but I can't reproduce that error on more than one test install. If you think it's a bug, then report at ixystems redmine.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I get that, but I can't reproduce that error on more than one test install. If you think it's a bug, then report at ixystems redmine.
I couldn't reproduce the problem either. It does not seem like a share switched the dataset to windows permissions mode under 11.2.
 
Top