Centos7 树莓派安装NFS服务

硬件:树莓派3B
环境:CentOS-Userland-7-armv7hl-RaspberryPI-GNOME-1804-sda

服务端安装和配置:
1.禁用并永久关闭防火墙
>>systemctl disable firewalld
>>systemctl stop firewalld

2.关闭selinux
>>vim /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled

3.安装nfs和相关
>>yum install -y nfs-utils rpcbind

4.创建共享的目录
>>cd /
>>mkdir share
>>chown nfsnobody:nfsnobody share
>>chmod 777 share

5.编辑nfs配置文件
>>vim /etc/exports
添加一行:
/share *(rw, sync)

6.启动服务并设置开机启动
>>systemctl start nfs
>>systemctl enable nfs
>>systemctl start rpcbind
>>systemctl enable rpcbind

7.查看本机正在共享的目录
>>exportfs
不出意外,就能看到" /share xxxxx "字样

Windows客户端挂载测试:
1.启用nfs客户端
控制面板-启用windows功能-nfs客户端

2.扫描服务端可挂载目录:
cmd:
>>showmount -e 192.168.198.2
应该就能看到“/share”字样了

3.挂载测试:
cmd:
>>mount 192.168.198.2:/share x:
看到字样“现已成功连接到xxxx”表示成功挂载,打开我的电脑就能看到新挂载的x盘了,测试读写

参考链接:
http://www.alliedjeep.com/17934.htm
https://www.linuxidc.com/Linux/2017-06/144467.htm
https://blog.csdn.net/Dragen1860/article/details/48287027
https://blog.csdn.net/xiaoxinyu316/article/details/40075637

猜你喜欢

转载自www.cnblogs.com/woodj/p/9058472.html