jeremy_fritz
Posts: 66
Joined: Tue Jul 17, 2012 7:04 pm

Problem with NFS network

Sun Jul 22, 2012 1:56 pm

Hi everybody,

I tried to make my Raspbian an NFS server.
I installed packages nfs-kernel-server and nfs-common.

Then, I add this line in /etc/exports:
/home/partage/ 192.168.1.101(rw,all_squash,anonuid=1000,anongid=1000,sync)
This is what I see when I start the NFS server (service nfs-kernerl-server start):
Exporting directories for NFS kernel daemon...exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.1.101:/home/partage/".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x

.
Starting NFS kernel daemon: nfsd
Not starting: portmapper is not running ... (warning).
Portmap (or portmapper) seems to don't exist in this distribution. So, I launch rpcbind.
And, now this is what I see when I start the NFS server:
Exporting directories for NFS kernel daemon...exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.1.101:/home/partage/".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x

.
Starting NFS kernel daemon: nfsdrpc.nfsd: address family inet6 not supported by protocol TCP
mountdrpc.mountd: svc_tli_create: could not open connection for udp6
rpc.mountd: svc_tli_create: could not open connection for tcp6
rpc.mountd: svc_tli_create: could not open connection for udp6
rpc.mountd: svc_tli_create: could not open connection for tcp6
I don't know what to do now... Can you help me? Thanks!

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: Problem with NFS network

Sun Jul 22, 2012 3:20 pm

Well, at that stage, your NFS export should be available - have you tried mounting it from another machine? I think the warnings you are seeing at the end are to do with IPv6 not being available, but it shouldn't stop the share from working on an IPv4 network. If you're worried, install the IPv6 module:

Code: Select all

sudo modprobe ipv6
The RPCBIND issue is something I'm having problems with. I've tried:

Code: Select all

sudo updaterc.d rpcbind defaults
so that it starts as a service before nfs-kernel-server service comes up, but unfortunately, I'm getting:

Code: Select all

update-rc.d: using dependency based boot sequencing
update-rc.d: warning: rpcbind start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (S 2 3 4 5)
insserv: warning: current start runlevel(s) (empty) of script `rpcbind' overwrites defaults (2 3 4 5 S).
insserv: warning: current stop runlevel(s) (S) of script `rpcbind' overwrites defaults (0 1 6).
which results in no services being added to rc*.d

chrisw2
Posts: 106
Joined: Sat Apr 07, 2012 11:22 am
Location: Manchester, UK

Re: Problem with NFS network

Sun Jul 22, 2012 7:02 pm

I know this isn't going to help either of you but nfs-kernel-server just works for me. I installed it & nfs-common, edited /etc/exports & did /etc/init.d/nfs-kernel-server restart, exports mount ok on other machines, same after RPI is rebooted. Just works, no messing with service levels or trying to change stating of services.

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: Problem with NFS network

Sun Jul 22, 2012 8:02 pm

chrisw2 wrote:I know this isn't going to help either of you but nfs-kernel-server just works for me. I installed it & nfs-common, edited /etc/exports & did /etc/init.d/nfs-kernel-server restart, exports mount ok on other machines, same after RPI is rebooted. Just works, no messing with service levels or trying to change stating of services.
To be honest, it's worked for me on all Raspbians I've used so far. Just changed to the Official release, (and done a few bits and pieces, such as build XBMC) then when I've come to install the nfs components, I noticed the messages. It works, but I have to start rpcbind manually. Still head scratching atm.

EDIT: ok, a little drastic perhaps, but an apt-get purge on nfs-common and rpcbind followed by re-install did the trick. Obviously something screwy happened somewhere. All working expectedly now.

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: Problem with NFS network

Sun Jul 22, 2012 8:29 pm

