How to Set Up NFS Server and Client Auto‑Mount on CentOS 7
This guide walks you through installing NFS on CentOS 7, creating a shared directory, configuring export options, starting the service, and then configuring a client to automatically mount the share using /etc/fstab, with verification steps included.
NFS Server Configuration
Install NFS service: yum install nfs-utils Create shared directory: mkdir -p /nfs/data Edit NFS exports file: Open /etc/exports and add the line: /nfs/data/ *(insecure,rw,sync,no_root_squash) The asterisk (*) denotes all clients, rw grants read‑write access, and sync forces synchronous writes. Other options such as no_root_squash control root permissions.
Apply NFS configuration: exportfs -ra Start NFS service:
systemctl start nfs
systemctl enable nfsVerify NFS service:
showmount -e 192.168.178.224NFS Client Configuration
Install NFS client: yum install nfs-utils Disable firewall (optional): Ensure the firewall allows NFS and rpcbind ports or temporarily disable it.
Edit /etc/fstab: Add the following line, replacing the server IP if needed:
192.168.178.224:/nfs/data /nfs/data nfs defaults 0 0Here 192.168.178.224:/nfs/data is the server export, /nfs/data is the local mount point, and nfs specifies the filesystem type.
Mount the NFS share: mount -a Or mount manually: mount 192.168.178.224:/nfs/data /nfs/data/ Verify the mount: df -h The output should list the NFS share with its size and usage.
These are the complete steps to configure an NFS service on CentOS 7 and set up a client for automatic mounting.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
