Learn how to resolve “Instance does not have a volume attached at root (/dev/sda1)” error on AWS platform. This error comes when the device name not mapped properly while attaching volume to the EC2 instance.
Error details: Instance does not have a volume attached at root (/dev/sda1)
This error comes when Device name given while attaching the root volume differs from Root device attached to EC2 instance during launch.
How to Resolve This Error
In order to resolve this error follow below steps:
Step1: Note down the device name in error while starting the EC2 instance.
In the above screen shot error is related to device name /dev/sda1. We need to use same device name while attaching the volume to EC2 instance.
Step2:Detach the currently connected Volume with EC2
- Go to ELASTIC BLOCK STORE –> Volumes and select respective attached volume . This volume will be having status as “in-use”.
- Then click on Detach volume option from Action drop down menu.
Step3:Attach volume to EC2
Try to attached same volume to EC2 instance. However make sure that you are not using default “Device” such as “/dev/sdf” as below while attaching volume to EC2 instance.
Do not Use below by-default Device name.
Instead Use Device name as /dev/sda1 which we have noted down in the step1 as below and click Attach Button:
Step4:Start EC2 instance
This time when you try to start the instance, the error “Instance does not have a volume attached at root (/dev/sda1)” will not occur and your EC2 instance will be start successfully.