ubuntu主机环境:Window10 下装VMWare下装的 ubuntu18.04LTS x64 IP 192.168.10.119
Window10下配置192.168.10该网段
开发板:T02,ip:192.168.10.11
apt-get install nfs-common nfs-kernel-server
mkdir /home/cjl/nfs 此处目录可根据自己的实际情况修改
修改配置文件/etc/exports,在文件末尾增加如下内容:
/home/cjl/nfs *(rw,sync,no_root_squash,no_subtree_check)
/home/cjl/nfs 为共享目录,*表示所有计算机都可访问该共享,rw表示读写权限,sync表示内容同步写入内存和硬盘,no_root_squash表示客户机用root访问该共享文件夹时,不映射root用户,no_subtree_check表示不检查父目录的权限。
由于nfs是一个RPC程序,使用它前,需要映射好端口,通过rpcbind 设定, 所以需要重启该服务:
service rpcbind restart
上述操作完成后,可使用如下命令 查看NFS共享文件夹列表:
showmount -e?
在ubuntu下先挂载共享目录测试一下NFS服务是否正常工作,命令行如下:
mount -t nfs 192.168.10.119:/home/cjl/nfs /mnt/test/
挂载命令为:
mount -t nfs -o intr,nolock 192.168.10.119:/home/cjl/nfs mnt/
参考:
1.https://hideonlie.github.io/2019/08/18/Ubuntu18-04-NFS%E7%BD%91%E7%BB%9C%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F/
2.https://blog.csdn.net/weixin_42259646/article/details/90243011
3.https://blog.csdn.net/zkw12312/article/details/81006814
4.https://blog.csdn.net/thisway_diy/article/details/68067350
ARM开发板挂载Ubuntu18.04主机的NFS共享文件夹
原文:https://www.cnblogs.com/michaelcjl/p/12168691.html