Page 1 of 1

[SOLVED] mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 11th, '13, 21:05
by pfaff
On my mageia3 systems, nfs mount entries in /etc/fstab are not mounted at boot time.

These mounts can be done manually after the system is up.

journalctl shows me that various things are being started by systemd before the network is available.

What can I do to ensure that systemd does not try to start things like nfs mounts and ntpdate while the network is not yet available,
or that it retries until it succeeds?

- eth0 is the only nic and it is configured statically, no dhcp.

- ifcfg_eth0 contains the line:
NM_CONTROLLED=no

- NetworkManager is disabled.

- The system is up-to-date with all available mageia3 updates.

- kernel is 3.8.13.4-desktop-1.mga3

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 12th, '13, 19:09
by doktor5000
ntpdate should only run when network has been started ... How did you configure ntpdate / ntpd?

For the NFS mounts, please mark them in fstab with the option _netdev which should ensure they are only mounted when network is available.
And please show the fstab entries for those NFS mounts.

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 13th, '13, 00:23
by pfaff
Thanks for your response. But please tell me you're wrong about requiring _netdev on nfs entries in fstab. :(

NFS mounts have worked for me for the past twenty years, through SunOS, Irix, Solaris, HPUX, AIX, and every flavour of linux I've used including every release of mandrake and mandriva since the first release in 199x, without having to add _netdev to the fstab entry.

Has the migration to systemd made it such that nfs mount entries in fstab now require _netdev? Was this by design or is it just a bug waiting to be fixed?

I completely understand why I would want _netdev on, say, an fstab entry for a filesystem that comes from an iSCSI target, but why wouldn't the logic that looks for _netdev also recognize "nfs" and work similarly.

In any case, I already tried _netdev since I do use that for iSCSI target filesystem mounts, but it didn't help with the nfs mounts.

Here's an example of an nfs mount on one of my mageia3 systems that does not mount at boot time but can be mounted manually when the system is up and I've logged in with ssh:

192.168.10.10:/share/home /home nfs tcp,vers=3,hard,intr,nodev,nosuid 0 0

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 13th, '13, 19:46
by doktor5000
As far as i'm a ware your should mark nfs/remote filesystems (sshfs, cifs, webdav) with _netdev in fstab, to allow systemd get the ordering of services correct. There's also nofail option to allow boot/login to proceed if that filesystem is not present during login. This is the case already since Mageia 2, you may want to check https://wiki.mageia.org/en/Mageia_2_Err ... t_in_fstab
You may also want to check the manpage of mount command for more details on this.

BTW: All the operating systems you listed use System V init AFAIK, and not systemd ;)

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 15th, '13, 18:56
by pfaff
I've followed your advice and added both _netdev and nofail to the mount options for the nfs entry in fstab, so I now have this:

192.168.10.10:/share/home /home nfs _netdev,nofail,tcp,vers=3,hard,intr,nodev,nosuid 0 0

Unfortunately, this still does not mount automatically at boot time. journalctl shows that the mount failure is due to the
fact that the network is not ready:

Oct 15 12:05:55 beidou mount[2166]: mount.nfs: Network is unreachable
Oct 15 12:05:55 beidou systemd[1]: home.mount mount process exited, code=exited
Oct 15 12:05:55 beidou systemd[1]: Failed to mount /home.
Oct 15 12:05:55 beidou systemd[1]: Unit home.mount entered failed state

and this is despite the fact that I now have _netdev and nofail in the fstab entry.

Any suggestions as to what to try next to determine why systemd is not waiting for the network to be ready before trying to
do this nfs mount?

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 15th, '13, 20:45
by doktor5000
You cannot use nofail for /home, as it's critical for login process, DM must wait until this is mounted before a login can happen.

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 15th, '13, 21:15
by pfaff
That's even more of a reason that the nfs mount should succeed at boot time. You say DM needs /home, but in this case /home needs nfs, and nfs needs network, but network is not ready at the time systemd tries to do the nfs mount of /home. Clearly something in the systemd dependencies is lacking. Do you not agree?

If I remove the "nofail" option it still fails to mount at boot time, so that suggestion presumably has nothing to do with the problem I'm trying to solve.

And it's possible that I'm not even booting to graphical (runlevel5)? I may be booting to multi_user (runlevel3) in which case DM is not started and so /home isn't critical to the boot process, right?. So, again, this issue about nofail and /home is not relevant to the problem I'm trying to solve. I only added the nofail option since you brought it up earlier.

I'm back to my earlier question, which may not have been expressed clearly enough so here it is again:

How do I make sure that systemd waits for the network to be available before it tries to do an nfs mount of /home?

You suggested I use _netdev. I've done that but it still fails.

Do you have any more suggestions? All suggestions are welcome!

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 15th, '13, 21:37
by colin
Not read the full thread but the typical problems are: 1) add _netdev to the options in /etc/fstab 2) Use nofail option in fstab for all non-critical partitions (e.g. anything other than /, /usr, /var and /home) and 3) Make sure network-up service is enabled (systemctl enable network-up.service).

Will re-read later to add more info (unless this magically works!)

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 15th, '13, 22:15
by pfaff
Thanks, Colin. You rock.

Suggestion #3 solved the problem. In addition, neither _netdev or nofail are needed, as I would expect.

P.S. Any ideas about my other recent post regarding iSCSI target connections at boot time?

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 16th, '13, 07:09
by isadora
Pfaff, now you got the issue solved, please mark the topic accordingly.

One can do so, by editing the title/subject in the first message of the topic.
Just place [SOLVED] in front of it, and you're done.

Thanks inadvance. ;)

Re: mageia3 fstab nfs not mounted at boot time

PostPosted: Oct 16th, '13, 20:41
by doktor5000
colin wrote: 3) Make sure network-up service is enabled (systemctl enable network-up.service).

Could've sworn that this is enabled by default ... ?