bob_binz wrote:
chrisw2 wrote:I know this isn't going to help either of you but nfs-kernel-server just works for me. I installed it & nfs-common, edited /etc/exports & did /etc/init.d/nfs-kernel-server restart, exports mount ok on other machines, same after RPI is rebooted. Just works, no messing with service levels or trying to change stating of services.
To be honest, it's worked for me on all Raspbians I've used so far. Just changed to the Official release, (and done a few bits and pieces, such as build XBMC) then when I've come to install the nfs components, I noticed the messages. It works, but I have to start rpcbind manually. Still head scratching atm.

EDIT: ok, a little drastic perhaps, but an apt-get purge on nfs-common and rpcbind followed by re-install did the trick. Obviously something screwy happened somewhere. All working expectedly now.
`sudo update-rc.d rpcbind enable && sudo update-rc.d nfs-common enable` would also do the trick.

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Problem with NFS network

Mon Jul 23, 2012 4:13 am

bob_binz wrote:Just changed to the Official release, (and done a few bits and pieces, such as build XBMC) then when I've come to install the nfs components, I noticed the messages. It works, but I have to start rpcbind manually. Still head scratching atm.
I kind new user to the Raspberry Pi added a section on NFS and rpcbind to the Raspbian FAQ. Hopefully it has the information you are seeking:

http://www.raspbian.org/RaspbianFAQ#How ... S_share.3F

jeremy_fritz
Posts: 66
Joined: Tue Jul 17, 2012 7:04 pm

Re: Problem with NFS network

Mon Jul 23, 2012 6:22 pm

Thnak you all!

