Friday 19 August 2011

Fixing problem of NFS mounts specified in /etc/fstab not being mounted at boot

When using SUSE11 (and possibly other flavours of Linux), there could be issues in nfs mount to successfulyl get mounted at boot up time, even though already specified in /etc/fstab.

There is a basic workaround for this, where the command "mount -a" can be manually entered when you log into the system the first time after each boot up.

However, if you wanted to fix this once and for all, there here's the solution. Open the file /etc/init.d/nfs, and change the following lines (the text in green are the additions that need to be made):

if test "$nfs" = yes ; then
sleep 10 && mount -at nfs,nfs4 > /dev/null 2>&1
sleep 2
fi

The value of "10" for the first sleep could be changed to a lower number, e.g. 5, but I decided to choose 10 just to be sure that the network was up and running for the nfs mount to succeed. This sleep period value could be increased/decreased to suit your needs.

No comments: