Bug 427157

Summary: mounting of nfs shares with fstab during bootup not working
Product: [Fedora] Fedora Reporter: Mark <nix4me>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: donhoover, jonstanley, rvokal, zahour
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-02 00:49:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
netfs-data-gathering during boot none

Description Mark 2008-01-01 16:20:34 UTC
Description of problem:  mounting of nfs shares with fstab during bootup not
working due to networking not started until after fstab is processed.


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


How reproducible:  add these lines to fstab and reboot: 
192.168.1.102:/mnt/hdd1 /mnt/fileserver		nfs	defaults	0 0
192.168.1.102:/mnt/hdb1 /mnt/fileserver2 	nfs	defaults	0 0


  
Actual results:  after adding those lines to fstab and rebooting, the shares are
not mounted.  During boot process I can see an error about network unreachable
when the mount attempts to take place


Expected results: the shares to be mounted at boot.


Additional info:  After the boot has finished, i can drop to terminal and type:
mount -a and everything works fine.

Comment 1 Jon Stanley 2008-01-01 17:07:42 UTC
Instead of defaults in the mount options, you need to add _netdev, and make sure
that netfs starts at boot (chkconfig netfs on).  This will cause it to mount
later in the boot process after networking is up.

Let me know if that works for you.

Comment 2 Mark 2008-01-01 19:17:59 UTC
i changed fstab to the following and it still does not mount them during bootup.
 Same error.  Network unreachable.  netfs is running also.

192.168.1.102:/mnt/hdd1 /mnt/fileserver		nfs	_netdev 	0 0
192.168.1.102:/mnt/hdb1 /mnt/fileserver2 	nfs	_netdev		0 0

Comment 3 Jon Stanley 2008-01-01 19:51:16 UTC
Is your machine on the same subnet as the fileserver in question?

Comment 4 Mark 2008-01-01 20:15:51 UTC
yes.  The Fedora 8 machine is 192.168.1.195.

Comment 5 Jon Stanley 2008-01-01 20:50:29 UTC
I just stepped through the boot sequence by inspecting the scripts.  There's no
way that nfs filesystems should be mounted prior to networking coming up -
rc.sysinit (which handles mounting all of the local filesystems amongst a host
of other tasks) specifically skips NFS since the network isn't yet available. 
The _netdev that I had you put in is unnecessary, since netfs looks for NFS
filesystems anyway.  Do you see a 'Mounting NFS filesystems', and then the
Network is unreacable, or is it at some other point?  Could you also verify your
initscripts package with rpm -qV initscripts? 

Since this is just about boot-time, I'm going to change the component to
initscripts, as well.

Comment 6 Jon Stanley 2008-01-01 21:12:04 UTC
I've also provided a replacement for the netfs script at
http://jstanley.fedorapeople.org/netfs-debug that will log some diagnostic data
(particularly loaded modules and the state of networking at the time) to
/tmp/netfs-data-gathering which you can attach to this bug report.

Comment 7 Mark 2008-01-01 21:19:35 UTC
I see mounting NFS then it fails and says network unreachable.

[nix4me@localhost ~]$ rpm -qV initscripts
..5....T c /etc/inittab


Comment 8 Jon Stanley 2008-01-01 21:26:31 UTC
Can you try the script that I posted in comment #6?  You can put that in
/etc/init.d/netfs (after backing up the original) and provide the output in the
file for further reference.

Comment 9 Mark 2008-01-01 21:31:15 UTC
Created attachment 290618 [details]
netfs-data-gathering during boot

Comment 10 Jon Stanley 2008-01-01 21:49:43 UTC
Very odd - loopback is configured but not eth0.  Hmmm...what are the contents of
/etc/sysconfig/network, and /etc/sysconfig/network-scripts/ifcfg-eth0?  May as
well throw in /etc/modprobe.conf, too - but I do see that r8169 is loaded, so
that should be correct.  Also, this seems silly, but could you verify that the
symlinks in /etc/rc3.d or /etc/rc5.d (depending on what runlevel you use) there
is really a symlink called S!0network and S25netfs?

