chmod, Windows shares, and Samba

Status
Not open for further replies.

dewarrn1

Cadet
Joined
Jul 24, 2016
Messages
3
Hi all,

I'm sharing files from a FreeNAS box (using a Windows Share) to Linux and Windows boxes. After a recent reboot, I noticed a general failure of chmod operations for the shares. All other operations seem fine, but I can't even "sudo chmod" on the shares in question when I'm SSHed into the FreeNAS box.

I found this old thread suggesting that this is working as intended:

https://forums.freenas.org/index.php?threads/cant-chmod-files-operation-not-permitted.22229/

Regardless, I (or rather scripts I depend on) need to be able to chmod files on the mounted share, and it was working fine prior to a reboot. How can I fix this? Thanks in advance!

FreeNAS-9.10-STABLE-201606270534 (dd17351)
Linux xxx 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
If the dataset is configured to windows permissions you can't use chmod. You have to use setfacl or remove the acls and switch back to UNIX permissions.

Sent from my Nexus 5X using Tapatalk
 

dewarrn1

Cadet
Joined
Jul 24, 2016
Messages
3
Unfortunately, I can't substitute setfacl for chmod, so I'll need to try the second option. Is there a concise description of how to safely remove acls and switch back to UNIX-style permissions? Many thanks.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Did you even try to look it up?

man setfacl => looks like you use the -b flag. Maybe someone who has done this can give you specifics but you can always just try it.
 

dewarrn1

Cadet
Joined
Jul 24, 2016
Messages
3
Thanks for the reply. I'm seeking input from others who might have done this already because the whole process seems more complex than one might naively assume (witness the long thread that I linked earlier). "Just trying it" on real data isn't appealing.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
If you aren't going to use windows permissions, why have the dataset set up that way? Just change the type to Unix.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
If you aren't going to use windows permissions, why have the dataset set up that way? Just change the type to Unix.
Once it's set to windows I don't think the GUI will let you switch it back to UNIX. I have never bother to try though.

Sent from my Nexus 5X using Tapatalk
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Once it's set to windows I don't think the GUI will let you switch it back to UNIX. I have never bother to try though.

Sent from my Nexus 5X using Tapatalk
I've just did this because I ran into the same issue. :smile:
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Once it's set to windows I don't think the GUI will let you switch it back to UNIX. I have never bother to try though.

Sent from my Nexus 5X using Tapatalk

I just tested through the webui. You can change permissions type from "Windows" to "Unix", but the aclmode stays "restricted" after the UI change. Bug report filed here: https://bugs.freenas.org/issues/17691
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Unfortunately, I can't substitute setfacl for chmod, so I'll need to try the second option. Is there a concise description of how to safely remove acls and switch back to UNIX-style permissions? Many thanks.

Changing to "UNIX-style" permissions can be acheived by typing zfs set aclmode=passthrough <pool>/<dataset>

Removing ACLs through the CLI can be acheived by executing a 'find -exec setfacl -b' command. You should be able to find the precise syntax by searching through the forums.
 
Status
Not open for further replies.
Top