Linux: Skip or Bypass a Fsck

When a Linux system is booting up, it may perform a file system check (fsck) on the file systems to ensure their consistency. This is usually necessary if the system was not shut down properly or if there are any disk errors. During this process, the fsck utility examines the file system and can repair any inconsistencies it finds.

However, sometimes you may want to skip or bypass a fsck to save time or to avoid data loss. Here are a few ways to do this:

  1. Use the tune2fs command: You can use the tune2fs command to set the maximum number of mounts that will be performed before the file system is checked. For example, the following command sets the maximum mount count to 1, meaning that the file system will be checked on the next reboot:
    sudo tune2fs -c 1 /dev/sda1
  2. Use the touch command: You can create a file called forcefsck in the root directory to force a file system check on the next boot. To create this file, use the touch command:
    sudo touch /forcefsck
  3. Use the shutdown command: If you want to skip the fsck on the next boot, you can use the shutdown command with the -f option to force an immediate shutdown:
    sudo shutdown -rF now

This will shut down the system and force a file system check on the next boot. The -r option indicates a reboot, while the -F option indicates that the file system check should be forced.

Leave a Comment