Bug 5890 - nfs mounts in fstab fail
Summary: nfs mounts in fstab fail
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Colin Guthrie
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-13 20:09 CEST by Frank Griffin
Modified: 2012-08-24 16:18 CEST (History)
0 users

See Also:
Source RPM: systemd
CVE:
Status comment:


Attachments
edited syslog starting at boot (26.65 KB, text/plain)
2012-05-15 18:52 CEST, Frank Griffin
Details

Description Frank Griffin 2012-05-13 20:09:24 CEST
As of recently, NFS mounts listed in /etc/fstab are failing during startup,but work fine if issued manually once the system is up.

syslog gives:

May 13 06:22:58 localhost kernel: [   40.658499] RPC: Registered tcp NFSv4.1 backchannel transport module.
May 13 06:22:58 localhost mount[2962]: mount.nfs: No such device
May 13 06:22:58 localhost systemd[1]: mnt-ftgme2.mount mount process exited, code=exited status=32

so it looks like the fstab mounts are being attempted either before the network is up or before NFS itself is up.
Manuel Hiebel 2012-05-14 17:00:08 CEST

Assignee: bugsquad => mageia

Comment 1 Colin Guthrie 2012-05-15 15:37:36 CEST
It's possibly just an ordering thing... Likely related (in part) to https://bugzilla.redhat.com/show_bug.cgi?id=786050

Can you modify:

/etc/rc.d/init.d/nfs-common

and make the LSB line:

# Provides: nfs-common $network


This should make nfs-common start as part of network.target which remote-fs-pre.target has to start after. This should ensure that the mounts only happen after nfs-common has started.
Comment 2 Frank Griffin 2012-05-15 18:51:39 CEST
Tried the nfs-common change.  Some of the mounts work, and some of them fail.

I'll attach an edited syslog.

One odd thing is that nfs-common appears to be started VERY close to the start of the boot, and WAY before the network is up.
Comment 3 Frank Griffin 2012-05-15 18:52:40 CEST
Created attachment 2318 [details]
edited syslog starting at boot
Comment 4 Frank Griffin 2012-05-15 18:59:13 CEST
And just to complete the picture, after booting:

[root@ftgme2 ftg]# df
Filesystem               Size  Used Avail Use% Mounted on
rootfs                    20G   16G  3.8G  81% /
devtmpfs                 3.8G     0  3.8G   0% /dev
tmpfs                    3.8G  611M  3.2G  16% /dev/shm
tmpfs                    3.8G  1.3M  3.8G   1% /run
/dev/sda2                 20G   16G  3.8G  81% /
tmpfs                    3.8G     0  3.8G   0% /sys/fs/cgroup
none                     3.8G  6.2M  3.8G   1% /tmp
/dev/sda10               147G  135G  4.5G  97% /data3
/dev/sda7                126G   80G   41G  67% /data
/dev/sda12               297G   49G  234G  18% /data2
/dev/sda6                 16G  3.9G   12G  26% /usr/local
/dev/sda8                126G  113G  7.3G  94% /mnt/VirtualBox
/dev/sda11               128G   93G   30G  76% /oma
ftgfiles1:/mnt/backups/  201G  137G   54G  72% /mnt/backups
ftglap:/                  20G   17G  2.3G  88% /mnt/ftglap
[root@ftgme2 ftg]# mount -t nfs -a
mount.nfs: /mnt/backups is busy or already mounted
[root@ftgme2 ftg]# df
Filesystem                Size  Used Avail Use% Mounted on
rootfs                     20G   16G  3.8G  81% /
devtmpfs                  3.8G     0  3.8G   0% /dev
tmpfs                     3.8G  611M  3.2G  16% /dev/shm
tmpfs                     3.8G  1.3M  3.8G   1% /run
/dev/sda2                  20G   16G  3.8G  81% /
tmpfs                     3.8G     0  3.8G   0% /sys/fs/cgroup
none                      3.8G  6.2M  3.8G   1% /tmp
/dev/sda10                147G  135G  4.5G  97% /data3
/dev/sda7                 126G   80G   41G  67% /data
/dev/sda12                297G   49G  234G  18% /data2
/dev/sda6                  16G  3.9G   12G  26% /usr/local
/dev/sda8                 126G  113G  7.3G  94% /mnt/VirtualBox
/dev/sda11                128G   93G   30G  76% /oma
ftgfiles1:/mnt/backups/   201G  137G   54G  72% /mnt/backups
ftglap:/                   20G   17G  2.3G  88% /mnt/ftglap
ftglap:/data/              64G   37G   25G  60% /mnt/ftglap.data
ftgfiles1:/mnt/cauldron/  104G   69G   30G  70% /mnt/cauldron
ftgfiles1:/mnt/cooker/    119G  110G  2.6G  98% /mnt/cooker
ftgfiles1:/mnt/plf/       7.9G  3.4G  4.2G  45% /mnt/plf
ftgfiles1:/usr/local/     4.0G  2.1G  1.7G  56% /mnt/ftgfiles1.usr.local
[root@ftgme2 ftg]#
Comment 5 Colin Guthrie 2012-05-17 00:29:05 CEST
OK, so there are a few issues here it seems.

