试验nfs挂载:
主机:虚拟机vm8.04,Ubuntu12.04
开发板:华天正real210
问题:
1、ping不通
设置ip地址在一个网段,Ubuntu:ifconfig eth0 172.18.2.100,目标板:ifconfig eth0 172.18.2.110 netmask 255.255.0.0
2、连接超时
mount:RPC: Timeout
重新编译内核,把扩展及高版本的nfs选项选上
3、拒绝访问
- 修改/etc/exports,增加/home/forlinx/nfs 172.18.2.110(rw,async,no_root_squash),或者/home/forlinx/nfs 172.18.2.*/24(rw,async,no_root_squash)。其中后面一种的*是任意数字(0-255),不能直接写*。修改后需要重启服务:sudo service nfs-kernel-server restart。
- 虚拟机只能选Bridged且勾选Replicate physical directly to the physical network,或者选择Custom,我选的是VMnet0。
- 挂载:mount -t nfs -o nolock 172.18.2.100:/home/forlinx/nfs /mnt/nfs,-t nfs可不用。/mnt/nfs是板子上的挂载点。