Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 10 down vote accepted

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.

share|improve this answer
    
Thankfully, my instance has an EBS root! Thanks a lot for the answer. I will try it out and confirm that it works. –  ErJab Oct 15 '11 at 4:15
1  
ErJab: I wrote an article describing how to do this with EBS boot: alestic.com/2011/02/ec2-fix-ebs-root –  Eric Hammond Oct 15 '11 at 20:18
    
Would it be prudent to also add nofail to /etc/fstab in case you make a typo? Maybe not, maybe "errors" (as described in fstab(5)) don't hold up the boot process. –  Adam Monsen Feb 10 '12 at 22:15
    
@AdamMonsen: that is good practice for some drives - e.g. ephemeral drives, since the boot process will exit to recovery mode if a disk is unavailable. I usually use the option nobootwait - haven't tried with nofail - I believe there are some subtle differences between them. –  cyberx86 Feb 10 '12 at 23:47

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.