Connect to a NFS Share with Gentoo

Install NFSv4

The below command will install with the default USE flags of ipv6, tpcd and nfsv4.

emerge --ask nfs-utils

Find NFS Shares

If you don’t know or can remember the name of your NFS shared drives, you can use the below command to list the exports.

storm ~ # showmount -e ""
Export list for
/personal shared
/Network Recycle Bin 1
storm ~ #

I want to connect to “/personal shared“, but note the space in the share name.

mount -t nfs " shared" ~/nfs/

To mount a share like this you will need to encase it in double quotes.

If you get a message like this…

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

…you need to start the statd daemon.

storm ~ # /etc/init.d/rpc.statd start
 * Caching service dependencies ...                                                                                                                               [ ok ]
 * Starting rpcbind ...                                                                                                                                           [ ok ]
 * Starting NFS statd ...                                                                                                                                         [ ok ]
storm ~ #

To make this change permanent, you need to add statd and other NFS related daemons to the default runlevel.

rc-update add nfsmount default

You should not be able to run the above mount command even after a reboot. To un-mount.

umount -v ~/nfs

Auto-Mount NFS Shares

Now to auto-mount, provided nfsmount is on the default runlevel, you just need to add an entry to your /etc/fstab file.\040shared     /root/nfs     nfs      rw,_netdev,auto,sync    0 0

Note the \040\ where the space should be in “personal shared“. Using double quotes or the like does not appear to work in fstab.


Gentoo Wiki – NFSv4

Be the first to comment

Leave a Reply