5

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?

1 Answer 1

7

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.

4
  • I checked it again and my Check interval is 0. What you say is a good number for max mount count?
    – IMB
    Commented Aug 17, 2017 at 11:47
  • @IMB I guess it depends on how you use the filesystem, how often you restart etc. But really I can't give you a good advice because I widely use btrfs, not ext. Commented Aug 17, 2017 at 11:51
  • I use it as server for multiple websites. I rarely restart, maybe once or twice a year
    – IMB
    Commented Aug 17, 2017 at 11:58
  • @IMB I think you should ask a separate question about reasonable numbers for tune2fs, then somebody else may help you. Check if Server Fault is a better place for this second question since you're trying to tweak a server (I don't say it is, I say check). Commented Aug 17, 2017 at 12:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .