FSCK – How to Find Out if There Will Be a FSCK During the Next Boot

fsck

Is there a way to find out if a filesystem check is scheduled for the next boot?

Maybe it's similar to a forced check, which gets triggered by the existence of the file /forcefsck?

Best Answer

It depends on your filesystem, in addition to /forcefsck .

With ext2, ext3 and ext4 you can use

dumpe2fs -h /dev/diskname 

Where diskname is for example sda1. You can determine name of your disk partition by running command

mount

Example output (only partly):

/dev/xvda1 on / type ext3 (rw,noatime,usrquota,errors=remount-ro)

Where xvda1 is name of root disk partition.

For dumpe2fs three interesting items are

Mount count:              9
Maximum mount count:      36
Next check after:         Mon Feb 14 09:31:33 2011

Ubuntu will run fsck if mount count is equal or greater than maximum mount count, or if "next check after" is passed.

Related Question