Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Oct 2005 10:50:06 +0200
From:      Erik Norgaard <norgaard@locolomo.org>
To:        David Marshall <dmarshall@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to Mount NFS Automatically After Boot-Time?
Message-ID:  <434B7CBE.3000001@locolomo.org>
In-Reply-To: <53f158630510110141k50281f15o23fa83e70dbb3036@mail.gmail.com>
References:  <53f158630510110141k50281f15o23fa83e70dbb3036@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
David Marshall wrote:
> We have several servers that mount from an NFS server for a lot of
> reading and writing.  We typically have this mount listed in
> /etc/fstab.
> 
> If one of these servers reboots when the NFS server is offline, it
> hangs in single-user mode until the NFS server comes back online.
> 
> We have tried usiing amd(8), but the sorts of traffic we have been
> generating has been just a little too much for amd to handle. 
> Occasionally it will become overwhelmed and will not work properly
> until it (amd) is restarted.  So, it is back to a straight NFS mount.
> 
> How can we cause this NFS mount to be made after the system has
> reached multi-user so that we can log in and perhaps mount from
> another server?  (The servers are in a colo, so it's not easy to gain
> physical access to the console to operate the machine in single-user.)
> 
> I've played with putting a mount command into /etc/rc.local, but I
> don't know whether that would make us equally susceptible to a server
> outage.

If you look in /etc/rc.d/ there are two scripts: mountcritlocal and 
mountcritremote - the last one mounts nfs mounts if present in fstab.

In the beginning of the file you will find the lines:

# PROVIDE: mountcritremote
# REQUIRE: NETWORKING root mountcritlocal cleanvar
# KEYWORD: nojail

These are comments for /bin/sh but the affect the order of execution. 
The scripts in /etc/rc.d are executed in the order sorted by 
/sbin/rcorder(8)

So, you can postpone the nfs mounts till later by changing the REQUIRE 
line. Note that some scripts may have "mountcritremote" in their REQUIRE 
line.

Hope this helps,

Erik
-- 
Ph: +34.666334818                                  web: www.locolomo.org
S/MIME Certificate: www.daemonsecurity.com/ca/8D03551FFCE04F06.crt
Subject ID:  9E:AA:18:E6:94:7A:91:44:0A:E4:DD:87:73:7F:4E:82:E7:08:9C:72
Fingerprint: 5B:D5:1E:3E:47:E7:EC:1C:4C:C8:3A:19:CC:AE:14:F5:DF:18:0F:B9



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?434B7CBE.3000001>