AWS instance doesn't start after reattaching root volume

I have a t1.micro instance with /dev/sda1 volume attached. Now I am out of disk space and migrating to a larger volume. I created the larger volume from the original disk snapshot and attached it to a new instance (for test) as /dev/sda1. The instance doesn't start with error:

Invalid value 'i-cf3acXXX' for instanceId. Instance does not have a volume attached at root (/dev/xvda)

If I attach the volume as /dev/xvda, the instance doesn't start. First, it goes into "Running" state, but then the state falls back to "Stopped".

There are threads on Stackoverflow and AWS Developer Forums, but they both seem to be obsolete and not helping.


Solution 1:

Invalid value 'i-cf3acXXX' for instanceId. Instance does not have a volume attached at root (/dev/xvda)

your instance is pointing to root device name "/dev/xvda". So the attached volume should also be mounted at same location but in your case it is mounted at /dev/sda1.

Hence while attaching the volume enter /dev/xvda against device text box.

Image