This guide will walk you through the process of configuring an NFS Client to mount and access NFS shares from an NFS Server.
This setup includes an NFS Server (dlp.emc.world with IP 10.0.0.30) and an NFS Client (node01.emc.world with IP 10.0.0.51).
Install NFS Client Utilities
Install the necessary NFS utilities on the client:
[root@node01 ~]# dnf -y install nfs-utils
Configure NFS Client
Set up the NFS Client to recognize the NFS Server's domain:
# /etc/idmapd.conf
Domain = emc.world
Mount the NFS share from the server:
[root@node01 ~]# mount -t nfs dlp.emc.world:/home/nfsshare /mnt
Verify the mounted NFS share:
[root@node01 ~]# df -hT
For NFSv3, use the -o vers=3 option:
[root@node01 ~]# mount -t nfs -o vers=3 dlp.emc.world:/home/nfsshare /mnt
Automatic Mounting at System Startup
Edit /etc/fstab to auto-mount the NFS share at startup:
# /etc/fstab
dlp.emc.world:/home/nfsshare /mnt nfs defaults 0 0
Dynamic Mounting with AutoFS
Install and configure AutoFS for dynamic mounting:
[root@node01 ~]# dnf -y install autofs
[root@node01 ~]# vi /etc/auto.master
# Add to the end
/- /etc/auto.mount
[root@node01 ~]# vi /etc/auto.mount
# Create new entry
/mnt -fstype=nfs,rw dlp.emc.world:/home/nfsshare
[root@node01 ~]# systemctl enable --now autofs
Test the AutoFS mount:
[root@node01 ~]# cd /mnt
[root@node01 mnt]# df -hT
By following these steps, the NFS Client will be configured to access NFS shares from the NFS Server, either through static mounts in /etc/fstab or dynamically using AutoFS.