[SOLVED] mageia3 fstab nfs not mounted at boot time

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] mageia3 fstab nfs not mounted at boot time

Postby pfaff » Oct 11th, '13, 21:05

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
Last edited by pfaff on Oct 16th, '13, 18:05, edited 1 time in total.
pfaff
 
Posts: 11
Joined: Feb 13th, '12, 20:13

Re: mageia3 fstab nfs not mounted at boot time

Postby doktor5000 » Oct 12th, '13, 19:09

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.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: mageia3 fstab nfs not mounted at boot time

Postby pfaff » Oct 13th, '13, 00:23

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
pfaff
 
Posts: 11
Joined: Feb 13th, '12, 20:13

Re: mageia3 fstab nfs not mounted at boot time

Postby doktor5000 » Oct 13th, '13, 19:46

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 ;)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: mageia3 fstab nfs not mounted at boot time

Postby pfaff » Oct 15th, '13, 18:56

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?
pfaff
 
Posts: 11
Joined: Feb 13th, '12, 20:13

Re: mageia3 fstab nfs not mounted at boot time

Postby doktor5000 » Oct 15th, '13, 20:45

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.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: mageia3 fstab nfs not mounted at boot time

Postby pfaff » Oct 15th, '13, 21:15

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!
pfaff
 
Posts: 11
Joined: Feb 13th, '12, 20:13

Re: mageia3 fstab nfs not mounted at boot time

Postby colin » Oct 15th, '13, 21:37

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!)
colin
 
Posts: 53
Joined: Jul 25th, '11, 11:15

Re: mageia3 fstab nfs not mounted at boot time

Postby pfaff » Oct 15th, '13, 22:15

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?
pfaff
 
Posts: 11
Joined: Feb 13th, '12, 20:13

Re: mageia3 fstab nfs not mounted at boot time

Postby isadora » Oct 16th, '13, 07:09

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. ;)
..........bird from paradise..........

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
—Antoine de Saint-Exupéry
User avatar
isadora
 
Posts: 2763
Joined: Mar 25th, '11, 16:03
Location: Netherlands

Re: mageia3 fstab nfs not mounted at boot time

Postby doktor5000 » Oct 16th, '13, 20:41

colin wrote: 3) Make sure network-up service is enabled (systemctl enable network-up.service).

Could've sworn that this is enabled by default ... ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest