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?

  • Your instance isn't booting up because it's failing to mount that device. This is probably a mismatch between what the image expects and the actual EC2 instance configuration. Which AMI are you using? – mgorven Feb 19 '13 at 19:51
  • ubuntu/images/ebs/ubuntu-precise-12.04-amd64-server-20130124 – zontragon Feb 19 '13 at 19:57
  • That doesn't really help. What's the AMI ID, and where did you get it from? – mgorven Feb 19 '13 at 19:59
  • Ubuntu Server 12.04.1 LTS. It's EC2's standart AMI. – zontragon Feb 19 '13 at 20:04
  • To identify the origin of the problem : In console.aws with a right click on the instance > "Instance Settings" > "Get System log" – svassr Dec 12 '14 at 0:20

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.

  • 2
    Thanks. I did exactly as you said. For me it was to add nofail , nobootwait arguments at the failling line in /etc/fstab. – svassr Dec 12 '14 at 0:15
  • 1
    That page was also a great help in the process: docs.aws.amazon.com/AWSEC2/latest/UserGuide/… (particularly the command lsblk to check volume are attached and mounted correctly) – svassr Dec 12 '14 at 0:16

Things to check:

  1. Verify your Security Group rules allow SSH access from your source IP address.

  2. Verify if IPtables is running and blocking connections. You can either service iptables stop or add a rule to your input chain to allow access

If the above doesn't help, run ssh@yourhost -v to gather more details and paste it here so we can see where the disconnect is happening. Connection refused is generally a firewalls access control issue. Hope this helps

  • EC2's security groups drop packets, not reject so it's not that. There's no console access either so iptables can't be checked. – mgorven Feb 19 '13 at 19:57
  • If you login into EC2 there is console access from a java session. – RomeNYRR Feb 19 '13 at 19:59
  • there is a rule which give access to port 22. ssh -v gives same error: Connection refused – zontragon Feb 19 '13 at 20:00
  • @OvidioBorrero, There is a problem with java. It's not working for a while :( – zontragon Feb 19 '13 at 20:03
  • @RomeNYRR clearly a wrong answer, you may want to delete it to avoid confussion and recover your karma! – theist Sep 28 '15 at 16:10

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.