This question is also often asked in the form of: “How Many Consecutive Mounts and/or Days do I Have Between Mandatory Checks?”
Typically ext filesystems and their supporting tools are set to force a fsck to take place on a volume after either a certain number of mounts have taken place and after a certain number of days have passed (whichever causes an fsck to happen first). This can cause some consternation if a reboot has been scheduled for whatever reason, but you didn’t take into account your fsck interval and now you’re left staring at a consistency check. On a 4TB volume. On a Sunday evening, just hours before Monday officially starts. NOT THAT I’VE EVER BEEN IN THAT SITUATION.
So if you’re not sure about how a server is going to respond to a reboot, one of the things you might want to check is how the filesystem will be handled. 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 what’s going to happen on the next reboot (or volume mount sans the reboot), you’ll want to focus on the following:
tune2fs -l /dev/sda1 | grep "interval|ount count|checked" Mount count: 17 Maximum mount count: -1 Last checked: Sat Feb 9 11:42:51 2013 Check interval: 0 ()
(Yes, I grep’d for ‘ount count’ not ‘mount count’)
Your Mount count is the number of times the volume has been mounted. The maximum mount count is just what it sounds like. If it’s set to -1 it will never be fsck’d based on the number of times it’s been mounted. You’ll compare your “Check interval” in days to the time it was last checked to determine if you’ll be forced to fsck on the next reboot.