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

Virtual ethernet interface on Raspbian buster

1  Asked on January 9, 2021 by ste

   

Unattended upgrade removed core packages

0  Asked on January 5, 2021 by olivier

 

Raspberry Pi + NRF24L01 timeout after a period of time

1  Asked on January 2, 2021 by gordon

     

GPIO pin PULL_DOWN would

1  Asked on December 30, 2020 by cronbachalpha

   

pi’s password is lost in every reboot

1  Asked on December 29, 2020 by totoro

     

Maximum Wi-Fi clients on Pi 3 hotspot

3  Asked on December 28, 2020 by oliverpool

     

How to get more than one uart interface

12  Asked on December 24, 2020 by tauran

 

First time setup – no HDMI output

1  Asked on December 24, 2020 by user2694019

 

Do you have a stable Kodi + TV HAT system?

0  Asked on December 22, 2020 by whynine

   

Hardware PWM for Python 3.5 or higher?

1  Asked on December 14, 2020 by nic

     

Make Raspberrypi boot from USB first

1  Asked on December 13, 2020 by pokerface

       

Unable to boot custom built alpine image

0  Asked on December 12, 2020 by hosh-sadiq

     

Unable to connect raspberry pi Minecraft server

1  Asked on December 11, 2020 by guiseppe

     

“last reboot” command not returning correct date

1  Asked on December 10, 2020 by aiden-wilkins

 

Touchscreen with Qt QML eglfs

1  Asked on December 8, 2020 by velkan

     

Ask a Question

Get help from others!

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