Problem: Server boots 3 minutes, Raspberry Pi boots 30 seconds. After a power outage, RPi boots faster and does not mount the NAS disk.
This particular RPi needs disk to be able to record to it. Hence without the (external) disk mounted, RPi is useless. I was using RPi autostart.sh to:
mount -t nfs 192.168.1.5:/Public/Video/TV /storage/nas -o nolock;
when I realised this problem. So, I created a loop in RPi's autostart.sh where I mount NAS. During normal operation (once the mount is achieved) this problem can not occur any more: should only one of them reboot, RPi mount will work OK (I think).
Would this be a good solution (executed only at RPi startup) and could it be done better or more elegantly?
until mountpoint -q /storage/nas || mount -t nfs 192.168.1.5:/Public/Video/TV /storage/nas -o nolock; do sleep 30; done
This should not try to mount if allready mounted, and otherwise - mount. Plus, wait for a retry until mounted. Seems to work as intended, except that RPi will boot (not WAIT for mount) but this RPi (actually Kodi) will be frozen until NAS is mounted.
Only thing I can see colud be added here is: send WOL to NAS prior to sleep.
Clarification: This is OPENelec RPi instllation, and there is fstab not used, but the method desribed above.