How does NFS manage persissions for shares

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
JowiKrause
Level 1
Level 1
Posts: 39
Joined: Wed Aug 22, 2018 4:29 am

How does NFS manage persissions for shares

Post by JowiKrause »

Hi!
I have an issue with mounting external NAS shares which has me puzzled:
Situation: Desktop computer with recently installed Mint 19 Cinnamon. Additionally installed: NFS support. On my LAN I have 2TB WDMyCloud NAS, with 2 disks attached via USB, one has 2TB, one has 500GB. In the UI of the WDMyCloud I have activated public access for all shares (I do not plan to open access via internet), plus FTP and NFS. DLNA is also activated, iTunes is deactivated.
I want to permanently mount these three disks by NFS, using the FSTAB. (I had it working under Mint 18.3 KDE.)
So I set up the 3 mount points in a separate folder eg /home/NFS. (I also tried other locations, like /user/media.) All the mount folders were set up with the same ownership and permission details.
Then I added the three corresponding lines to my FSAB. The look like this:
# mount NAS Jowi at start
192.168.1.125:/nfs/xxxx /home/NFS/NASxxxx nfs defaults 0 0
The other 2 shares same with the correct path descriptions.
Now the issues:
2 of the 3 shares are mounted without any problems, the third is not mounted. Error when doing manual mount by mount -a is ¨mount.nfs: access denied by server while mounting 192.168.1.125:/nfs/2TBDisk¨.
When I try to access the share via file manager - network, all three shares are accessible, but only under AFS file system protocol, which makes no sense. I do not have a Mac, I do not want to use this file system and in the WDMyCloud I have found no way to activate or deactivate it. AFS has restrictions which make it useless for me (eg: file transfers stop at 1.2 GB plus it's slow)
But how can 3 shares that have been set up the same way behave differently?
The second observation: When I check the permissions of the 3 mount point folder again after restart, I find the changed. The owner is different (one is called 500 - user #500, the two other are owned by root , while I set up all three with my user as owner. Of course the permissions correspond to this.) For the 2 share mount folders that mount the shares (with different ownerships, but both working) I cannot change the ownership even when I access as root. The third share mounting folder can be changed. But that does not cause it to work, access remains denied.
Is it possible that the NFS mounting procedure actually changes the permissions for the mount point? Why does that work for 2 shares and not the third?
Most important: What can I do to solve this problem?
I have connected the disk to my computer directly and tried to change ownership and permissions. But that also does not change anything.
I might add that up to now I have no experience in ssh access to the NAS, and no idea about using Putty.
Thanks for any light shed on these issues.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Linux Mint 21 Cinnamon 64bit on Desktop, Linux Mint 18.3KDE on Laptop. Happy user since 2010, but occasional problems still occur...
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How does NFS manage persissions for shares

Post by catweazel »

JowiKrause wrote: Sat Aug 25, 2018 5:06 am 2 of the 3 shares are mounted without any problems, the third is not mounted. Error when doing manual mount by mount -a is

¨mount.nfs: access denied by server while mounting 192.168.1.125:/nfs/2TBDisk¨.

Code: Select all

sudo chown nobody:nogroup /mount/point
You might try that on the server, then on the client:

Code: Select all

usermod -a -G nogroup $USER
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How does NFS manage persissions for shares

Post by catweazel »

As an afterthought, I can post the notes I use to set up NFS if you think that might help.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
JowiKrause
Level 1
Level 1
Posts: 39
Joined: Wed Aug 22, 2018 4:29 am

Re: How does NFS manage persissions for shares

Post by JowiKrause »

Hi and thanks for responding so quickly.
I tried the first change (>nobody:nogroup) for this mount point, did not improve anything.
Re the second option: I have no idea, how I can change things on the server. I am not even sure what IS my server: The NAS or the USB-attached disk. As the 3 disks somehow behave differently, I have a feeling that the problem is in the configuration of these disks But I am sure the problem disk has no operation system, so there can be no server.
Re your notes: Sure, could be helpful, although I have set up two NFS shares perfectly well. The third one has issues, and they could be associated with NFS managing the access permissions and ownerships - which I am not aware of an know nothing about...
Or with the NAS OS and what it does when processing NFS?
Or the configuration of the disk?
Too many questions, too many options...
Linux Mint 21 Cinnamon 64bit on Desktop, Linux Mint 18.3KDE on Laptop. Happy user since 2010, but occasional problems still occur...
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How does NFS manage persissions for shares

Post by catweazel »

JowiKrause wrote: Sat Aug 25, 2018 5:42 am I am not even sure what IS my server: The NAS or the USB-attached disk.
The server is more than likely running linux. Anyway, here are my notes. You'll maybe only need to change the mount points, IP and the UUID. While typing this, I realised I'd neglected to tell you to run chown nobody:nogroup /mount/point on the server, assuming it's linux. Try that first.

On the server (192.168.20.100):

Code: Select all

    sudo su
    apt update
    apt install nfs-kernel-server nfs-common
    mkdir /mount/point
    chown nobody:nogroup /mount/point
    nano -w /etc/fstab
        UUID=3d908b27-e8a0-4773-b4c4-973b807e149f /mount/point ext4 defaults,rw 0   0
    mount -a
    usermod -a -G nogroup $USER
    nano /etc/exports
        /mount/point 192.168.20.100(rw,sync,no_subtree_check)
    mount -a
    systemctl restart nfs-kernel-server
    ufw allow from 192.168.20.101 to any port nfs
    ufw status
    exit
On the client (192.168.20.101):

Code: Select all

    sudo su
    apt update
    apt install nfs-kernel-server nfs-common
    mkdir /mount/point
    chown nobody:nogroup /mount/point
    usermod -a -G nogroup $USER
    systemctl restart nfs-kernel-server
    showmount -e 192.168.20.100
    mount -o vers=3 192.168.20.100:/server-mount/point /client-mount/point
    exit
https://www.digitalocean.com/community/ ... untu-16-04

While not about NAS, it is a good reference for NFS.

Good luck. Unfortunately I can't offer anything more.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
JowiKrause
Level 1
Level 1
Posts: 39
Joined: Wed Aug 22, 2018 4:29 am

Re: How does NFS manage persissions for shares

Post by JowiKrause »

Well... I have ssh accessed the NAS and tried your
chown nobody:nogroup /mount/point
input for server mountpoint I know.
Response:
unknown user/group nobody:nogroup
:( :( :(
Linux Mint 21 Cinnamon 64bit on Desktop, Linux Mint 18.3KDE on Laptop. Happy user since 2010, but occasional problems still occur...
JowiKrause
Level 1
Level 1
Posts: 39
Joined: Wed Aug 22, 2018 4:29 am

Re: How does NFS manage persissions for shares

Post by JowiKrause »

OMG - I was so stupid! :oops: :oops: :oops:
I just looked at my NAS once more, and was surprised to see that it had assigned some generic name to the share which I had called 2TBDisk.
The entry in the fstab was thus obviously pointing to a share that did not exist. No issue of permissions and what have you! I am so sorry to have wasted your time with all this. Very simple mistake on my side!
As soon as I corrected that, ie made the name of the NAS share and the reference in the fstab congruent again, everything was fine.
Lesson learnt: Do not fidget around at code level before making sure that the basics are right.
(Although of course my initial question about AFS is still open :wink: )
How this renaming in the NAS, which was not my doing, could happen? No idea! Perhaps the name gets reassigned after disconnection and reconnection? I live in southern Greece, we have lots of thunderstorms with lots of power failures ... to avoid damage by lightning (in 4 years I have been through 8 routers) I disconnect the whole computer system as soon as thunder starts rumbling. Possibly that was the reason.
Sorry and thanks again!
Linux Mint 21 Cinnamon 64bit on Desktop, Linux Mint 18.3KDE on Laptop. Happy user since 2010, but occasional problems still occur...
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How does NFS manage persissions for shares

Post by catweazel »

JowiKrause wrote: Sat Aug 25, 2018 7:13 am I am so sorry to have wasted your time with all this.
Sorry and thanks again!
No need to apologise, and you're welcome. We all learned something :) so it wasn't a waste of time at all.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Networking”