Re: mounting nfs on boot -- Was: Replacing systemd
On 05/03/14 11:34, Rob Owens wrote:
> On Wed, Mar 05, 2014 at 11:07:00AM +1100, Scott Ferguson wrote:
>> On 05/03/14 10:36, Rob Owens wrote:
>>> On Tue, Mar 04, 2014 at 01:52:19PM +0000, Darac Marjal wrote:
>>>> Boot speed isn't systemd's goal. It's just a side-effect.
>>>>
>>>> Systemd's real goals are being event driven (so, for example,
>>>> you don't mount a file system until the device is ready - at
>>>> the moment, debian does this with a two-pass mount script:
>>>> one pass to mount local filesystems, then another after
>>>> networking is up to mount remote filesystems, but this gets
>>>> messy if you have a complex system.) and
>>> <snip>
>>>
>>> Hey, maybe you can tell me why my nfs mounts don't get mounted
>>> at boot time on my computer that uses wicd to manage its
>>> wireless network interface. The network comes up at boot time
>>> (it doesn't require a user to log in first). Currently I stick
>>> "sleep 10s && mount -a" in /etc/rc.local in order to mount the
>>> nfs shares, but I know that shouldn't be necessary.
>>>
>>> -Rob
>>>
>>
>> Where are those nfs shares mounted (path)?
>>
> /mnt/music /mnt/pics_and_clips
>
> and so-on.
>
Thanks.
I've used the /etc/rc.local "mount -a" workaround in the past,
without the need for the sleep command.
In my cases I had the nfs mount being called from fstab, using the
"nfsvers=3" option helped when the server was Version 3 ("vers=" is a
more portable version of that option). You can also
use the "timeo=n" to set a wait period instead of sleep in
/etc/rc.local e.g. timeo=100 (time is in deciseconds). Use it in
combination with the "bg" flag and the appropriate retry value. See man
nfs for more a useful and accurate explanation.
NOTE: I'm assuming you mean that your nfs server/s is accessed with
wireless.
I'm also assuming you've checked the logs for clues. If so you may be
able to get more information by adding the "-v" (for verbose) to the
mount call in /etc/network/ifup.d/mountnfs (WARNING - untested, thanks
for testing)
e.g.:-
# cp /etc/network/ifup.d/mountnfs{,.bak}
then edit /etc/network/ifup.d/mountnfs
and change:-
if [ "$NETFS" ]
then
mount -a -t$NETFS
fi
to:-
if [ "$NETFS" ]
then
mount -va -t$NETFS
fi
and reboot (or restart network services, after umounting the nfs
shares - don't forget to comment out your line in /etc/rc.local)
Kind regards
Reply to: