NFS4 Server setup

Hi all,

After several days trying to configure my NFS server and clients I am going to have to ask for some help. I did have all of this set up and working before I had to switch one RasPi to OSMC to enable KODI as a media player.

My set up is this…

Raspberry Pi 2 running OSMC booting from SD with / on 1TB USB HDD. 4TB HDD for media storage and files. Wifi connected to home network (192.168.0.70)

Raspberry Pi B+ running Raspbian Jessie. Wifi connected to home network (192.168.0.86)

Desktop PC running Manjaro. Ethernet connected to network (192.168.0.1)

I was using the Pi B+ as a torrent/file server writing/reading data via NFS share served from the Pi 2 over direct wired connection between the Pi B+ (169.254.166.222) and the Pi 2 (169.254.160.254).

The Pi 2 also serves the NFS share to the Manjaro PC but over the wifi. The idea is to limit the amount of data going over the wifi and allow the torrent server fast read/write to the data HDD.

Pi 2 has this /etc/exports configuration…
/srv/nfs4/4TB-DATA 169.254.166.254/24(rw,sync,no_subtree_check,insecure) 192.168.0.1/24(rw,sync,no_subtree_check,insecure)

Pi B+ has this line in /etc/fstab…
169.254.166.222:/srv/nfs4/4TB-DATA /mnt/4TB-DATA nfs4 user,rw,auto 0 0

Manjaro PC has this in /etc/fstab…
192.168.0.70:/srv/nfs4/4TB-DATA /mnt/4TB-DATA nfs4 rw,users,auto 0 0

When I try to mount the NFS share on the Pi B+ I get this error…

mount.nfs4: access denied by server while mounting 169.254.166.222:/srv/nfs4/4TB-DATA

From Manjaro PC I get this…

mount: 192.168.0.70:/srv/nfs4/4TB-DATA: No such file or directory

I understand you might not be able to help with the Manjaro PC but any pointers to help with the OSMC/Raspbian set up would be greatly appreciated.

If there are any other config files you need to see please ask.

Diesel1.

Your exports doesn’t look right, as a simple test (it’s less secure this way, but probably not a worry if you are on a small home network. Try this in your /etc/exports

/srv/nfs4/4TB-DATA *(rw,sync,no_subtree_check)

this will grant access from any IP.

Also, double check your permissions on /srv/nfs4/4TB-DATA. That directory has to be rwx for the user accessing it via NFS.

Thanks Brian, that has allowed the Pi B+ to mount the share over the wired link.

My Manjaro PC still cannot connect and gives this error…

mount: 192.168.0.70:/srv/nfs4/4TB-DATA: No such file or directory

I wonder if this is because Manjaro implements NFS4.

Is OSMC running NFS3?

Thanks again,

Diesel1.

OSMC’s Pi kernel should have nfsv4 enabled

Sam

Okay everything seems to have sorted itself out after restarting the systems.

Thanks again for the very helpful comments.

Diesel1.

Diesel1, after making the changes to /etc/exports, make sure you do this:

sudo exportfs -ra

Otherwise the changes you make won’t take until a reboot.

If you’d like more info about setting up NFS4, give this page a read:

SettingUpNFSHowTo Lots of good information about configuring users, etc.

Glad to hear you got things working!

1 Like

Yes I did use exportfs to refresh the daemon and had tried single lines for each export in /etc/exports…

/srv/nfs4/4TB-DATA 192.168.0.1(rw,sync,no_subtree_check)
/srv/nfs4/4TB-DATA 169.254.160.254(rw,sync,no_subtree_check)

but the other computers couldn’t mount the shares.

I have also read the NFS4 howto many times. I have been using GNU/Linux since 1998 and consider myself reasonably competent but this just wasn’t happening for me. :disappointed:

Anyhow, thanks for your help.

Diesel1.