NFS 工具的安装设置

为了便于在ARM开发板(nvidia agx-xavier)与开发主机(ubuntu主机)间方便地进行文件传输,提高开发效率搭建NFS势在必行,本文目标:在开发主机上安装NFS服务程序,在ARM开发板上安装客户端程序,并实现将开发主机的/home/ubuntu/nfsroot目录挂载到ARM开发板的/mnt目录下。

安装NFS服务器

在开发主机的终端中执行:
sudo apt-get install nfs-kernel-server

配置NFS

在开发主机的终端中执行:
vim /etc/exports
在打开的文件最后输入:
/home/ubuntu/nfsroot *(rw,sync,no_root_squash)
其中ubuntu是开发主机的登录用户名,nfsroot是在开发主机中建立的nfs共享文件夹
mkdir ~/nfsroot

启动NFS服务

在主机的终端中执行:
sudo /etc/init.d/nfs-kernel-server start
便可启动NFS服务,以后修改NFS配置后需要重启NFS服务:
sudo /etc/init.d/nfs-kernel-server restart

在开发主机上测试

在开发主机上执行以下命令,测试NFS服务是否正常:
sudo mount -t nfs 192.168.8.45:/home/ubuntu/nfsroot /mnt
其中,192.168.8.45是开发主机的ip地址,这个命令是将nfsroot文件夹挂载到/mnt目录下,在nfsroot目录下新建测试文件便可在/mnt目录下看到测试文件:
touch ~/nfsroot/test.txt
然后查看/mnt目录:
ls /mnt

在开发板上测试

进入xavier开发板的终端执行命令:
sudo mount -t nfs -o nolock 192.168.8.45:/home/ubuntu/nfsroot /mnt
实现将开发主机的/home/ubuntu/nfsroot目录挂载到ARM开发板的/mnt

posted @ 2019-05-05 15:30  sunzhongmeng  阅读(572)  评论(0编辑  收藏  举报