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

Re: readonly NFS root: udev means can't use stock kernel? (long)



Hi Alexis,

Alexis Huxley wrote:

> 
> ('ga010133vm3' is my test NFS root client. '134.171.27.236' is my NFS
> root server.)
> 
> root mounted three times!
> -------------------------
> 
> ga010133vm3# df

Check in /proc/mounts what is really mounted, entries in /etc/mtab are not
always identical.

> Filesystem                    1K-blocks      Used Available Use% Mounted
> on
> rootfs                         14721376   8549152   5424384  62% /

This one is from your fstab, you may safely remove this fstab entry.

> udev                              10240        24     10216   1% /dev
> 134.171.27.236:/diska/nfsroot  14721376   8549152   5424384  62% /

Don't know where this comes from.

> 134.171.27.236:/diska/nfsroot  14721376   8549152   5424384  62%
> /dev/.static/dev

This is a bind mount of /dev done done by udev.


> tmpfs                            128488        80    128408   1% /tmp
> ga010133vm3#
> 
> The first entry ('rootfs ...') I guess is the one added by the kernel
> itself because of the parameters it sees on the command line, in turn
> provided by the pxe.config file, but why isn't that root fs pivoted out
> (or whatever it is that happens these days) as it mounts the desired
> root fs 134.171.27.236:/diska/nfsroot on / ?

You can add as many entries to /etc/mtab as you want, df and other tools
will show nice things. Its only not necessarily the reality.

> 
> I added 'noauto' to the entry for / in /etc/fstab but that makes

Remove it if you want.

> no difference at all, presumably because there is an explicit mount
> request for / somewhere (initrd getting the root device off the kernel
> command line maybe?) What is the "correct" fix? Presumably somehow
> to tell the initrd to pivot it out a bit better?

How do you mount you root directory at all, via initrd or via kernel command
line.
As I said above, before you begin to do crazy things, first
check /proc/mounts. 

> 
> The second entry is the correct one.
> 
> The third entry I presume is being put there as udev moved what it
> sees as /dev out of place before it mounts its own fs there. Though
> my non NFS-root Debian machines don't have this!

Check /poc/mounts again.

> 
> Because of the dependencies for the stock Debian kernels, I cannot
> uninstall udev, but I think it would make no difference even if I
> did because it looks like udev is in the initrd image, so even when
> I specify:
> 
> ga010133vm3# grep static /etc/udev/udev.conf
> no_static_dev="true"
> ga010133vm3#
> 
> Byt it makes no difference: the nfsroot is still mounted on
> /dev/.static/dev.

Don't know, might be an udev bug. Whats your problem with this bind mount?

> 
> What's going on? What is the "Debian way" to get root mounted
> three times? Like I said I want to stick with stock kernels, and

Its not mounted 3 times.

> 
> /dev/null does not exist when sshd starts
> -----------------------------------------

Why don't you post this in another thread?

> 
> ga010133vm3# sshd
> ga010133vm3# pgrep sshd
> ga010133vm3# grep daemon /var/log/syslog
> Jan 11 18:22:44 ga010133vm3 sshd[1411]: fatal: daemon() failed: No such
> device ga010133vm3#
> 
> A google of this error message showed that sshd died because /dev/null
> did not exist, and a look around /etc/init.d turned up this in udev:
> 
> # When modifying this script, do not forget that between the time that
> # the new /dev has been mounted and udevtrigger has been run there will be
> # no /dev/null. This also means that you cannot use the "&" shell command.
> 
> which seems to suggest udev is not behaving very well in this
> environment.

We have seen this too, udev of Debian Sarge?

> 
> DHCP not passing hostname?
> --------------------------

Again, another thread, please.

> 
> I'm using dhcp3 as the client and as the server. I see that if
> 'auto eth0' is in /etc/network/interfaces then there is the network
> connection is lost (presumably NIC downed) prior to the call for
> an IP address, and since / is NFS mounted at that point things go
> quickly wrong.

Why don't you take eth0 out of your /etc/network/interfaces? Its already
configured by the kernel or your initrd, so why configuring it by Debian
again?

> 
> But ifup also thinks that the NIC is not up yet; for purely cosmetic
> reasons it would be nice if it understood it was up. One fix would be
> to hack its state file, but nicer seemed to add 'script "/bin/true";'
> to /etc/dhcp3/dhclient.conf so that the call to dhclient is a
> no-op. This works fine.
> 
> Prior to doing that, I set the script to be a one liner:
> 
> #!/bin/sh
> env >> /tmp/log
> 
> I did this in order to see if I could modify /etc/init.d/hostname.sh
> to use information provided by the DHCP to set the hostname; using
> /etc/hostname to set the hostname would mean that I could not let a
> second client mount the same NFS root filesystem. But oddly I did
> not see any hostname in the log file; I see a lot of other stuff:
> IPs, gateways, DNS servers, but no hostname.

I'm too tired to read through this, but you might be interested in this
howto:

http://www.pci.uni-heidelberg.de/tc/usr/bernd/downloads/nfs-root-howto/

> 
> In the end I modified the hostname.sh to include:
> 
> HOSTNAME=$(/usr/bin/host $(ifconfig eth0 | sed -n 's/.*inet addr:\([^
> ]*\).*/\1/p') | sed -n 's/.* pointer \([^\.]*\).*/\1/p')
> 
> I.e. to look its own IP up in DNS and get its own hostname that way.
> 
> But it ought to be possible to set it from info recieved via
> DHCP; either the call the kernel makes because of its 'ip=dhcp'

Check the linuxrc file in my howto, I took it from the LTSP project, should
work for you, too.

Cheers,
Bernd



Reply to: