search
top

How To Disable fsck at boot on RHEL

Recently ran into the need to disable fsck on a large filesystem at boot. This is not recommended to do by RedHat but in this case it was a evil that had to be put in place with the caveat of making sure to manually run fsck at a later time.

According to RedHat:

Red Hat does not typically suggest disabling the on-boot fsck except in situations where the machine does not boot, the file system is extremely large, or the file system is on remote storage.

With that in mind here is how to make it so the filesystem does not run fsck on reboot.

Open /etc/fstab with your favorite editor.

sudo vi /etc/fstab

Find the filesystem you want to stop from getting checked and change the last entry to 0.

/dev/mapper/vg_mhlinux3-lv_root /       ext4    defaults        1 0
                                                                  ^ change

Save the file and you are done. Pretty simple and straight forward. Let’s explore a bit more on fsck and settings. The default is check every 180 days and or 23 mounts. say we would want to tweak a few of these settings.

Let’s put the shoe on the other foot and say we want to force an fsck on a filesystem at next boot. Change directory into the filesystem you want to check as root user and create a file called forcefsck.

# cd /mnt
# touch forcefsck

Next reboot the fsck will run and the forcefsck file will be deleted. Say you want to take that to the next level and have it check it every reboot. We do this with tune2fs command and pass -c max-mount-counts option.

tune2fs allows the system administrator to adjust various tunable filesystem parameters on Linux ext2, ext3, or ext4  filesystems.

In this example /dev/sda3 is being told to check everytime.

sudo tune2fs -c 1 /dev/sda3

Now say we want to change the number of days from 180 to 200, we do this with the -i  interval-between-checks[d|m|w] option. If we set the value to 0 it will disable the interval, which is not recommended.

sudo tune2fs -i 200 /dev/sda3

So we have covered how to disable and a few tweaks for fsck. Be sure to use the man tune2fs command to see what else is possible!

 

2 Responses to “How To Disable fsck at boot on RHEL”

  1. rafa says:

    shutdown -f will also do it

    shutdown -rf

    -f Skip fsck on reboot.

    Thanks !!

  2. hgb says:

    Recent RHEL 6 (6.6 en onwards) does not support anymore -f to shutdown, so even on “shutdown -rf” a fsck happens if needed 🙁

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

top