[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: NFS automount not happening



Bob Proulx wrote:
> Ross Boylan wrote:
> > I have a theory that the mounts are supposed to happen when the network
> > device comes up; the regular network up routines are not triggered to
> > avoid screwing up the root fs.  /etc/network/interfaces has
> > 
> > # The primary network interface
> > # do not bring up interface twice--PXE already did it
> > #allow-hotplug eth0
> > iface eth0 inet dhcp
> > 
> > Is my theory correct?
> 
> Yes.  You are correct.  Mostly.  I fired up my nfs diskless client and
> debugged through the startup process.  The eth0 network interface is
> already up at the start and therefore isn't ever brought up.  The nfs
> mounting is normally done in the /etc/network/if-up.d/mountnfs script.
> But since the interface isn't brought up that script is never run.  It
> is run for the lo loopback device but never run for the eth0 device
> which is already running.

After various testing, here is the winning combination for me.  Use
"manual" with "auto".  The "manual" says that you will handle the
network configuration by other means.  In this case other means will
be that it is online at the start and never touched.  The "auto" means
to start the network at system start time.  This will produce a
deprecation warning but is still functional.

  auto eth0
  iface eth0 inet manual

With that combination everything works for me.  At system boot time
the eth0 interface is brought up with ifup and the if-up.d/mountnfs
script is run which mounts all of the specified nfs mounts in the
/etc/fstab file.  Everything works.  Additional nfs mounts are mounted
at boot time.  Give it a try!

Bob

P.S.  Here is a good reference for the /etc/network/interfaces file:

  http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy

P.P.S.  Unanswered Question: Since the PXE boot used dhcp to obtain an
address that means there is a limited lease time for that address
before it should be renewed.  But doing the above won't start a
dhclient and won't ever renew the address.  Plus if the address ever
were to change it would break the nfs diskless system.  Since an nfs
diskless system by definition must remain active on the network
throughout its lifetime it will always be visible to the dhcpd daemon.
The dhcpd will ping the address after the lease has expired and before
assigning it again and will notice that it is still in use and will
avoid assigning that address to another client.  That is why this
works.  I wonder if there is a way to launch a dhcp client in such a
way that it keep the existing IP address renewed but won't ever bring
the interface down or up.  There is almost certainly a combination of
options or dhcp clients that will perform that function.  But since
things are fully functional at this point with the above configuration
researching that future perfect combination is a task for another day.

Attachment: signature.asc
Description: Digital signature


Reply to: