- Newest
- Most votes
- Most comments
The issue you're experiencing is likely due to the root volume of your EC2 instance being full, which is preventing the instance from booting properly and causing the instance reachability check to fail. Simply modifying the EBS volume size in the AWS console will not automatically solve the problem, as the file system within the instance needs to be extended as well.
Here's a potential solution to your problem:
-
Stop the EC2 instance if it's not already stopped.
-
Modify the EBS volume size in the AWS console to increase its capacity. This will expand the underlying block storage.
-
Start the EC2 instance.
-
If the instance still fails to boot properly, you may need to use EC2 Rescue for Linux. This is an AWS tool designed to help diagnose and fix boot and reachability issues.
To use EC2 Rescue for Linux:
- Create a new EC2 instance in the same Availability Zone as your problematic instance.
- Stop your problematic instance.
- Detach the root volume from the problematic instance.
- Attach this volume as a secondary volume to your new rescue instance.
- Use EC2 Rescue for Linux on the rescue instance to diagnose and potentially fix issues on the attached volume.
- Once fixed, detach the volume from the rescue instance and reattach it to the original instance.
- Start the original instance.
If successful, you should now be able to connect to your instance. Once connected, you can extend the file system to use the newly allocated space. The exact commands will depend on your file system type (e.g., ext4, xfs).
For ext4:
sudo growpart /dev/xvda 1
sudo resize2fs /dev/xvda1
For xfs:
sudo growpart /dev/xvda 1
sudo xfs_growfs /
Remember to replace '/dev/xvda' with the actual device name of your root volume.
This approach should allow you to recover your instance, increase its available disk space, and regain access. Always ensure to back up important data before performing these operations.
Sources
Increase EBS not reflecting on the ubuntu | AWS re:Post
EBS Storage size not increased after Instance Type upgrade (Linux) | AWS re:Post
Request Amazon EBS volume modifications - Amazon EBS
I disagree with the AI-bot's answer, I think it's a bad idea to change the root disk's geometry like this - it could make a bad situation worse and make your instance completely unbootable (speaking from experience!).
At the moment at least it is booting up to a point.
I would create the rescue instance and mount the "problem" root disk on (say) /mnt, but then I would look to see what has filled up the space with something like cd /mnt; du -sm *
Wherever the biggest consumer of space is, drill down through that directory.
Also look in the logs directory for something that has been logging really verbosely and filled it up. And look for crash dumps.
Lastly, after you heave cleared down space, umount /mnt and do a full fsck on it before re-attaching to the original instance.
Relevant content
- asked a year ago
