mounting nfs not working at boot

I have installed Open Suse 12.1 and I’m having issues mounting the NFS volumes
If I do a mount -a after the boot is done everything goes fine, but I would like to fix it.
Seems like a dependency or name resolution issue. (My nfs server name is nfs)
Here is the messages logs at boot time
Jun 9 13:07:51 xbmcpr mount[1065]: mount.nfs: Failed to resolve server nfs: Name or service not known
Jun 9 13:07:51 xbmcpr mount[1069]: mount.nfs: Failed to resolve server nfs: Name or service not known
Jun 9 13:07:51 xbmcpr nscd[1023]: Starting Name Service Cache Daemon…done
Jun 9 13:07:51 xbmcpr systemd[1]: mnt-media.mount mount process exited, code=exited status=32
Jun 9 13:07:51 xbmcpr systemd[1]: Job remote-fs.target/start failed with result ‘dependency’.
Jun 9 13:07:51 xbmcpr systemd[1]: Unit mnt-media.mount entered failed state.
Jun 9 13:07:51 xbmcpr systemd[1]: mnt-pics.mount mount process exited, code=exited status=32
Jun 9 13:07:51 xbmcpr pcscd[944]: Starting PC/SC smart card daemon (pcscd): …done
Jun 9 13:07:51 xbmcpr systemd[1]: Unit mnt-pics.mount entered failed state.

Here is the /fstab
/dev/disk/by-id/ata-Maxtor_6Y160M0_Y45LAD5E-part2 swap swap defaults 0 0
/dev/disk/by-id/ata-Maxtor_6Y160M0_Y45LAD5E-part3 / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-Maxtor_6Y160M0_Y45LAD5E-part1 /boot ext4 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

nfs:/vgdata/pch /mnt/media nfs defaults 0 0
nfs:/vgdata/docs/Pics /mnt/pics nfs defaults 0 0
nfs:/vgdata/docs/Mp3 /mnt/mp3 nfs defaults 0 0

On Sat, 09 Jun 2012 16:46:02 +0000, qsummon wrote:

> I have installed Open Suse 12.1 and I’m having issues mounting the NFS
> volumes If I do a mount -a after the boot is done everything goes fine,
> but I would like to fix it.

If you’re using NetworkManager, that can cause the network to not start
before the GUI starts (though that /seems/ to be fixed on my systems),
and without the network, NFS mounts wouldn’t be mounted.

You could try switching to using the ifup method and see if that helps.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

The problem is that rpcbind is started too late in systemd.
It is neither a network manager issue, nor openSUSE specific.

I use this workaround (under openSUSE and Fedora) to mount my file server on machines booting with systemd : http://forums.opensuse.org/english/other-forums/development/programming-scripting/469832-running-commands-depend-process-being-started-after-local.html.

It works in 90% of the cases. When it doesn’t, I mount manually. The other option is to use sysinit.

This is what it’s all about. Have experienced this on a 12.1 server too. The 11.4 install on the same machine, same configs worked fine, so I tried moving 12.1 back from systemd to sysvinit. Issue solved.

On 2012-06-09 20:26, please try again wrote:

> The problem is that rpcbind is started too late in systemd.
> It is neither a network manager issue, nor openSUSE specific.
>
> I use this workaround (under openSUSE and Fedora) to mount my file
> server on machines booting with systemd : http://tinyurl.com/7lhwutx.

I read recently that systemd disregards completely the idea of starting
something after another. Instead it creates a socket or whatever and relies
on activating it when something wants to read it. fstab is (or will be)
superseded, filesystems are mounted when something want to read them, etc.
I did not understand it completely, but it scares me a lot.

The article is in Spanish, so it is no use for you, I’m afraid.

systemd, otro reemplazo de init


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

This systemd - ArchWiki article mentions

Remote filesystem mounts

If you have NFS mounts listed in /etc/fstab then systemd will attempt to mount them but will typically do so too early (before networking has been configured). To get the timing correct we need to tell systemd explicitly that the mount depends on networking and rpc.statd. To do this, create the following file:

/etc/systemd/system/<mount-unit-name>.mount



[Unit]  Description=<mountpoint>  Wants=rpc-statd.service  After=network.target rpc-statd.service     [Mount]  What=<server>:<share>  Where=<mountpoint>  Type=nfs

In the above:

  • mount-unit-name is the full path to the mountpoint in an escaped format. For example, a mount unit for /usr/local must be named usr-local.mount.
  • mountpoint is the local mountpoint
  • server:share specifies the remote filesystem in the same manner as for /etc/fstab

