nfs 一记。在linux下mount nfs。
想让它开机后自动就mount上,于是就在/etc/fstab里面加了一行:
server ip:/directory /localDirectory nfs defaults 0 0
结果开机后发现没有效果。很奇怪。百思不得其解。
看/var/log/messages,发现错误:
Jan 3 16:17:35 sec3 kernel: tg3: eth0: Link is up at 100 Mbps, full duplex.
Jan 3 16:17:35 sec3 kernel: tg3: eth0: Flow control is off for TX and off for RX.
Jan 3 16:17:44 sec3 mount: mount: RPC: Remote system error - No route to host
Jan 3 16:18:02 sec3 netfs: Mounting NFS filesystems: failed
网络起来了,但是却没有route?
但是手动mount却完全没有问题。。。。
最后,想来想去,难道是网络没有完全起来就mount,所以mount不上。
于是,在rc.local里面加了一句:
mount -a
重启动,发现成功了。
rc.local执行的时间比较晚,这个时候network已经完全起来了,就可以了。
这种tips是google都找不来的. 顶!
Freedom is slavery.
Ignorance is strength.