NFS客戶端配置爲開機自動掛載時,系統啓動報錯。
報錯信息類似:
mount: mount: mount to NFS server '172.16.1.254' failed:
mount: System Error: No route to host.
原因:網絡啓動後需要對網絡內路由表進行“學習”。在未完成路由表學習之前啓動netfs服務會報錯。
解決方法:延後netfs啓動時間。(延時時間以實際情況爲準,建議30秒)
示例:
修改:/etc/init.d/netfs腳本
在如下行(42、43行)之間添加延時指令:
42 [ ! -f /var/lock/subsys/portmap ] && service portmap start
43 action $"Mounting NFS filesystems: " mount -a -t nfs,nfs4
添加延時指令後:
42 [ ! -f /var/lock/subsys/portmap ] && service portmap start
43 action $"Sleeping for 30 secs: " sleep 30
44 action $"Mounting NFS filesystems: " mount -a -t nfs,nfs4