centos
1) 安装步骤
# 服务端安装步骤
yum -y install rpcbind nfs-utils
# 创建文件夹并赋权
mkdir /storage/data/ -p
#如果出现挂载文件夹下面的文件找到不,记得给源添加权限
chmod 777 -R /storage/data/
vi /etc/exports
#添加下行
/storage/data/ *(rw,sync,all_squash)
# 使配置生效
exportfs -r
# 启动服务
systemctl start rpcbind && systemctl start nfs
# 设置开机启动
systemctl enable rpcbind && systemctl enable nfs
# 检测
showmount -e 192.168.194.102
# 客户端安装步骤
yum -y install rpcbind
# 检测
showmount -e 192.168.194.102
2) 卸载步骤
yum remove rpcbind nfs-utils
Ubuntu
1) 安装步骤
# 服务端安装步骤
apt-get install nfs-kernel-server
# 客户端安装步骤
sudo apt-get install nfs-common
# 挂载
mount -t nfs 127.0.0.1:/data/nfs /data/testnfs
# 卸载
umount /data/testnfs
评论 (0)