Fix /dev/xvda1 should be checked for errors on Amazon EC2 Ubuntu Instances

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.

11 comments

  1. 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.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.