||
硬件平台:TQ335XB开发板 1、安装NFS 服务 :~$ sudo apt-get install nfs-kernel-server 2、创建NFS 共享目录 假设 NFS 共享目录是/home/nfs ~$ sudo mkdir /home/nfs 3、配置NFS :~$ vi /etc/exports 在/etc/exports 文件末尾加入下面一行: /home/nfs *(rw,sync,no_subtree_check,no_root_squash) 如下图所示: ![]() 允许所有用户访问 NFS 共享目录 4、启动NFS 服务器 启动 portmap 和nfs-kernel-server 服务: :~$ sudo service portmap start ~$ sudo service nfs-kernel-server start 注:如果开发板不能挂载到宿主机可以试下以下方式: :~$ sudo exportfs –a :~$ sudo /etc/init.d/portmap restart :~$ sudo /etc/init.d/nfs-kernel-server restart 5、本地验证NFS :~$ ls /home/nfs helloworld.c $sudo mount localhost:/home/nfs /mnt $ls /mnt helloworld.c $sudo umont /mnt |