I try to access this server from my macbook. (Go to> nfs://192.168.1.17) but it doesn't work.
Is it the good way to do?
If not, do you know how to do?

Thank you again!

jeremy_fritz
Posts: 66
Joined: Tue Jul 17, 2012 7:04 pm

Re: Problem with NFS network

Mon Jul 23, 2012 6:43 pm

OK sorry, I was too lazy on this...

Here is a page to access an NFS server from a Mac. Very easy. Thank you all!
http://kampmeier.com/chris/blog/?p=43

Jay Nostin
Posts: 4
Joined: Thu Dec 08, 2011 4:59 pm

Re: Problem with NFS network

Sat Aug 11, 2012 9:07 am

Warning: For the rather nice pisces release (Jul 2012) of Raspbian (rpi_pisces_r3.img) there is no NFS kernel support (unless you build your own kernel obviously).

mikewasouski
Posts: 2
Joined: Thu Aug 15, 2013 6:10 am

Re: Problem with NFS network

Thu Aug 15, 2013 6:13 am

I had the same problem, then I just restart the service

sudo service rpcbind restart

And NFS started to work properly.

Greetings

basti122303
Posts: 35
Joined: Fri Jun 15, 2012 8:37 am

Re: Problem with NFS network

Wed Aug 28, 2013 7:12 pm

There I found the solution:
http://www.novell.com/support/kb/doc.php?id=7011354

Code: Select all

Disable IPv6 in /etc/netconfig
Regards

steve_bleazard
Posts: 1
Joined: Sun Dec 29, 2013 9:50 am
Location: London, UK

Re: Problem with NFS network

Sun Dec 29, 2013 10:06 am

The update-rc.d issue:

Code: Select all

update-rc.d: using dependency based boot sequencing
update-rc.d: warning: rpcbind start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (S 2 3 4 5)
insserv: warning: current start runlevel(s) (empty) of script `rpcbind' overwrites defaults (2 3 4 5 S).
insserv: warning: current stop runlevel(s) (S) of script `rpcbind' overwrites defaults (0 1 6).
Seems to be a result of an install issue: The package does not properly create the /etc/rc*d entries and update-rc.d/insserv stubbornly refuse to fix them. So, to resolve, create the links by hand, run as root:

Code: Select all

for i in 0 1 6; do ln -s ../init.d/rpcbind /etc/rc$i.d/K07rpcbind; done
for i in 2 3 4 5 S; do ln -s ../init.d/rpcbind /etc/rc$i.d/S12rpcbind; done
it doesn't matter which directory you are in. After that run the update-rc.d:

Code: Select all

update-rc.d rpcbind defaults

explainer
Posts: 10
Joined: Tue Mar 25, 2014 7:50 pm

a simple script to enable nfs file sharing

Fri Nov 14, 2014 6:58 pm

I too have experienced problems with getting my RPi hosts to export their file systems to my other hosts. After reading the other posts, I have boiled them down to a single script and an exports file. I now have my 2 pi hosts visible as mounts on my Ubuntu dev box.

Code: Select all

sudo apt-get purge nfs-common rpcbind nfs-kernel-server
sudo apt-get update
sudo apt-get install nfs-kernel-server nfs-common rpcbind
sudo modprobe ipv6
sudo service nfs-kernel-server start
file /etc/exports

Code: Select all

# export of entire file system (you may wish to change this)
/         192.168.1.0/255.255.255.0(rw,sync,no_root_squash,no_subtree_check)

paul_ivinson
Posts: 1
Joined: Mon Sep 07, 2015 12:35 pm

Re: Problem with NFS network

Mon Sep 07, 2015 12:50 pm

One other thing that can cause problems are the /etc/hosts.deny and /etc/hosts.allow files. You do need to allow the client machine to access it's own rpb.statd or you'll get the following

Code: Select all

mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified
This may not be true - rpc.statd can be running. However if you have been editing either /etc/hosts.deny or /etc/hosts.allow you may have prevented rpc.statd connecting back into a local port.
The simplest solution is to add the following line to /etc/hosts.all

Code: Select all

# Allow localhost to connect to its own services (NFS client may not work otherwise)
ALL: 127.0.0.1
This opens all local ports to all local processes so you might want to be a little more selective.

HankB
Posts: 127
Joined: Fri Jan 01, 2016 2:45 pm

Re: Problem with NFS network

Sun Mar 06, 2016 3:06 pm

Hi folks,
I'm trying to get my RPi2 running current Raspbian to mount an NFS share at boot. I've followed the instructions at http://www.raspbian.org/RaspbianFAQ#How ... S_share.3F and the statd service is starting but there seem to be two problems. First it seems like statd does not get going soon enough before the NFS mount starts and I find the following in /var/log/daemon.log:

Code: Select all

Mar  6 08:38:49 meeker nfs-common[89]: Starting NFS common utilities: statd
Mar  6 08:38:49 meeker nfs-common[89]: Not starting: portmapper is not running ... (warning).
And a little later the NFS server host name is not resolved

Code: Select all

Mar  6 08:38:50 meeker mount[367]: mount.nfs: Failed to resolve server oak: Name or service not known
I tried adding _netdev to the mount options in /etc/fstab

Code: Select all

oak:/export/share /mnt/share    nfs _netdev,rw,user,auto 0 0
and that did not help.

I finally added

Code: Select all

/usr/local/bin/late-mount.sh &
to /etc/rc.local and coded the script

Code: Select all

[email protected]:~ $ cat /usr/local/bin/late-mount.sh 
#!/bin/sh
sleep 30
mount -a
[email protected]:~ $ 
This works but I find this a bit of a brute force solution.

Is there a way to get this to work the way it is intended?

Thanks!

braitac
Posts: 33
Joined: Tue Feb 10, 2015 3:05 pm

Re: Problem with NFS network

Fri Mar 03, 2017 3:13 pm

I have solved this myself with

Code: Select all

nano /etc/rc.local

 service nfs-kernel-server restart     #add this line BEFORE return 0 in /etc/rc.local file or it won't work

reboot
I think this is due to different runlevels between services :

Code: Select all

service nfs-kernel-server status
#Mar 03 12:01:24 nfs-kernel-server[513]: Not starting: portmapper is not running ... (warning).
head /etc/init.d/nfs-kernel-server
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
head /etc/init.d/rpcbind
# Required-Start:    $portmap $time       #maybe an issue as raspbian doesn't install portmap and runlevels differs from nfs-kernel-server
# Default-Start:     S
# Default-Stop:      0 1 6   

Return to “Raspbian”