Ubuntu – EC2 instance ssh connection not working

amazon ec2fstabsshUbuntu

I tried to connect to my EC2 Ubuntu LTS instance but I failed.
The error message I got like below:
ssh: connect to host ec2-79-125-83-13.eu-west-1.compute.amazonaws.com port 22: Connection refused

I checked the instance log, the last lines like below:

The disk drive for /dev/xvdf is not ready yet or not present. 
Continue to wait, or Press S to skip mounting or M for manual recovery 

What could be the problem here?

Could you help me please?

Best Answer

Probably an /etc/fstab issue. Ubuntu is trying to mount a partition present in /etc/fstab and yet not able to find that partition i.e. /dev/xvdf.

In order to troubleshoot this, you need to -

1) shutdown this instance

2) Launch another instance

3) Attach the root EBS of this instance to the new instance from step(2)

4) mount the EBS from step(3) , say in /mnt/ebs

5) Check fstab for any inconsistency , /mnt/ebs/etc/fstab. If there is any inconsistency, backup that file, modify it, unmount the partition, and re-attach it to the instance in step(1) and launch it.