1、如果你的 ubuntu 没有安装 nfs 则 执行一下
sudo apt-get install nfs-kernel-server
2、假设 ubuntu 电脑需要共享的 nfs 路径为 :/home/lrr/nfs
3、修改 /etc/exports 文件
sudo vi /etc/export
4、在文件最后一行添加并保存
/home/lrr/nfs *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
5、重启 nfs 服务
sudo /etc/init.d/nfs-kernel-server restart
6、在开发板上执行 mount 命令
mount -t nfs -o nolock,vers=3 xxx.xxx.xxx.xxx:/home/lrr/nfs /mnt// 其中// xxx.xxx.xxx.xxx 为 ubuntu 的 ip 地址// /mnt 为开发板上的目录
7、成功后可在开发板上执行命令查看是否成功
ls /mnt
8、可能失败的原因
1、nfs服务没有启动
2、通讯异常,开发板与 ubuntu不在同一网段下或ping不通
3、你把路径打错了