How to fix: mount.nfs: rpc.statd is not running but is required for remote locking

mount.nfs: rpc.statd is not running but is required for remote locking

If you got this issue while mounting the NFS on your Linux box (In my case it was Ubuntu 12.04.2 LTS) then this post might help you as well and can save your lots of precious time.

Lets, see Step-by-Step:

How did I install NFS Server on Ubuntu?

# sudo apt-get install nfs-kernel-server

How did I install NFS Client?

# sudo apt-get install nfs-common portmap

The Issue

I got the issue while I was trying to mount the folders for my virtual machine.

mount -o 'vers=3,udp' 192.168.22.5:'/home/nerd/codezuzu/posts' /home/codezuzumachine/posts

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

The Solution

If you look at /etc/hosts.allow in you system, It says

# /etc/hosts.allow: list of hosts that are allowed to access the system.
#                   See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: LOCAL @some_netgroup
#             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper, as well as for
# rpc.mountd (the NFS mount daemon). See portmap(8) and rpc.mountd(8)
# for further information.
#

And since my client was trying to connect to locally to it own rpc, I need to allow my hosts itself, like:

# sudo echo "127.0.0.1" >> /etc/hosts.allow

Done!! This fixed my issue for the NFS.
Also, you need to make sure that there is no firewall configured to block it.

Hope this helps you. Happy Coding !!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.