1. rpcbind.service is totally disconnected to rpcbind.target which is used as a synchronisation point. Adding the following lines to rpcbind.service should fix that:

Before=rpcbind.target remote-fs-pre.target
Wants=rpcbind.target


2. Even with these fixes which allows rpcbind to start properly and for nfs-common.service to wait until rpcbind is ready before it starts, I still see a problem. nfs-common.service is not ordered before remote-fs-pre.target which it needs to be. Sadly, as it's a non-native unit, the only way to do this is to adjust remote-fs-pre.target itself and put in a "After=nfs-common.service" line.

I think these two changes should fix things, but still need to test.
Comment 6 Colin Guthrie 2012-05-17 00:36:01 CEST
OK, so that seemed to work OK for me.

Here are the changes I made. Can you test at your end and see if it works for you too?

(Note you can copy the files to the /etc/ tree instead and make the modifications there - that's what I did).

--- /lib/systemd/system/rpcbind.service	2012-04-28 04:44:08.000000000 +0100
+++ /lib/systemd/system/rpcbind.service	2012-05-16 23:11:46.630657069 +0100
@@ -2,6 +2,8 @@
 Description=RPC bind service
 Requires=rpcbind.socket
 After=syslog.target network.target
+Before=rpcbind.target remote-fs-pre.target
+Wants=rpcbind.target
 
 [Service]
 Type=forking
--- /lib/systemd/system/remote-fs-pre.target	2012-05-10 22:16:45.000000000 +0100
+++ /lib/systemd/system/remote-fs-pre.target	2012-05-16 23:27:11.056224983 +0100
@@ -9,4 +9,4 @@
 
 [Unit]
 Description=Remote File Systems (Pre)
-After=network.target
+After=network.target nfs-common.service
Comment 7 Colin Guthrie 2012-05-17 11:29:46 CEST
Oh and you should revert my previous suggested change in nfs-common initscript otherwise there will be a deadlock... (rpcbind.service starts after network.target but due to the "Required-Start: $portmap" lsb header, nfs-common will only start after rpcbind.target and thus after network.target too).
Comment 8 Frank Griffin 2012-05-17 14:56:09 CEST
That did it.  Working perfectly now, thanks.
Comment 9 Colin Guthrie 2012-05-20 14:09:53 CEST
OK, this fix is now pushed. Thanks for testing.

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 10 Frank Griffin 2012-08-24 16:18:07 CEST
In current cauldron, the fixed line in remote-fs-pre.target no longer contains "nfs-common-service", but has "nss-lookup.target" in its place.  Is this correct, or did the fix get lost ?

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