Bug 139934 - netfs fails to mount nfs file systems from /etc/fstab
netfs fails to mount nfs file systems from /etc/fstab
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks: FC5Target
  Show dependency treegraph
 
Reported: 2004-11-18 15:49 EST by Aleksandar Milivojevic
Modified: 2014-03-16 22:50 EDT (History)
2 users (show)

See Also:
Fixed In Version: 8.35-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-11 12:32:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
sleep 5 than nfs mount (444 bytes, patch)
2004-11-19 09:22 EST, Aleksandar Milivojevic
no flags Details | Diff
add check_link_down to ifup script (328 bytes, patch)
2004-11-19 16:10 EST, Aleksandar Milivojevic
no flags Details | Diff
fix for check_link_down (1.18 KB, patch)
2004-11-19 16:41 EST, Bill Nottingham
no flags Details | Diff

  None (edit)
Description Aleksandar Milivojevic 2004-11-18 15:49:18 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20041020
Firefox/0.10.1

Description of problem:
I have two NFS file systems defined in /etc/fstab, on a box that is
NIS client (important).

They look something like this:

1.2.3.4:/foo   /foo   nfs   rsize=8192,wsize=8192   0 0
1.2.3.4:/bar   /bar   nfs   rsize=8192,wsize=8192   0 0

During boot, /foo fails to mount with an error stating that NFS server
is down.  /bar mounts fine.  When machine is up and running, I can
mount /foo manually by doing "mount /foo".

If I change order in /etc/fstab (/bar first, /foo second), than /bar
is the one that fails to mount.  So it is always the first NFS mount
point from /etc/fstab.  Second, third, and so on always mount fine.

It took me long time to figure out (with help from Fedora mailing
list) what is going wrong.

The box in question is NIS client.  ypbind script is called *after*
netfs script.  If I change the order of scripts in /etc/rc?.d
directories (first ypbind, then netfs) everything works fine.

I used IP addresses in /etc/fstab, so theoretically even if no name
services is available, everything should work.  However, in this
specific setup it doesn't.  I don't know why.  Is there reverse lookup
happening during NFS mount?

Some possible solutions could be:

1) reorder scripts in /etc/rc?.d so that netfs is called only after
all name related services are up and running (ypbind for sure, I guess
ldap and named too?).  Of course, in this case those name services
shouldn't have any data stored on NFS mount points defined in /etc/fstab.

2) Change timeout values so that mounts do not fail because name
service is unavailable (when calling mount command?  somewhere else?).

3) Remove/disable reverse lookup on IP addresses in /etc/fstab (if it
is happening).

Version-Release number of selected component (if applicable):
initscripts-7.93.2-1

How reproducible:
Always

Steps to Reproduce:
1. define two or more NFS mount points in /etc/fstab on NIS client


Actual Results:  First mount point from /etc/fstab fails to mount with
"server is down" error message.

Expected Results:  All mount points should mount correctly.  The
server is up, and IP addresses were used in /etc/fstab.

Additional info:
Comment 1 Bill Nottingham 2004-11-18 15:57:36 EST
Static IP?
Comment 2 Aleksandar Milivojevic 2004-11-18 16:39:27 EST
Both client and the server have static IP address.
Comment 3 Bill Nottingham 2004-11-18 17:39:46 EST
I'm guessing that if you add 'sleep 5' to the top of netfs, it works?
Comment 4 Aleksandar Milivojevic 2004-11-19 09:22:21 EST
Created attachment 107051 [details]
sleep 5 than nfs mount

Ah, so my great theory falls apart.  Sleep 5 does the trick.  Is it needed for
NFS only or for all the stuff in netfs?  What I did for now was to add sleep 5
just before NFS mounts, not to slow boot process if there's no NFS mounts.  As
in attached patch.

BTW, is this something specific for my installation (what? why?), or is this
generic problem?

Thanks for help.
Comment 5 Bill Nottingham 2004-11-19 15:15:46 EST
It appears that when it tries to mount the first NFS share, it's still
negotiating with the switch for link.
Comment 6 Bill Nottingham 2004-11-19 15:18:20 EST
You could concievably fix this by adding:

check_link_down ${REALDEVICE}

to the end of the static networking init section in ifup.
Comment 7 Aleksandar Milivojevic 2004-11-19 16:10:09 EST
Created attachment 107090 [details]
add check_link_down to ifup script

I've attempted to add check_link_down to ifup script as you suggested, and it
didn't work.  I've added one debugging echo to it, and by looking in log files
after reboot, it seems that check_link_down was called only for lo interface,
but not for eth0 interface.  eth0 has static IP address, so I would expect that
I added it to the right place (after line 407 in FC3 ifup script).  I've
inluded the patch with changes that I made.
Comment 8 Bill Nottingham 2004-11-19 16:41:32 EST
Created attachment 107091 [details]
fix for check_link_down

You probably need this as well.
Comment 9 Aleksandar Milivojevic 2004-11-22 09:27:40 EST
I've tried it out, still same results (error while mounting first file
system).  In log files I'm seeing "waiting for link on lo" (from my
patch), but not on eth0.

BTW, looking at your patch, it looks mostly as different formatting? 
I can't find any differences in the code?
Comment 10 Bill Nottingham 2004-11-22 11:08:25 EST
In the previous version, if the link is 'UP' according to ifconfig, it
skips the test entirely.
Comment 11 Aleksandar Milivojevic 2004-11-22 15:48:58 EST
Hm, even after calling check_link_down and patching network-functions,
it still doesn't work.  I've added some debugging, so I know that
check_link_down was called for my ethernet interface.  check_link_down
returns indicating that link is up.  However netfs still fails to
mount first file system.

This is how I called check_link_down:

    # Wait for link
    if check_link_down ${REALDEVICE}; then
        echo $" failed; no link present.  Check cable?"
    fi

(maybe this should be part of ifup anyhow, it would only print warning
during boot if cable is unplugged).
Comment 12 Matthew Miller 2006-07-10 18:24:51 EDT
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!
Comment 13 Bill Nottingham 2006-07-11 12:32:28 EDT
There is NETWORKDELAY and LINKDELAY in the current development initscripts that
may help to solve this for you.

From sysconfig.txt:

  NETWORKDELAY=<delay in seconds>
    Delay in seconds after all network interfaces are initialized.  Useful if
    network has spanning tree running and must wait for STP convergence.
    Default: 0 (no delay)

    LINKDELAY=<time in seconds>
      Time that the system should pause after the specific interface is
      enabled.  This may be useful if one interface is connected to a
      switch which has spanning tree enabled and must wait for STP to
      converge before the interface should be considered usable.

Note You need to log in before you can comment on or make changes to this bug.