4

I'm running latest version of Red Hat Enterprise Linux Server release 7.0 (Maipo):

[root@ip-10-184-161-46 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.0 (Maipo)
[root@ip-10-184-161-46 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.el7.x86_64
[root@ip-10-184-161-46 ~]# 

I have following entries inside of my /etc/fstab:

[root@ip-10-184-161-46 ~]# grep -v ^# /etc/fstab | tail -2
UUID=0f89adb9-ac88-4be5-b6cc-52a05bbdb825 /                       xfs     defaults        1 1
ip-10-164-175-246.ec2.internal:/var/www/html    /var/www/html/  nfs4    defaults    0   2
[root@ip-10-184-161-46 ~]# 

after instance's reboot, I saw following inside of rsyslog.service for systemd:

Jul 19 22:10:03 ip-10-184-161-46 systemd: Job ip\x2d10\x2d164\x2d175\x2d246.ec2.internal:-var-www-html.device/start timed out.
Jul 19 22:10:03 ip-10-184-161-46 systemd: Timed out waiting for device ip\x2d10\x2d164\x2d175\x2d246.ec2.internal:-var-www-html.device.
Jul 19 22:10:03 ip-10-184-161-46 systemd: Dependency failed for File System Check on /ip-10-164-175-246.ec2.internal:/var/www/html.
Jul 19 22:10:03 ip-10-184-161-46 systemd: Dependency failed for /var/www/html.
Jul 19 22:10:03 ip-10-184-161-46 systemd: Dependency failed for Remote File Systems.
Jul 19 22:10:03 ip-10-184-161-46 systemd: 
Jul 19 22:10:03 ip-10-184-161-46 systemd: 
Jul 19 22:10:03 ip-10-184-161-46 systemd: 
Jul 19 22:10:03 ip-10-184-161-46 systemd: 

manual way:

[root@ip-10-184-161-46 ~]# mount -a
[root@ip-10-184-161-46 ~]# echo $?
0
[root@ip-10-184-161-46 ~]# mount | grep '/var/www/html'
ip-10-164-175-246.ec2.internal:/var/www/html on /var/www/html type nfs4 (rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.184.161.46,local_lock=none,addr=10.164.175.246)
[root@ip-10-184-161-46 ~]# 

nfs.service is running on another instance and uptime suggests that it didn't go down, so I'm trying to understand why systemd was not able to mount it upon boot (Timed out) yet trying to mount it manually was NOT an issue.

Any ideas why systemd couldn't mount it on boot?

  • You forgot to mention which Linux distribution, and whether you are up to date. – Michael Hampton Jul 22 '14 at 2:52
  • @MichaelHampton Thanks for pointing this out to me) I just updated my question. I'm running RHEL7. – alexus Jul 22 '14 at 2:59
4

It could be that it's trying to mount the device before it's brought eth0 up (and therefore has no network connection). You can fix this by simply appending _netdev to the options portion of the fstab (i.e; defaults,_netdev).

_netdev is a special flag which instructs the kernel that this is a network based device, so will not mount without a network connection. Therefore, upon bootup, it will mount all devices that do not have this flag, brings up the network connection (which almost always happens after the fact), then brings up _netdev devices.

  • This worked for me with the combination of specifying nfs4 as the filesystem. Nice tip. – Christian Jul 29 '14 at 10:16
  • @dannosaur, i've tried it but it didn't work for me (my dmesg's pastebin.com/cL4CGsiM). manual mount -a mounts it without any issue. – alexus Sep 13 '14 at 13:35
0

... per redhat's 8.3. NFS Client Configuration

changing line from:

ip-10-146-180-60.ec2.internal:/var/www/html /var/www/html/  nfs4     defaults,_netdev   0   2

to:

ip-10-146-180-60.ec2.internal:/var/www/html /var/www/html/  nfs defaults    0   0

solved my issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.