prevent ext3 check forced

Saturday, November 1st, 2008 @ 3:45 pm | Howto

If you are using ext3 as a filesystem I’m sure you have seen something like this:

/dev/sdc1 has gone 84 days without being checked, check forced

You may not have liked it any more than I do.

I just had it again today.

A new kernel had became available.
I tend to update the kernel a few days after not seeing any show stoppers being reported in The Usenet so I can assume that the new kernel will boot and run without problems.

I had decided to do something about that time consuming forced check already after its previous ocurrence, but I had totally forgotten about it. This time it had to be changed, checking 3 TB of disks is not fun to wait for.

Why is this happening?

The reason for the check is that there is an extension to ext2 filesystem in ext3: Journaling.
This means that after a power outage or something similar the file system can recover with the aid of the journal without requiring a full check before booting.

As a default the file system is set to require full checking after a certain period of time or after a certain number of mounts.

The default in my system was 60 days. This means that if the file system has been running over 60 days without checking by the time of booting it will be forced to check.
There is also a value for the number of mounts but I don’t know what it is because the 60 days has always passed before the number of mounts has been reached, that is the number of boots.

I have normally upgraded my system before the two years lifetime of an openSUSE version.
I have also normally updated the kernel when one has become available. A kernel version seems to live one to two months before an update becomes available, most of the time

How to do it

I thought if I’d set the number of mounts (same as boots, here) to 24 that would mean that the system could be booted 24 times before a forced check would occur. That should be enough for one version of openSUSE.

This checking can then be done by the time of the whole system being upgraded or some other time when it suits the best, not as a surprise on top of a kernel update.

And I set the running time limit to 0 (zero) so no forced checks will occur because of exceeding the time.

The code

The command to prevent the check after a certain time:

tune2fs -i 0 /dev/sdc1

And for the number of mounts (boots):

tune2fs -c 24 /dev/sdc1

The /dev/sdc1 in the commands above needs to be changed for each partition you want to change.

And of course those commands need to be run as root.

Read more about the commads:

man tune2fs


Comments are closed.