2

I am trying to set up my pi3 running raspbian as an NFS server. I've followed these instructions: http://www.htpcguides.com/configure-nfs-server-and-nfs-client-raspberry-pi/

In /etc/exports I have the line:

/mnt/Shared 192.168.1.0/24 *(rw,sync)

Which I hope means that the folder at /mnt/Shared (which is a directory on an external hard drive) is available for reading and writing by all machines using a local IP address. Then I do exportfs:

$ sudo exportfs
/mnt/Shared    192.168.1.0/24
/mnt/Shared    <world>

Then, on my laptop, which is running Ubuntu, I follow the client side instructions from the same site, but the mount command fails after a long wait:

$ sudo mount 192.168.1.105:/mnt/Shared /mnt/nfs
mount.nfs: Connection timed out

If I try that verbose it looks like this:

sudo mount -v 192.168.1.105:/mnt/Shared /mnt/nfs/
mount.nfs: timeout set for Sat Feb 18 21:52:14 2017
mount.nfs: trying text-based options 'vers=4,addr=192.168.1.105,clientaddr=192.168.1.109'
mount.nfs: mount(2): Connection refused
mount.nfs: trying text-based options 'vers=4,addr=192.168.1.105,clientaddr=192.168.1.109'
mount.nfs: mount(2): Connection refused
...
<repeated several times>
...
mount.nfs: Connection timed out

Has anyone any ideas of how to make it work? I don't think the problem is with the external hard drive, it appears to be mounted correctly, and I had the same issues trying to share a local directory.

EddyTheB
  • 121
  • 1
  • 4

3 Answers3

0

First I would make the following bash script and call it delay:

#!/bin/bash
# $1:delay time(s)
# $2:command
# example:
#    delay 10 "conky -d"

sleep $1
exec $2

Then I would make it executable

chmod a+x delay

You could put the command from your comments:

delay 60 "sudo systemctl restart nfs-kernel-server"

at the end of the rc.local file in /etc/init.d/ to have it run 60 seconds after every time the Pi boots up

Mohammad Ali
  • 2,373
  • 1
  • 12
  • 18
0

On the RPi NFS Server (The Media Server)

sudo /etc/init.d/rpcbind restart
sudo /etc/init.d/nfs-kernel-server restart

On the RPi NFS Client (My Plex Server)

sudo mount 192.168.1.105:/mnt/Shared /mnt/nfs

This worked for me.

And I had to mount my drives including the uid/gid in /etc/fstap because in my case chown does not work when the drive is mounted by root. Maybe someone can give me a tip for that.

Bex
  • 2,929
  • 3
  • 26
  • 34
Dods
  • 1
0

Tell reboot to wait for the network to be available. It’s on raspi-config in the advanced section iirc

JimS-CLT
  • 113
  • 6