AnswerBun.com

Can't mount Raspberry Pi NFS Server

Raspberry Pi Asked on January 6, 2022

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.

3 Answers

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

Answered by JimS-CLT on January 6, 2022

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.

Answered by Dods on January 6, 2022

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

Answered by Mohammad Ali on January 6, 2022

Add your own answers!

Related Questions

Fade screen on sleep and brighten on wake

1  Asked on February 8, 2021 by itamar-kerbel

     

reading a dutch ‘slimme meter’ has USB troubles

1  Asked on February 6, 2021 by cantdutchthis

 

Screenly install process

1  Asked on February 6, 2021 by dirxtope

   

Block script excecution when fbi is displaying image

4  Asked on February 5, 2021 by jpx

     

Access ports with specific address

0  Asked on February 4, 2021 by dan-chaltiel

   

Adafruit Speaker Bonnet for Raspberry Pi – No sound

0  Asked on February 2, 2021 by emad-mokhtar

   

voltage issues with GPIO raspberry pi 2

1  Asked on February 1, 2021 by andrew-m

   

Pi loses local network connectivity

0  Asked on January 30, 2021 by boogie-man

     

Raspbian 8 on Raspberry Pi 3 B+

4  Asked on January 30, 2021 by medismail

   

Raspberry Pi Networking

2  Asked on January 19, 2021 by danny-herbert

   

Make ifplugd available with systemd

1  Asked on January 17, 2021 by ingo

   

Trying to connect pi zero over USB

1  Asked on January 16, 2021 by wabbitt

     

Compile a dts file (dt overlay)

1  Asked on January 13, 2021 by feroxcannibal

 

RPi 3 B+ set Wi-Fi country on localisation tab

1  Asked on January 12, 2021 by stilllearning

   

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP