Configuring Automatic File System Checking for Ext File Systems

Configure automatic file system checking on an Ext file system by using the tune2fs command.

For file systems other than root (/) and /boot, mount invokes file system checking if more than a specified number of mounts have occurred or more than 180 days have elapsed without checking having being performed. Mount-count dependent checking is disabled by default.

The following procedure applies to Ext file systems only. XFS file systems, which are the default file system type in Oracle Linux, detect errors automatically and don't require periodic file system checks at boot time.

For more information, see the tune2fs(8) manual page.

  • Change the number of mounts before the system automatically checks the file system for consistency.
    sudo tune2fs -c mount_count device

    The device specifies the block device that corresponds to the file system.

    A mount_count of 0 or -1 disables automatic checking, based on the number of mounts.

    Tip:

    Specifying a different mount_count value for each file system reduces the probability that the system checks all the file systems at the same time.

  • Change the interval between file system checks:
    sudo tune2fs -i interval[unit] device

    A unit can be d for days, w for weeks, or m for months.

    The default unit is d (for days). An interval of 0 disables checking, based on the time that has elapsed after the last check. Even if the interval is exceeded, the file system isn't checked until it's next mounted.