Tired of this message popping up every time you SSH into an Amazon instance?
"/dev/xvda1 should be checked for errors"
And none of the “fixes” seem to work? Turns out you have to do a combination of things. SSH into the cloud and follow along.
sudo nano /etc/fstab
There should be a line describing the root (/) filesystem. Change the very last digit from a “0” to a “1”. Ctrl-O to save and Ctrl-X to exit.
sudo nano /etc/default/rcS
Near the bottom, look for the line:
#FSCKFIX=no
And change it to:
FSCKFIX=yes
Ctrl-O and Ctrl-X again. Finally, trigger the file check at next reboot.
sudo touch /forcefsck
And reboot.
sudo reboot
Within a few seconds the instance should be back up. To conserve boot time and resources, revert the above changes to /etc/fstab and /etc/default/rcS and it should be good to go! No bothersome error message, and a solid file system.
great and easy post that WORKS!!
thanks
Oh my goodness! Incredible article dude! Many thanks,
Just want to say thank you, it’s been doing my head in ☺️
Great!
Thanks.
thank you! works great
Worked! Thank you!
Thanks!
One thing: ‘sudo reboot’ didn’t work for me. I had to reboot from the AWS web console.
Works very nicely with : sudo reboot -p now
Thanks.
Cool, Thanks.
I have a swapfile allocated. It shows up in the fstab listing and needed a 1 to replace the 0 in the last item in the line. Did that and all the errors went away. Thanks.
I read your articles, and even the content on it seems quite useful to me. Thank you very much for sharing this knowledge.