When Was the Last Time My ext Filesystem Was fsck’d for Consistency?

I’ve been tooling around with some simple filesystem tasks on a few servers and have a terrible memory with silly things like this. So I’m writing it down to answer my own question!

You’ll need the e2fsprogs package. Within that package is a command called tune2fs. You can list out the statistics for various volumes on your system with the -l switch. I’d recommend perusing the output of that entire command, however for the impatient, if you want to see the last time that a check was run on a given volume:

tune2fs -l /dev/sda1 | grep "checked"
Last checked: Sat Feb 9 11:42:51 2013

As of the writing of this post in February 2014, it appears that I should probably consider scheduling a maintenance window for that volume to be checked.

This is also useful to determine why a remote server took so long to come back up from a reboot. I recently had a server that took an unexpectedly long time to reboot (it wasn’t production, thankfully) and I used this method as part of my process of elimination to determine if it was a fsck that caused the delay. Just see if the Last checked time was during the reboot period. There are other ways to determine that as well, such as checking fsck logs, but it’s always nice to have several methods to get the same information.


  1. ThatGraemeGuy

    February 5, 2014 at 4:50 am

    To avoid being bitten by the “why is that reboot taking so long” issue, you could disable automatic fsck operations and have Nagios (or whatever you use) tell you when it’s been X days since a fsck, and schedule the operation for a convenient time.


    • Wesley David

      February 5, 2014 at 8:49 am

      That’s Friday’s post. =P


  2. Dan Sheridan

    February 6, 2014 at 1:12 pm

    I tend to side-step this issue by running offline fscks on snapshots — obviously you can’t repair damage, but you can check whether a real fsck is required, and update the last check time. See http://www.redhat.com/archives/linux-lvm/2008-April/msg00088.html


    • Wesley David

      February 6, 2014 at 1:35 pm

      Oohh, good point. I like that idea.


Leave a Reply

Follow TheNubbyAdmin!

follow us in feedly

Raw RSS Feed:

Contact Me!

Want to hire me as a consultant? Have a job you think I might be interested in? Drop me a line:

Contact Me!

Subscribe via Email

Your email address is handled by Google FeedBurner and never spammed!

The Nubby Archives

Circle Me on Google+!

Photos from Flickr

Me on StackExchange

The IT Crowd Strava Group

%d bloggers like this: