This project aims to resolve EC2 booting issues arising from incorrect entries in the /etc/fstab file. It covers the reproduction of the issue, two methods for fixing booting problems—EC2 Serial Console and Rescue Instance—and validation steps.
Ensure you have an active AWS account to create necessary infrastructure resources on the AWS cloud.
- Create an issue with incorrect
/etc/fstabentries. - Attach a 5GB EBS volume (
/dev/xvdf) to the EC2 instance. - Mount the file system on the
/datadirectory and create a file named 'f1'. - Incorrectly update
/etc/fstab:/dev/xvdf /data ext4 defaults 1. - Restart the EC2 instance from the AWS console.
- Open the Serial Console from the AWS console.
- Correct the
/etc/fstabentries:/dev/xvdf /data ext4 defaults 1 1
- Stop the problematic EC2 instance and detach the root volume.
- Launch a Rescue Instance, attach the root volume as a data volume, and fix
/etc/fstab. - Detach the volume, terminate the Rescue Instance, and reattach the root volume to the original EC2 instance.
- Start the EC2 instance.
Verify that the EC2 instance starts successfully.
- Use the EC2 Serial Console to address issues related to incorrect
/etc/fstabentries. - The Rescue Instance method is effective when the EC2 instance encounters booting failures.
