A couple of weeks ago, I installed some updates to my server. When I restarted it, it didn’t come up. To make things worse, the IPMI console decided to go on strike, so I couldn’t see what was really going on. I presumed that the system wasn’t responding because of some kernel panic. After a while, I gave up for that night in the hope that by morning the IPMI would be sorted out. To my surprise, the IPMI was still out of order, but the server was up again. Apparently, the system wasn’t stuck on a kernel panic, but on fsck‘ing the hard disks. So, in order to avoid such problems in the future, I looked for a way to tell when the system is going to run fsck after the next reboot (I also got the IPMI fixed).
$ sudo tune2fs -l /dev/sda6
In the output, you will find the following lines:
Mount count: 2
Maximum mount count: 36
Last checked: Tue Jul 26 04:49:18 2011
Check interval: 15552000 (6 months)
“Maximum mount count” is the number of mounts after which the filesystem will be checked by fsck. “Check interval” is the maximum time between two filesystem checks. The command also lets you see the actual mount count since the last check and when it took place.