The context
I have two servers: a NAS and a client server. They are both small machines (Raspberry, OLinuXino) and are plugged to the same power strip (which has a power button).
The client server mounts the NFS volumes from NAS at startup.
The problem
When I switch on the power strip, both servers startup at the same time. But at the time the client tries to mount NFS volumes, they are not yet available from the NAS.
So I have to mount them manually and I want to automate this.
I use fstab to mount the volumes on a Debian Wheezy distribution.
nas.local:/media/myshare /media/myshare nfs defaults 0 0
How I would solve it
So I thought I could add a script on the NAS that calls a ssh command to tell the client "mount your NFS volumes, they are ready now !".
Something like ssh -i idFile login@clientServer 'sudo mount -a'
from the NAS side.
The question
What would be the best place where to put that kind of script ?
A NFS hook ? Something like a callback ?
Extra question
Or is there another and better way to do this ?
fstab
entry or are you using an automounter? What distros are you running? – garethTheRed Jun 26 '14 at 09:27soft
option in your/etc/fstab
on the client? If so, try removing it (although it may be wise to add theintr
option if you do). – garethTheRed Jun 26 '14 at 10:04soft
option used. Andintr
seems to be deprecated. (I added a sample of my fstab entry to the question) – lauhub Jun 26 '14 at 11:50