
Step 1 — Verify connectivity to the NFS server
First, confirm the client can reach the NFS server over the network. Replace the example IP with your server’s address (here:10.0.2.15).
Network connectivity and appropriate firewall rules (e.g., allowing NFS/RPC ports) are required before mounting. Ensure you have administrative privileges on the client to create mount points and perform mounts.
Step 2 — Create a mount point on the client
Create the directory where the remote export will be mounted. Use-p to avoid errors if the parent exists already.
Step 3 — Mount the NFS share manually (runtime)
Mount the remote export. In this example the server export path is/srv/nfs/share/nfs-lab on host 10.0.2.15.
The
mount command above performs a runtime (ephemeral) mount. It remains until unmounted or the system reboots. To ensure automatic mounting after reboot, add the export to /etc/fstab with appropriate options.Step 4 — Make the mount persistent by editing /etc/fstab
Add an entry to/etc/fstab so the NFS share is mounted automatically on boot. Common and useful NFS mount options include _netdev, nofail, and vers=.
Example /etc/fstab entry (server: 10.0.2.15, export: /srv/nfs/share/nfs-lab, mount point: /mountnfs):
/etc/fstab, apply mounts without rebooting:
Common NFS mount options
Step 5 — Summary and considerations
- Use
_netdevto avoid attempting to mount network filesystems before network interfaces are up. - Use
nofailso booting continues when the remote share is unavailable. - Force
vers=if your server requires a specific NFS protocol version. - Adjust
rsize/wsize, locking, and security options (sec=) as required by your environment and workload. - If you need automount behavior rather than static fstab entries, consider systemd automount units or autofs for on-demand mounting.
References and further reading
- NFS overview: https://nfs.sourceforge.io/ (or your distro’s NFS docs)
fstab(5)manual: https://man7.org/linux/man-pages/man5/fstab.5.htmlmount(8)manual: https://man7.org/linux/man-pages/man8/mount.8.html