Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a couple of servers in a VPC in Amazon EC2. One of them acts as a NFS server, and one of them as a client.

I recently noticed a problem in the client that after a reboot, it would reject all SSH connections, presumably because SSH was not running. After transferring the EBS volume to another instance and taking a peek inside, I commented out the NFS line in /etc/fstab and tried attaching it back to the server and booting it. Lo and behold, I was able to connect with SSH.

It seems that having the following line in my fstab is breaking everything on boot:

10.0.0.1:/export/share /mnt/shared nfs auto 0 0

Why is this causing SSH to fail to start? How can I have NFS automatically mount on boot without breaking networking/SSH on the system?

I've checked that sudo mount -a works properly, so it seems that there isn't an inherent problem in the fstab command. What's breaking and how can I fix it?

share|improve this question
    
Does disabling automounting, then manually mounting it after SSH has loaded successfully also break SSH? –  Chris Down Apr 18 '13 at 4:13
    
Nope, it only breaks on boot when it's in fstab. –  Naftuli Tzvi Kay Apr 18 '13 at 4:32
    
Does the SSH init script actually run? –  Chris Down Apr 18 '13 at 5:04
    
What ami are you using? The latest RHEL or something else? I found a bug in the latest RHEL image in rc.local that was causing ssh to fail to start on reboot. After I fixed that things were good. A bad nfs config should not conflict with SSH as long as you're not clobbering your home directory preventing access to your ssh credentials –  John Apr 18 '13 at 15:56
    
Ubuntu 12.04 64bit. –  Naftuli Tzvi Kay Apr 18 '13 at 17:56

2 Answers 2

Try using nobootwait or nofail as mount options in the fstab.

share|improve this answer

You need to add one more option when mounting nfs , we always use this

Example

10.0.0.1:/export/share /mnt/shared nfs _netdev,noatime,intr,auto 0 0

These are mount options : 'noatime' improves access rate, and 'auto' tells the Rpi to aumount the NFS shares on startup.

from man mount

_netdev The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).

share|improve this answer
    
Even with that exact line in my fstab, SSH doesn't start up. Comment it out, and it starts. –  Naftuli Tzvi Kay Apr 18 '13 at 21:55
    
what is sequence in fstab, is that nfs entry at last ? –  Rahul Patil Apr 19 '13 at 3:25
    
Yes, it's at the last entry in fstab. –  Naftuli Tzvi Kay Apr 19 '13 at 4:24
    
have you find any error in logs /var/log/syslog or /var/log/messages –  Rahul Patil Apr 19 '13 at 4:38
    
Nope, nothing significant in there. –  Naftuli Tzvi Kay Apr 19 '13 at 23:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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