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.

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

  1. April 1, 2016 at 10:18 am

    great and easy post that WORKS!!
    thanks

  2. June 16, 2016 at 10:33 pm

    Oh my goodness! Incredible article dude! Many thanks, 

  3. Jinx13
    September 4, 2016 at 8:06 am

    Just want to say thank you, it’s been doing my head in ☺️

  4. Domenico
    September 19, 2016 at 6:59 pm

    Great!
    Thanks.

  5. March 9, 2017 at 1:25 am

    thank you! works great

Leave a Reply

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