Occasionally we run into the problem of not being able to mount an Amazon EBS volume at reboot because it’s stuck in “Busy” or “Attaching” status.  Sometimes this manifests itself as an Input/output error within Ubuntu on the device or a problem with mdadm not being able to “re-create” an array.  We’ve found the following steps to resolve these problems:

Let’s say for example, in the Amazon AWS console, that you have an EBS volume attached to an EC2 instance as /dev/sdi and that device is stuck in attaching or busy state (in Ubuntu it may be visible as /dev/sdi and when you try and access it you get an Input/output error, or perhaps it never shows up in /dev).  What we’ve found to work is to:

1. “Force Detach” the volume in the AWS console

2. In Ubuntu run
% sudo blkid -g
% ls /dev/sd*

3. If /dev/sdi shows up then delete it
% sudo rm /dev/sdi

4. Now change the device to associate the drive to in the AWS console to be something different, say /dev/sdg assuming it’s not in use, then attach it in the AWS console.

5. Lastly change your entry in /etc/fstab from using /dev/sdi to /dev/sdg and then mount the volume.