See systemd.unit(5) and systemd.mount(5) for further details.
A similar approach will probably be required for other remote filesystem types such as nfs4 and cifs.
Alternatively, you can mark these entries in /etc/fstab with the x-systemd.automount and x-systemd.device-timeout=# options (see systemd.mount(5)). Make sure that if you also include defaults as a mount option, that you override the implicit auto with noauto. This will cause the device to be mounted on first access, similar to Autofs.

This Gentoo Wiki page also has some work-in-progress comments:

systemd - Gentoo Linux Wiki

On 2012-06-10 01:36, deano ferrari wrote:
>
> This https://wiki.archlinux.org/index.php/Systemd article mentions
>> REMOTE FILESYSTEM MOUNTS
>> If you have NFS mounts listed in /etc/fstab then systemd will attempt
>> to mount them but will typically do so too early (before networking has
>> been configured). To get the timing correct we need to tell systemd
>> explicitly that the mount depends on networking and rpc.statd. To do
>> this, create the following file:
>>
>> /etc/systemd/system/<mount-unit-name>.mount

What an horrible solution. They really broke fstab :-/


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

IMHO, this is one area where all the dependencies are likely to vary between different set-ups, and so fraught with potential complications. Here’s an old Fedora thread which typifies some o the discussions I’ve read on the subject:

Fedora 15: NFS mount in fstab hangs boot [Archive] - FedoraForum.org

I note that man systemd.mount mentions

/etc/fstabMount units may either be configured via unit files, or via /etc/fstab (see fstab(5) for details).
When reading /etc/fstab a few special mount options are understood by systemd which influence how dependencies are created for mount points from /etc/fstab. systemd will create a dependency of type Wants from either local-fs.target or remote-fs.target, depending whether the file system is local or remote. If x-systemd.automount is set, an automount unit will be created for the file system. See systemd.automount(5) for details. If x-systemd.device-timeout= is specified it may be used to configure how long systemd should wait for a device to show up before giving up on an entry from /etc/fstab. Specify a time in seconds or explicitly specifiy a unit as s, min, h, ms.
If a mount point is configured in both /etc/fstab and a unit file, the configuration in the latter takes precedence.

but from what I’ve read, the various fstab options for remote file systems appear not to work in some cases.

I’d be interested in hearing others experiences about this.

I thought this may be useful to others who come searching:

http://www.happyassassin.net/2011/05/12/cute-systemd-trick-of-the-day-auto-mounting-remote-shares/

deano ferrari wrote:
> I thought this may be useful to others who come searching:
>
> http://tinyurl.com/3cshybt

“So boot runs as fast as possible, and as soon as you actually try to
access the share, it gets mounted. Thanks, systemd!”

So instead of bringing up a system to an operational, usable state, it’s
brought up to a state where the first time any operation is tried,
there’s a long delay?? NO THANKS, systemd. What a *$£! stupid idea.

When I boot a system, I want it to work fully after it’s finished
booting. And work properly, including performance targets.

On 2012-06-11 12:05, Dave Howorth wrote:
> deano ferrari wrote:
>> I thought this may be useful to others who come searching:
>>
>> http://tinyurl.com/3cshybt

Someone on the mail lists just told me of the
“noauto,comment=systemd.automount” trick, that works at least on Fedora but
perhaps not in openSUSE (unknown).

> “So boot runs as fast as possible, and as soon as you actually try to
> access the share, it gets mounted. Thanks, systemd!”

Wow :frowning:

> So instead of bringing up a system to an operational, usable state, it’s
> brought up to a state where the first time any operation is tried,
> there’s a long delay?? NO THANKS, systemd. What a *$£! stupid idea.
>
> When I boot a system, I want it to work fully after it’s finished
> booting. And work properly, including performance targets.

Indeed. And I want to know soon if there is a problem, not when someone
actually tries to use that mount. I may want to use some type of
automounting, or I may not. Now I don’t get the choice :-/


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I have replaced systemd with sysvinit and completely solved the issue. I have no issue with the system to take a couple of more seconds to boot and I’m using the same fstab on all my servers/desktop (This is the first one with version 12.1)
Thank you all. Looks like I will pass on systemd for a while
:slight_smile:

On 2012-06-12 00:36, qsummon wrote:
> Thank you all. Looks like I will pass on systemd for a while

The problem is that they want to remove systemv. 12.2 is going to have it,
but who knows 12.3 :frowning:


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Really?
What is the purpose to replace something that has been working for years and replace it for something that is failing in something basic like checking dependencies?
I have no issues with systemd, but I would like to be able to replace it for sysvinit.

That’s why I “hacked” systemd rather than switching back to sysvinit. I wouldn’t say that I like it but … what else can you do?

