A simple nfs server on centos

At the server end

choose a server as the nfs-server, do things below in root role

dnf -y install nfs-utils
mkdir /mnt/nfs-share
chown -R nobody /mnt/nfs-share/

vim /etc/exports
add a line
/mnt/nfs-share 192.168.178.0/255.255.255.0(rw,sync,all_squash)
save and exit

systemctl enable nfs-server
systemctl start nfs-server

At the client end

dnf -y install nfs-utils
mkdir /mnt/nfs-local
chown -R nobody /mnt/nfs-local/

vim /etc/hosts
add a line, replace 192.168.xxx.yyy to the IP addr of your NFS server
nfs-server 192.168.xxx.yyy 

vim /etc/fstab
add a line
nfs-server:/mnt/nfs-share  /mnt/nfs-local   nfs defaults   0 0
save and exit
 
mount -a # to confirm what you have done is right

other utils:

You could use showmount -e 192.168.xxx.yyy to get a share list from the nfs server.

Comments

  1. Markdown is allowed. HTML tags allowed: <strong>, <em>, <blockquote>, <code>, <pre>, <a>.