[SOLVED] NFS file creation permissions

Discussion about using NAS on Linux and Unix OS.
Post Reply
André HJ
New here
Posts: 2
Joined: Wed Nov 13, 2019 3:36 am

[SOLVED] NFS file creation permissions

Post by André HJ » Wed Nov 13, 2019 5:26 am

I have a problem with file permissions on files created directly in NFS volumes on my QNAP NAS: they always get 660 rather than going through the current umask.

Example:

Code: Select all

$ for UMASK in 0000 0002 0022 0222; do umask $UMASK; touch on_{local,centos,qnap}/test_$UMASK; done; umask 0022
$ l on_*/test*
-rw-rw-rw-  1 andrej andrej 0 Nov 12 20:24 on_centos/test_0000
-rw-rw-r--  1 andrej andrej 0 Nov 12 20:24 on_centos/test_0002
-rw-r--r--  1 andrej andrej 0 Nov 12 20:24 on_centos/test_0022
-r--r--r--  1 andrej andrej 0 Nov 12 20:24 on_centos/test_0222
-rw-rw-rw-  1 andrej andrej 0 Nov 12 20:24 on_local/test_0000
-rw-rw-r--  1 andrej andrej 0 Nov 12 20:24 on_local/test_0002
-rw-r--r--  1 andrej andrej 0 Nov 12 20:24 on_local/test_0022
-r--r--r--  1 andrej andrej 0 Nov 12 20:24 on_local/test_0222
-rw-rw----+ 1 andrej andrej 0 Nov 12 20:24 on_qnap/test_0000
-rw-rw----+ 1 andrej andrej 0 Nov 12 20:24 on_qnap/test_0002
-rw-rw----+ 1 andrej andrej 0 Nov 12 20:24 on_qnap/test_0022
-rw-rw----+ 1 andrej andrej 0 Nov 12 20:24 on_qnap/test_0222
$ df -h on_local/; df -h on_centos/; df -h on_qnap/
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/argonath-home  168G   44G  116G  28% /home
Filesystem      Size  Used Avail Use% Mounted on
sorontil:/home  640G  4.5G  635G   1% /net/sorontil/home
Filesystem      Size  Used Avail Use% Mounted on
anduin:/Public  1.6T   98G  1.5T   7% /net/anduin/Public
This is highly annoying, and causes problems for several of my use cases. It seems to break hosting Git repositories on the NFS volumes, for instance.
I've tried numerous Linux distributions as NFS clients (including Fedora, CentOS, Debian and Enigma), all with the same result.

I contacted QNAP support about this a year and a half ago, and got the response that this is not supported.
(This is on a QNAP TS-431P2, current firmware is QTS 4.4.1 but this was the same on 4.3.x.)


Any ideas on how this breakage can be fixed or circumvented? I use my QNAP for NFS shares only, so breaking support for most other features is acceptable.
Last edited by André HJ on Sat Nov 16, 2019 4:59 am, edited 1 time in total.

André HJ
New here
Posts: 2
Joined: Wed Nov 13, 2019 3:36 am

Re: NFS file creation permissions

Post by André HJ » Sat Nov 16, 2019 4:57 am

André HJ wrote:
Wed Nov 13, 2019 5:26 am
I have a problem with file permissions on files created directly in NFS volumes on my QNAP NAS: they always get 660 rather than going through the current umask.
...
Any ideas on how this breakage can be fixed or circumvented? I use my QNAP for NFS shares only, so breaking support for most other features is acceptable.
I think I've finally found a working solution for this. Turns out we have a QNAP NAS at work where this is working, so I've compared option differences and found the one that matters: the option Shared Folders -> Advanced Permissions -> Enable Advanced Folder Permissions has to be turned off (!). Doing that - and fixing permissions on all folders and files afterwards (since toggling that option really screws things up) seems to fix the problem.

My QNAP finally works as a NAS now 8)

xFrAx
New here
Posts: 2
Joined: Mon Oct 21, 2019 4:08 pm

Re: [SOLVED] NFS file creation permissions

Post by xFrAx » Mon Mar 30, 2020 7:00 pm

I was going mad with this issue as well! Didn't even find this googling for ages, luckily bumped into this before posting a new thread...awesome dude, thank you very much.

Post Reply

Return to “Linux & Unix (NFS)”