On 2012-06-12 21:36, please try again wrote:
>
> robin_listas;2468815 Wrote:
>> On 2012-06-12 00:36, qsummon wrote:
>>> Thank you all. Looks like I will pass on systemd for a while
>>
>> The problem is that they want to remove systemv. 12.2 is going to have
>> it, but who knows 12.3 :frowning:
>
> That’s why I “hacked” systemd rather than switching back to sysvinit. I
> wouldn’t say that I like it but … what else can you do?

Yeah :frowning:


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Hey…
Is there any official fix for this? I have installed a new system and I just want to mount the NFS like I use to do it for decades… (is that too much to ask?? :slight_smile: )
I’m having the same issues. System boot too fast but not all the volumes get properly mounted (/etc/fstab)…
Thanks
Happy new year!

Trying to mount a directory from another openSuse12.2 to this one I stumbled over this thread. This discouraged me a bit but then I remembered that in Yast there is a NFS Client and NFS Server and decided to set up the server and then on the current machine the client and see if it will be mounted. To my surprise it was. I checked again my fstab where i have beside other mounts a samba mount(cifs) and this nfs mount. I was thinking that restarting might mess up something and surely it did. The nfs mount is still active after restart but the smb(cifs) is complaining that only root can mount it. It was working before. Is it because the 2 of them cannot coexist? I doubt it but I’m sure some of you would know that and answer me.
Here is some extracts from /var/log/messages:

Jan 31 22:14:26 bonaire cifs[622]: Mount CIFS File Systems
Jan 31 22:14:27 bonaire cifs[622]: from /etc/fstab .mount error(101): Network is unreachable
Jan 31 22:14:27 bonaire kernel:    33.572607] CIFS VFS: Error connecting to socket. Aborting operation
Jan 31 22:14:27 bonaire kernel:    33.572671] CIFS VFS: cifs_mount failed w/return code = -101
Jan 31 22:14:27 bonaire cifs[622]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Jan 31 22:14:27 bonaire cifs[622]: ..done
Jan 31 22:14:27 bonaire kernel:    33.726989] CIFS VFS: Error connecting to socket. Aborting operation
Jan 31 22:14:27 bonaire kernel:    33.727536] CIFS VFS: cifs_mount failed w/return code = -101
Jan 31 22:14:27 bonaire mount[652]: mount error(101): Network is unreachable
Jan 31 22:14:27 bonaire mount[652]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Jan 31 22:14:27 bonaire mount[653]: mount.nfs4: mount system call failed
Jan 31 22:14:27 bonaire systemd[1]: home-dan-australia.mount mount process exited, code=exited status=32
Jan 31 22:14:27 bonaire systemd[1]: Job postfix.service/start failed with result 'dependency'.
Jan 31 22:14:27 bonaire systemd[1]: Job remote-fs.target/start failed with result 'dependency'.
Jan 31 22:14:27 bonaire systemd[1]: Unit home-dan-australia.mount entered failed state.
Jan 31 22:14:27 bonaire systemd[1]: home-dan-australia2.mount mount process exited, code=exited status=32
Jan 31 22:14:27 bonaire systemd[1]: Unit home-dan-australia2.mount entered failed state.
Jan 31 22:14:27 bonaire bluez-coldplug[659]: ..done
Jan 31 22:14:27 bonaire mount[682]: mount.nfs4: mount system call failed
Jan 31 22:14:27 bonaire kernel:    33.898875] CIFS VFS: Error connecting to socket. Aborting operation
Jan 31 22:14:27 bonaire mount[681]: mount error(101): Network is unreachable
Jan 31 22:14:27 bonaire kernel:    33.899573] CIFS VFS: cifs_mount failed w/return code = -101
Jan 31 22:14:27 bonaire mount[681]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Jan 31 22:14:27 bonaire systemd[1]: home-dan-australia2.mount mount process exited, code=exited status=32
Jan 31 22:14:27 bonaire systemd[1]: Job remote-fs.target/start failed with result 'dependency'.
Jan 31 22:14:27 bonaire systemd[1]: Unit home-dan-australia2.mount entered failed state.
Jan 31 22:14:27 bonaire systemd[1]: home-dan-australia.mount mount process exited, code=exited status=32
Jan 31 22:14:27 bonaire systemd[1]: Unit home-dan-australia.mount entered failed state.

I know that I’m deviating from the thread but it is somehow related and dependent on it. If it should be a different thread than please let me know and I will open a new one. maybe the samba mount should be delayed until the network is available, but how did it work prior to this?
thank you

How do you expect something to be mounted over the network if network is not available?

but how did it work prior to this?

Describe what “prior to this” means. If you changed something, you never told it.

Nor, did dmera share his /etc/fstab config…