Red Hat Bugzilla – Bug 1010191
bg nfs mount option doesn't work in case of hostname lookup failures
Last modified: 2015-02-17 12:15:57 EST
Description of problem:
I have several NFS mounts defined in /etc/fstab. They tend to fail to mount at boot time. This likely happens because the mount attempt is started before the network is fully operational, and therefore before the system is able to resolve the hostname of the NFS servers using DNS. However as the mounts aren't essential to the boot process, this initial failure doesn't really matter all that much, as long as they get mounted eventually I'm happy.
Therefore I specify the "bg" option to instruct the mount process to keep trying to mount them until it succeeds. According to man 5 nfs:
If the bg option is specified, a timeout or failure
causes the mount(8) command to fork a child which con‐
tinues to attempt to mount the export. The parent imme‐
diately returns with a zero exit code. This is known as
a "background" mount.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Purge all "nameserver" entries from /etc/resolv.conf (required only to cause the exact same "System error" failures I see in my logs)
2. sudo mount nonexistant.domain.haha:/foo /mnt -o bg ; pgrep -f mount || echo no mount process running in background
Output from #2 is:
mount.nfs: Failed to resolve server nonexistant.domain.haha: System error
no mount process running in background
(If step #1 is omitted, the error message is instead "Name or service not known", but the result is the same - the bg option fails to work as advertised.)
A backgrounded mount process would appear in the process list, and (assuming I had specified a valid NFS server/export) the file system would eventually be mounted after reinstating the nameserver entry in /etc/resolv.conf.
These messages from /var/log/messages shed some light on what's going on:
Sep 20 09:33:52 echo systemd: Mounting /music...
Sep 20 09:33:52 echo mount: mount.nfs: Failed to resolve server nfsd.domain.tld: System error
Sep 20 09:33:52 echo systemd: Dependency failed for Remote File Systems.
Sep 20 09:33:52 echo systemd: music.mount mount process exited, code=exited status=32
Sep 20 09:33:52 echo systemd: Failed to mount /music.
This message is a notice that Fedora 19 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 19. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 19 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.