1.linux服务端
#install nfs server
sudo apt-get install nfs-kernel-server
#open /etc/exports file
vi /etc/exports
#add the lines
/home/root/nfsroot *(rw,sync,no_root_squash)
#restart the service
service nfs-kernel-server restart
#check the share path
showmount -e
2.客户端
#mount
mount -t nfs -o noclock 192.168.1.2:/home/root/nfsroot ./share
#umount
umount ./share
#如果挂载的时候出现如下错误
mount.nfs: an incorrect mount option was specified
#说明挂载参数不对,使用如下命令
mount -t nfs -o nolock,nfsvers=3,vers=3 192.168.1.10:/home/root/nfsroot/ ./share1
# 永久挂载:(不建议)
vim /etc/fstab //在最后一行添加下面一行信息
192.168.1.253:/testnfs /testnfs_client nfs defaults 0 0