Messed up etc/fstab on linux instance

0

I accidentally typed "default/noatime" instead of "default,noatime" on my /etc/fstab file and do not know how to fix this since I cannot even connect to the instance.

질문됨 일 년 전800회 조회
1개 답변
1

Do you have EC2 snapshots?
One way to do this would be to restore EC2 once a snapshot is available.

Another way is to stop the EC2, detach the root volume, mount it on another EC2, and then modify "/etc/fstab".

The process is as follows.

  • Stop the instance.
  • Detach the target volume by volume.
  • Note down the instance ID of the instance in the same AZ.
  • Attach the volume to the target instance.
  • Check the attached instance.

After attaching the root volume to another EC2, you can confirm that it is attached with the following command.

sudo ls -la /dev/sdf*

Then, create a directory for mounting with the following command.

sudo mkdir /mnt/ebs-check

After creating the directory, mount it.
Device names, etc. may depend on your environment and should be changed as the case may be.

sudo mount /dev/sdf1 /mnt/ebs-check

Once mounted, modify "/etc/fstab".
After the modification is complete, if you can attach the root volume to the original EC2 and start EC2, you should be able to connect.

Please check the following documents for other troubleshooting methods.
https://repost.aws/knowledge-center/ec2-linux-emergency-mode

profile picture
전문가
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