Comment 11 Mark 2008-01-01 22:07:28 UTC
[nix4me@localhost ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain

[nix4me@localhost ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet
controller
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:1D:7D:A1:77:AD
ONBOOT=yes

[nix4me@localhost ~]$ cat /etc/modprobe.conf
alias eth0 r8169
alias snd-card-0 snd-hda-intel
options snd-card-0 index=0
options snd-hda-intel index=0

[nix4me@localhost rc3.d]$ ls
K01smartd                    K89dund           S25netfs
K01smolt                     K89netplugd       S26rsyslog
K02NetworkManagerDispatcher  K89pand           S26udev-post
K05saslauthd                 K89rdisc          S27messagebus
K10psacct                    K90network        S27setroubleshoot
K15httpd                     K91capi           S44acpid
K20nfs                       S00fedora-live    S50bluetooth
K24irda                      S00microcode_ctl  S80sendmail
K25sshd                      S05kudzu          S85gpm
K35nmb                       S06cpuspeed       S90ConsoleKit
K35smb                       S08ip6tables      S90crond
K50netconsole                S08iptables       S95atd
K69rpcsvcgssd                S08nvidia         S96avahi-daemon
K71lirc                      S09isdn           S97yum-updatesd
K73winbind                   S11auditd         S98cups
K73ypbind                    S12restorecond    S98haldaemon
K74nscd                      S13irqbalance     S98NetworkManager
K74ntpd                      S13rpcbind        S99anacron
K76openvpn                   S14nfslock        S99firstboot
K87multipathd                S15mdmonitor      S99local
K88nasd                      S18rpcidmapd
K88wpa_supplicant            S19rpcgssd

[nix4me@localhost rc5.d]$ ls
K01smartd                    K89dund           S25netfs
K01smolt                     K89netplugd       S26rsyslog
K02NetworkManagerDispatcher  K89pand           S26udev-post
K05saslauthd                 K89rdisc          S27messagebus
K10psacct                    K90network        S27setroubleshoot
K15gpm                       K91capi           S44acpid
K15httpd                     S00fedora-live    S50bluetooth
K20nfs                       S00microcode_ctl  S80sendmail
K24irda                      S05kudzu          S88nasd
K25sshd                      S06cpuspeed       S90ConsoleKit
K35nmb                       S08ip6tables      S90crond
K35smb                       S08iptables       S95atd
K50netconsole                S08nvidia         S96avahi-daemon
K69rpcsvcgssd                S09isdn           S97yum-updatesd
K71lirc                      S11auditd         S98cups
K73winbind                   S12restorecond    S98haldaemon
K73ypbind                    S13irqbalance     S98NetworkManager
K74nscd                      S13rpcbind        S99anacron
K74ntpd                      S14nfslock        S99firstboot
K76openvpn                   S15mdmonitor      S99local
K87multipathd                S18rpcidmapd
K88wpa_supplicant            S19rpcgssd

I am using freshly installed Fedora 8(installed yesterday) from the dvd
gnome-livecd spin directly from the website.

Comment 12 Jon Stanley 2008-01-01 22:57:42 UTC
I see the problem now - your network is being managed by NetworkManager rather
than statically (as it should be for a wired connection that you need all the
time).  Do a 'chkconfig NetworkManager off' and 'chkconfig network on' and these
problems should go away.

Comment 13 Mark 2008-01-02 00:01:37 UTC
Yes, that was the problem.  I think this behavior (use of network manager on a
machine with ethernet connection only) could use a bit of investigation.  Should
the installer have used network manager on my machine?

Thanks for the great triage session.  You asked the right questions and I posted
the needed results.



Comment 14 Jon Stanley 2008-01-02 00:49:47 UTC
I think that the situation there is that on the LiveCD, we can't be sure what
the usage scenario for the machine is.  IIRC, the 'installer' for the LiveCD
installation does little/nothing more than copy the bits to the hard drive.  In
a DVD or network installation, anaconda always configures the network
statically.  I'm honestly not sure who to bring this up with, it was certainly
confusing for both of us for a time.

Comment 15 Bill Nottingham 2008-01-07 19:43:57 UTC
*** Bug 389401 has been marked as a duplicate of this bug. ***

Comment 16 Bill Nottingham 2008-01-07 19:49:27 UTC
*** Bug 427658 has been marked as a duplicate of this bug. ***

Comment 17 Don Hoover 2009-03-16 20:17:21 UTC
There is also the problem of netfs starting to early in the init for a system that is a NFS client of itself.

Netfs starts up before nfsd and therefore will fail to mount any nfs filesystems that are mounted by the same system.

Netfs(currently 25) needs to be after nfsd (currently 60) in the init.