Disabling or Configuring Automatic Filesystem Checks in Debian or Ubuntu

Practice



In Debian and Ubuntu, an automatic check of mounted filesystems runs during system boot. Not on every boot - only when the system decides it hasn't been checked in a while.

By default, the check kicks in every 25th mount, or on the next one if a check was skipped. And here's the fun part - you reboot the server for something minor, install updates and boot the new kernel... and it doesn't come back up for several minutes... turns out it's checking a 500GB drive with a hundred thousand files at the worst possible moment.

Over SSH, of course, the server is still unreachable at that point.

So how do we disable the automatic fsck check, or adjust its timing?

The tune2fs utility is used for this. To disable the check, run:

# tune2fs -c 0 /dev/sdXY

Instead of sdXY, specify the partition you want to configure. For example, sda1.

You can change the settings to something else, and man tune2fs will help you with that.

For example, the command

# tune2fs -c 100 /dev/sda1

will set the check to run after 100 mounts, while the command

# tune2fs -i 2w /dev/sda1

will set the check to run every 2 weeks regardless of the number of mounts during that time.
created: 2017-05-10
updated: 2026-03-10
626



Was this answer useful?
Choose a quick rating so we can improve the next answer for you.
How satisfied are you?


Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "LINUX operating system"

Terms: LINUX operating system