I am trying to mount Shared Folder from my QNAP TS230 via Samba on my Linux in a way that I will preserve file permissions.
I am focused on two scenarios:
- files rsync-ed to QNAP's share (that after I ssh and ls -l has permissions as expected) will be seen with same permissions after mounting share via samba
- chmod operations on files mounted through Samba will be respected
I found out that if one set /etc/config/smb.conf to
Code: Select all
unix extensions = yes
I am experimenting with cifsacl now. I think I wasted at least couple of evenings and cannot really get it to work the way I want.
I am mounting my share with
Code: Select all
$ sudo mount -t cifs -o credentials=/etc/smb-credentials,uid=1000,gid=1000,intr,hard,cifsacl //doctor-chaos.local/admin-land/ /mnt
Code: Select all
$ mount -t cifs
//doctor-chaos.local/admin-land/ on /mnt type cifs (rw,relatime,vers=3.1.1,cache=strict,username=rskolasinski,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.230,file_mode=0755,dir_mode=0755,hard,nounix,serverino,mapposix,cifsacl,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)
- most of modes I set with chmod after ssh-ing to QNAP I see right through Samba: exception is the x bit that if set for others on QNAP via samba I see it set for all user, group and others
- when I chmod on files mounted via samba I always get r bit for user no matter what I set and also on QNAP it always get set rwx for group.
Config notes:
QNAP UI: Shared Folders -> Advanced Permissions -> Enable Advanced Folder Permissions (enabled); Windows ACL disabled.
QNAP smb.conf: set inherit permissions = no for admin-land share
I have the feeling it must be something connected with ACL but cannot figure out what to set. Tried to remove all ACL settings using `setfactl -b /share/admin-land/` but with no effect.