1、mount时出现错误,原因是主机防火墙没有关闭。
/ # mount -t nfs 192.168.3.101:/initrd /mnt
mount: RPC: Unable to receive; errno = No route to host
mount: mounting 192.168.3.101:/initrd on /mnt failed: Bad file
descriptor
/ # route add default gw 192.168.3.1 dev eth0
/ # mount -t nfs 192.168.3.101:/initrd /mnt
mount: RPC: Unable to receive; errno = No route to host
mount: mounting 192.168.3.101:/initrd on /mnt failed: Bad file
descriptor
/ # mount -t nfs 192.168.3.101:/initrd /mnt
mount: RPC: Unable to receive; errno = No route to host
mount: mounting 192.168.3.101:/initrd on /mnt failed: Bad file
descriptor
在网上找到关闭防火墙的方法:
1、永久性关闭
lokkit --disabled
2、 即时生效,重启后失效
service 方式
开启: service iptables start
关闭: service iptables stop
iptables方式
查看防火墙状态:
/etc/init.d/iptables status
暂时关闭防火墙:
/etc/init.d/iptables stop
重启iptables:
/etc/init.d/iptables restart
2、在解决上面的问题后面一个可能碰到的问题就是下面这个了,网上的解决办法是加上-o的选项。
/ # mount -t nfs 192.168.3.101:/initrd /mnt
rpcbind: server localhost not responding, timed out
RPC: failed to contact local rpcbind server (errno 5).
rpcbind: server localhost not responding, timed out
RPC: failed to contact local rpcbind server (errno 5).
lockd_up: makesock failed, error=-5
rpcbind: server localhost not responding, timed out
RPC: failed to contact local rpcbind server (errno 5).
mount: mounting 192.168.3.101:/initrd on /mnt failed: Input/output
error
加入-o nolock选项,root:# mount -o nolock -t nfs
192.168.100.21:/home/cnh01994/nfsroot /mnt/nfs则工作正常。
至此,我们就可以通过单板mount主机上的目录了。调试就方便多了。
下一步计划是NFS启动,这样的话调试就方便许多了。