Why NFS service fails to start with error mount: special device does not exist ?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7
  • NFS

Issue

  • NFS Service not getting started
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: systemd-fsck@dev-vg_foobar_foob\x2d3_data-foo.service failed.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Mounting /export/home/foo...  
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Starting NFS Mount Daemon...
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Starting NFSv4 ID-name mapping service...
Sep 19 11:09:20 rhel7.redhat.com mount[59015]: mount: special device /dev/vg_foobar_foob/foo does not exist
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: export-home-foo.mount mount process exited, code=exited status=32
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Failed to mount /export/home/foo.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Dependency failed for NFS server and services.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Dependency failed for NFSv4 ID-name mapping service.

Resolution

  • Remove unwanted entry from /run/systemd/generator/nfs-server.service.d/order-with-mounts.conf and reload systemctl daemon.

Root Cause

  • Each time we export a directory from NFS server and reload systemctl daemon, /run/systemd/generator/nfs-server.service.d/order-with-mounts.conf gets updated with exported shares.
  • In our case there was an entry in /run/systemd/generator/nfs-server.service.d/order-with-mounts.conf for /export/home/foo as below.
RequiresMountsFor=/export/home/foo

Diagnostic Steps

  • Log messages indicate that systemd was trying to mount /export/home/foo before starting NFS daemon.
Sep 19 10:44:06 rhel7.redhat.com systemd[1]: Starting File System Check on /dev/vg_foobar_foob/foo...
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: systemd-fsck@vg_foobar_foob\x2d3_data-foo.service: main process exited, code=exited, status=1/FAILURE
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Failed to start File System Check on /dev/vg_foobar_foob/foo.  <---------Issue
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Unit systemd-fsck@dev-vg_foobar_foob\x2d3_data-foo.service entered failed state.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: systemd-fsck@dev-vg_foobar_foob\x2d3_data-foo.service failed.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Mounting /export/home/foo...  <---------------Issue 
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Starting NFS Mount Daemon...
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Starting NFSv4 ID-name mapping service...
Sep 19 11:09:20 rhel7.redhat.com mount[59015]: mount: special device /dev/vg_foobar_foob/foo does not exist
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: export-home-foo.mount mount process exited, code=exited status=32
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Failed to mount /export/home/foo.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Dependency failed for NFS server and services.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Dependency failed for NFSv4 ID-name mapping service.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Job nfs-idmapd.service/start failed with result 'dependency'.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Dependency failed for NFS Mount Daemon.
Sep 19 11:09:20 rhel7.redhat.com systemd[1]: Job nfs-mountd.service/start failed with result 'dependency'.
  • Further investigation revealed that,neither /export/home/foo was exported nor the corresponding block device exist.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments