NFS mount mystery

Hi there,

Short and stupid question, I try to mount a nfs share on my PC from a WD NAS (PR4100) and I face a mystery:

/etc/fstab:

172.26.155.4:/nfs/Test /mnt/NAS/test nfs defaults 0 0

and

sudo mount -a                                                                                                                                                                                                  ✔ 
mount.nfs: access denied by server while mounting 172.26.155.4:/nfs/test

but

sudo mount -t nfs 172.26.155.4:/nfs/Test /mnt/NAS/test

works

And to be complete, on the same machine, I use another share from same PR4100, mounted from fstab with

172.26.155.4:/nfs/Plex /mnt/NAS/plex nfs defaults 0 0

/etc/exports on the PR4100 is

"/nfs/Plex" *(rw,all_squash,sync,no_wdelay,insecure_locks,insecure,no_subtree_check,anonuid=501,anongid=1000)
"/nfs/Test" *(ro,all_squash,sync,no_wdelay,insecure_locks,insecure,no_subtree_check,anonuid=501,anongid=1000)

Does someone see where my error is ?

Thanks

Maybe a silly comment, but…


…but the one T is capital and the other is not. Why that?

Whereas, when you mount it directly, you use a capital T and it works…

If you give in the terminal
sudo mount /mnt/NAS/test
does it get mounted correctly or do you get an error message?

3 Likes

I may be wrong - but I am not sure wildcard is an accepted access policy - in any case it is a recipe for data loss.

[root tip] [How To] Share data using NFS

2 Likes

Good catch. :+1:

@Narsil, UNIX is case-sensitive. That’s why it failed. You have to correct the entry in your /etc/fstab.

:rofl: :rofl: :rofl: :joy:

I new I was stupid ! Thanks @tsapi

@linux-aarhus It works with wildcard, but it’s probably more “orthodox” to have a subnet here, thanks

@Aragorn talking to @Narsil, that’s how all begings my Lord :crown:

But now I have a new problem: from the client, I can create a file or directory in /mnt/test, but I can’t create anything under this point :cry:

1 Like

And I’ve (literally) got Anduril laying on the couch in my living room. :stuck_out_tongue:

(It was a gift from a couple of friends. :wink:)

I’m not an expert on nfs, but you’ve exported it as read-only, and with all_squash. :man_shrugging:

Unfortunately, the elfes haven’t re-shaped me yet :frowning:

It’s exported RW, but the problem is not there : I can create anything at any point using CLI, but not using Dolphin … really don’t get it

Have you logged out and back in? It could be a caching issue.

Nope, persistent to reboot.

Can you please be more detailed? You can create files and directories inside /mnt/NAS/test/ in the terminal but not with dolphin?
With what user can you do that in the terminal? Root or your plain user or maybe with sudo?
What error message do you get in dolphin when trying to create a file / directory inside /mnt/NAS/test/?
Inside dolphin when you right click on the space inside /mnt/NAS/test/ and press Properties, what Permissions (there is tab Permisions in the Property windows) do you see and what user is the owner?
If you run dolphin as root, can you create files / dirs inside /mnt/NAS/test/ ?
In the terminal can you please tell us what permissions you see when you ls -la a file / dir inside /mnt/NAS/test/ ?

I use CLI with the same user as Dolphin.

Using Dolphin, I can create and copy directories and files to /mnt/NAS/test, but nothing under this (can’t create subdirectories, nor copy or create files inside the “second” level. No error message for this, only the “red circle” alongside the cursor when I try to drag-drop a file or directory

On level /mnt/NAS/test, Dolphin shows root as proprietary, and RW for all, that’s coherent with owner and rights seen in CLI.

dolphin --sudo doesn’t allow to write inside /mnt/NAS/test/Level1, Dolphin shows user and group from NFS server side: user “501” (which is the user “nobody”), and mod 744.

Using CLI, I can create and copy directories, subdirectories, files from and to anywhere.

In Dolphin. if I change the rights of the directory to 754, I can create a subdir, but it is created with 744 and I have to change the rights manually to go further.

Is gvfs-nfs installed and enabled?

pacman -Qi gvfs-nfs

As I recall it - when exporting nfs4 - you need to export the root and subfolders as described in the sample exports file

Manjaro defaults to use nfs4 so if your service is exporting nfs3 you will need to tell the client to use nfs3

# Example for NFSv4:
#  /srv/nfs4        hostname1(rw,sync,fsid=0)
#  /srv/nfs4/home   hostname1(rw,sync,nohide)

In your case it translates to

/nfs *(rw,sync,fsid=0)
/nfs/Plex *(rw,all_squash,sync,no_wdelay,insecure_locks,insecure,no_subtree_check,anonuid=501,anongid=1000)
/nfs/Test *(ro,all_squash,sync,no_wdelay,insecure_locks,insecure,no_subtree_check,anonuid=501,anongid=1000)

Your Test folder is mounted readonly and the Plex folder is mound readwrite

1 Like

That’s a very good move @linux-aarhus, the PR4100 exports nfs3

rpcinfo -p 172.26.155.4 | grep nfs                                                                                   
    100003    3   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl
    100003    3   udp   2049  nfs
    100227    3   udp   2049  nfs_acl

Exports on my PR4100 (server side) is now this:

"/nfs/Plex" 172.26.155.0/24(rw,all_squash,sync,no_wdelay,insecure_locks,insecure,no_subtree_check,anonuid=501,anongid=1000)
"/nfs/Test" 172.26.155.0/24(rw,all_squash,sync,no_wdelay,insecure_locks,insecure,no_subtree_check,anonuid=501,anongid=1000)

And I added nfsvers=3 in the client a side fstab:

172.26.155.4:/nfs/Test /mnt/NAS/test nfs nfsvers=3 0 0

But well, the problem remains

The still strange thing is that I can do what I want using CLI, but not using Dolphin:

Operation CLI Dolphin
Create a file at level /mnt/NAS/test Allowed Allowed
Create a subdirectory “level1” at level /mnt/NAS/test Allowed Allowed
Create a subdirectory “level2” at level /mnt/NAS/test/level1 Allowed Not allowed
Create a file or subdirectory in /mnt/NAS/test/level1/level2 Allowed Not allowed

I absolutely don’t know what this is, but yes, it’s instaled

Good to know that it’s installed and working.

gvfs-nfs allows one to use NFS via Dolphin; much as gvfs-smb does for SAMBA.

Neither of these will happen automatically, until you have first created a new network location. I believe this is essentially the same for either SMB or NFS to access a network location via Dolphin.

Open Dolphin, and go to RemoteNetwork (in the side bar). Then, in the main window (near the top) you should see Add Network Folder. Click this, and use the resulting dialog to create your network location.

When finished, your new location should appear under Remote (next to Network).

All being well (and if your configuration is correct), you should then have access from Dolphin.

Note: This presumes you use KDE. If using another DE, the procedure will no doubt be different.