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:




And change it to:




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.

  10 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!!

  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


  5. March 9, 2017 at 1:25 am

    thank you! works great

  6. doleron
    July 7, 2017 at 12:55 pm

    Worked! Thank you!

  7. Ed
    February 20, 2018 at 10:46 pm

    One thing: ‘sudo reboot’ didn’t work for me. I had to reboot from the AWS web console.

  8. January 18, 2019 at 4:39 pm

    Works very nicely with : sudo reboot -p now

  9. Ench
    September 5, 2019 at 5:48 am

    Cool, Thanks.

  10. Don Hirst
    October 1, 2019 at 4:06 pm

    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 Reply

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.