nfs 安装(1)
apt-get install nfs-kernel-server
apt-get install portmap nfs-common
(2)
编辑/etc/exports
/nfsroot *(rw,sync,no_root_squash)
(3)
修改挂载点的属性
chmod 777 /nfsroot
(4)
重启nfs
sudo /etc/init.d/nfs-kernel-server restart
(5)
在本机上测试
showmount -e
mount 192.168.0.10:/nfsroot /mnt
ls -l /mnt
确保nfs服务启动
先测试,命令如下
#service nfs-kernel-server status
未出现unrecognized service之类的错误输出就表示已经安装
如果没启动,则用下面命令启动:
#service nfs-kernel-server start
即可用mount挂载。
常见错误:mount: RPC: Timed out
mount: nfsmount failed: Bad file descriptor
mount: Mounting 192.168.1.107:/home/wuxl/nfsroot on /mnt failed: Bad file descriptor
这个错误时翻过墙没关,可能还有其他原因,暂时没碰到,关闭防火墙指令:ufw disable 开启指令:ufw enable
挂载到开发板
mount -t nfs 192.168.0.10:/nfsroot /mnt -o nolock