7

I have Ubuntu 12.04 as the NFS server. The clients are Linux. My /etc/exports file has 1 line,

/folderToExport *(rw,async,no_subtree_check)  

/etc/init.d/nfs-kernel-server status shows that the NFS share is working as expected. The problem is that whenever I attempt to mount the NFS share from another Linux host, stdout says

mount.nfs: rpc.statd is not running but is required for remote locking
mount.nfs: use '-o nolock'...or start statd

ps -ef |grep statd shows that rpc.statd is already running, so why do they say to "start statd"?

Including their -o nolock suggestion allows for the mount NFS to occur, but then the mounted NFS becomes read-only. The /etc/exports file asks for rw.

How do you start statd? Is the NFS client or server missing some configuration?


Here's what worked for me. Make a declaration for each shared folder in /etc/exports, e.g.

/folderToExport *(rw,async,no_subtree_check) 

statd can be started by

service statd stop followed by

service statd start. Then ps -ef |grep statd shows

statd 1994 1 0 15:23 ? 00:00:00 rpc.statd -L

Once you've verified that statd is running, next run mount from the Linux client,

mount 192.168.1.3:/folderToExport /mountFolder

There should no longer be a message rpc.statd is not running ... start statd

Finally, be sure that permissions on NFS server allow for rw permissions. (Modifying the /etc/exports file alone was insufficient)

chmod 0777 /folderToExport -R

3

statd is part of the package nfs-common. You could probably find that yourself with locate statd which gives you among others /etc/init.d/statd.

You can start statd with:

service statd start

But it should normally have started on system boot but maybe there is something else going wrong. You should check your log files: grep statd /var/log/* to see if there are reasons why that did not start.

Your /etc/exports looks ok to me. I use:

/data0    *(rw,no_root_squash,no_subtree_check)

on my server and:

192.168.0.2:/data0 /data0   nfs  defaults,noauto,user 0 0

in the /etc/fstab on my client.

  • I can't issue the command sudo service statd start on Ubuntu 13.10 – puk Nov 15 '13 at 6:50
  • @puk you probably did not install nfs-common. If you don't you get statd: unrecognized service. After apt-get install nfs-common you'll get start: Job is already running: statd – Anthon Nov 15 '13 at 7:43
  • 2
    I just checked it again, and it works on 2 Ubuntu computers, but it doesn't work on raspbian even though nfs-common is installed. – puk Nov 15 '13 at 7:54
  • @puk I only checked on Ubuntu 13.10 for Intel on a VM. I am sorry, but I have no access to raspbian and cannot help you there. – Anthon Nov 15 '13 at 8:04
6

I found an answer that worked on Raspbian for me here.

Enable the rpcbind and nfs services.

sudo update-rc.d rpcbind enable

sudo update-rc.d nfs-common enable

Restart the rpcbind service

sudo service rpcbind restart

2

If rpcbind and statd are enabled and running and you still get this error message it is possible that the host is configured with restrictive tcp wrappers. The following error will be logged:

rpc.statd: Failed to read /var/lib/nfs/state: Success

In that case you should add the following to /etc/hosts.allow:

rpcbind: 127.0.0.1
  • 1
    Thanks for your input Roaima, I hope that I've made it clearer now - please review again. – Lobz Nov 10 '16 at 13:20
0

In /etc/default/nfs-common, insert the yes in NEED_STATD=yes.

  • 1
    Such short answers often greatly benefit from expansion to add explanation, or relevant source material. – HalosGhost Jul 14 '14 at 14:24
  • This doesn't help either on a raspberry pi – Trevor Jul 2 '16 at 2:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.