How to interact with the console during boot time on Amazon EC2

amazon ec2

I have an instance which is stuck at this boot prompt (looking at the instance log from the management console):

The disk drive for /mydisk is not ready yet or not present
Continue to wait; or Press S to skip mounting or M for manual recovery

I added an EBS volume, mounted it, then deleted the EBS volume and forgot to remove the entry from /etc/fstab and rebooted the machine. Now it prompts me that at boot time, and I am unable to SSH into the instance.

What should I do to resolve this issue?

Best Answer

I don't know an 'easy' solution to your problem, but there is a somewhat convoluted (depending on your root device type) solution.

If your instance has an EBS root, the solution is simple enough: stop the instance, detach the EBS drive, launch another instance and attach the EBS volume to it. Edit your fstab file as needed, detach the EBS volume and re-attach it to the original instance.

If your instance has an S3-backed root (i.e. instance-store), the solution is a good bit harder. You can download the data from your AMI (using ec2-download-bundle), and then extract that data into a single file (using ec2-unbundle). You can then mount the image, make the necessary change, and rebundle the image (with ec2-bundle-vol, overriding the default volume to bundle with the -v flag). That should give you a new, viable AMI, identical to your old one, except for the modifications you make. Alternatively, you could copy the content of the image file to an EBS volume using dd - and then convert to an EBS root backed instance.

Related Topic