When will fsck run if maximum mount count is -1?

Posted on

Problem :

I am trying to determine if fsck will run on reboot. I run this command dumpe2fs -h /dev/(diskname) and get this result:

Mount count:              13
Maximum mount count:      -1

AFAIK fsck will run if mount count is equal or greater than maximum mount count. In this case maximum mount count is -1 so fsck will never run. Is this normal?

Solution :

From man tune2fs

-c max-mount-counts

Adjust the number of mounts after which the filesystem will be checked by e2fsck(8). If max-mount-counts is 0 or -1, the number of times the filesystem is mounted will be disregarded by e2fsck(8) and the kernel.

In this case “disregarded” means that yes, fsck will never run for this reason and this is normal. However there is also

-i interval-between-checks[d|m|w]

Adjust the maximal time between two filesystem checks. No suffix or d will interpret the number interval-between-checks as days, m as months, and w as weeks. A value of zero will disable the time-dependent checking.

So fsck may still run for this other reason, depending on whether or not the interval is set.

It is strongly recommended that either -c (mount-count-dependent) or -i (time-dependent) checking be enabled to force periodic full e2fsck(8) checking of the filesystem. Failure to do so may lead to filesystem corruption (due to bad disks, cables, memory, or kernel bugs) going unnoticed, ultimately resulting in data loss or corruption.

Leave a Reply

Your email address will not be published.