Accessing NFS share on home server from Fedora workstation

Hi, I am trying to access an NFS share that I set up on my Unraid home server. The share is set up with NFS enabled (and samba share also).

I am finding it difficult to access the NFS share. I can’t seem to find the relevant guide in the official workstation documentation.

Can someone please point me to the correct documentation? The closest I have found is this youtube video, but it isn’t specific to fedora and misses out permissioning when accessing the NFS share.

In command line I got as far as this:


rbrown@localhost-live:~$ sudo mount 192.168.1.109:/Rob /mnt/nfs/Rob
[sudo] password for rbrown: 
mount.nfs: access denied by server while mounting 192.168.1.109:/Rob

(It would be nice if there was a simple GUI in GNOME like there is for SMB shares. it seems strange not to have NFS be a peer for file sharing).

Added nfs

Removed server

I’m not familiar with unraid, but since the error message you are seeing says “access denied by server”, I think you will need to check the server’s logs to find out why it rejected your connection.

It might be because your client’s IP address isn’t allowed. Or it might be because your client is trying to use a version of the NFS protocol that your server doesn’t accept or understand.

2 Likes

aha! I am nearly there… I found this:

section: 'Testing the Configuration)

rbrown@localhost-live:~$ showmount -e 192.168.1.109
Export list for 192.168.1.109:
/mnt/user/nextcloud *
/mnt/user/Rob       *
rbrown@localhost-live:~$ sudo mount 192.168.1.109:/mnt/user/Rob /mnt/nfs/Rob

Now the folder mounts!

However, I still cannot:

Write access. I can only read. I checked the settings in unraid, and added rw to the settings there, and added the flags in the mount

rbrown@localhost-live:~$ sudo mount 192.168.1.109:/mnt/user/Rob /mnt/nfs/Rob -w --read-write

This doesn’t change anything

How do I get this setting to persist past just this session?

OK, further digging on the interweb, this time from another source: Linux NFS Mount Entry in fstab (/etc/fstab) with Example

I managed to get the folder to persist mounting with the following entries inserted into /etc/fstab

192.168.1.109:/mnt/user/Rob /mnt/nfs/Rob  nfs rw,hard,intr,timeo=14 0 0
mount /mnt/nfs/Rob

After a reboot, the NFS share mounts with read-write access automatically.

So in summary (and I will write this down for my own records):

STEP 1. In the media server software (in this case Unraid), set up the share to support NFS in both
a) the share itself: SHARES >> add rule *(rw) , Export = Yes, Security = Private
b) under SETTINGS >> NFS >> Enable NFS = Yes, Tunable (fuse_remember): 330 (default)

STEP 2. On linux desktop client,
a) Find the name of the NFS open terminal: type the following, where the IP address is that of your media server.

showmount -e 192.168.1.109

This will then return a list of the NFS shares that have been exported, e.g.

Export list for 192.168.1.109:
/mnt/user/nextcloud *
/mnt/user/Rob       *

b) Copy the name of the share you want to mount e.g. /mnt/user/Rob

STEP 3. Set up the NFS share to automount:
a) Open folder /etc/ , open ‘fstab’ in a text editor (you may have to use super user privileges to save it)
b) Enter the following into fstab at the bottom of the file taking the share path and IP address from step 2. Note the format is as following:

<yourserver IP address>:<path to the exported share you want to mount from step 2b> <path you want to mount the NFS share to e.g. /mnt/name> nfs <options> 0 0

More details on the options to set are here:
https://linuxopsys.com/linux-nfs-mount-entry-in-fstab-with-example

example:

192.168.1.109:/mnt/user/Rob /mnt/nfs/Rob  nfs rw,hard,intr,timeo=14 0 0
mount /mnt/nfs/Rob

Then save the file.

c) In terminal run
systemctl daemon-reload

STEP 4: Reboot the system to ensure this mounts persistently.
Your folder should mount automatically under the path from Step 2b e.g. /mnt/nfs/Rob

OK, that did it. However this is rather cumbersome for novice users. I think this should be added as simple GUI option in GNOME and other dekstop environments. It should be as simple as mounting an SMB share under + Other Locations (SMB just appear automatically there)

1 Like

You might want to add nofail (or noauto) to your list of mount options in /etc/fstab. Otherwise, your PC might hang on startup if it cannot connect to your unraid server.

2 Likes

Thank you @glb that is a good one… I added nofail to the options. Thanks for the tip!