Dear misc@ readers,
From mount_nfs(8):
-b If an initial attempt to contact the server fails, fork off a
child to keep trying the mount in the background. Useful for
fstab(5), where the file system mount is not critical to
multiuser operation.
My understanding is that, in case the server is not reachable when the
command is run (specifically, at boot, if there is a proper entry in
fstab(5)), it will be forked and keep trying the mount operation, till
when the server is back.
I had a look at the code and, if I am not mistaken, the process sleeps
for 60s, then retries and so on.
Now: this is my fstab:
# Blk dev Mount point FS type Mnt opts Dump freq Pass no.
#/dev/sd0a
ff014e14e96d5c40.a / ffs
rw,softdep,noatime 2 1
#/dev/sd0b
ff014e14e96d5c40.b none swap
sw
#/dev/sd0d
ff014e14e96d5c40.d /tmp ffs
rw,softdep,noatime,nodev,nosuid 1 2
#/dev/sd0e
ff014e14e96d5c40.e /var ffs
rw,softdep,noatime,nodev,nosuid 1 2
#/dev/sd0f
ff014e14e96d5c40.f /usr ffs
rw,softdep,noatime,nodev 1 2
#/dev/sd0g
ff014e14e96d5c40.g /usr/local ffs
rw,softdep,noatime,nodev,wxallowed 1 2
#/dev/sd0h
ff014e14e96d5c40.h /builds ffs
rw,softdep,noatime,nodev,nosuid,wxallowed 1 2
#/dev/sd0i
ff014e14e96d5c40.i /home ffs
rw,softdep,noatime,nodev,nosuid,wxallowed 1 2
# Network file sharing
egeo:/vol/datavol01 /nfs/egeo/vol/datavol01 nfs
net,rw,-i,-b 0 0
egeo:/vol/sys_backup /nfs/egeo/vol/sys_backup nfs
net,rw,-i,-b 0 0
egeo:/home/export /nfs/egeo/home nfs
net,rw,-i,-b 0 0
I observe two unexpected behaviors:
1) when I switch on the machine in an environment without any network
available, I see the messages "Cannot resolve egeo..." and the boot
process goes on; but when the server comes back (I simply make a wifi
network available and run "doas sh /etc/netstart" on the client),
nothing happens (I was instead expecting that the shares were mounted
after a minute or so);
2) when I boot without any network available and removing the "-b"
option from the client's fstab, again I see the messages "Cannot resolve
egeo...", and again the process continues without lagging...
I probably misunderstood the "-b" meaning. Could anyone give me some
hints? My goal is to make the NFS shares available as soon as the server
is reachable (without using amd(8) and possibly making the entire
process as much transparent for the user as possible).
All the best
--
Alessandro DE LAURENZIS
[mailto:[email protected]]
LinkedIn: http://it.linkedin.com/in/delaurenzis