Linux: Mounting a NFS Share

Troubleshooting the NFS sharing approaches…

To be able to mount a NFS share in Archlinux, it was necessary to follow the following steps.

1) Install the appropriate software:

pacman -S core/nfs-utils core/nfsidmap community/liblockfile community/libnfs

If the ntf-utils are not installed, the following error is most likely to occur:

mount: wrong fs type, bad option, bad superblock on NFS_SERVER_SHARE_IP:/DIRECTORY,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount. helper program)

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

Having the installed ntf-utils, the network share availability can be verified by:

showmount -e NFS_SERVER_SHARE_IP

2) Start the RPC service:

systemctl enable rpcbind
systemctl start rpcbind

If not, the following error is most likely to occur:

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

3) Edit the /etc/fstab accordingly:

NFS_SERVER_SHARE_IP:/DIRECTORY /mnt/MOUNTPOINT nfs rw,noauto 0 0

If the server supports the nfs4, update the previous type option accordingly.

4) Mount the network share:

mount /mnt/MOUNTPOINT

If unsure, whether the NFS server supports nfs4 or nfs, it can be tested by setting up the nfs4 option in /etc/fstab. If the following error occurs:

mount.nfs4: mounting NFS_SERVER_SHARE_IP:/DIRECTORY failed, reason given by server:
 No such file or directory

then the server does not support nfs4.

Advertisements
This entry was posted in Linux, Server and tagged , , , . Bookmark the permalink.