Software & AppsOperating SystemLinux

How To Disable Filesystem Checking on Boot in Ubuntu 20.04

Ubuntu 8

In this article, we will explore different methods to disable filesystem checking on boot in Ubuntu 20.04. This process, while not recommended for regular use, can be useful in certain situations where you need to speed up boot times or for testing purposes.

Quick Answer

To disable filesystem checking on boot in Ubuntu 20.04, you can use the tune2fs command to set the maximum mount count to 0 for your root filesystem. Alternatively, you can modify the fstab file to change the "pass" argument to 0 for the partition being checked at boot. Another method is to add the fsck.mode=skip parameter to the GRUB configuration file. Remember, disabling filesystem checks should be done sparingly and only when necessary.

Understanding Filesystem Checking

Before diving into the methods, it’s important to understand what filesystem checking is. In Ubuntu, a filesystem check (fsck) is performed during system boot to detect and repair inconsistencies in the filesystem. While this is a useful feature for maintaining the health of your system, it can slow down boot times, especially if your filesystem is large or contains errors.

Method 1: Using the tune2fs Command

The tune2fs command is a tool used to adjust tunable filesystem parameters on Linux ext2, ext3, or ext4 filesystems. It allows you to control several parameters, one of which is the maximum mount count (-c), which determines how often the filesystem check is performed.

Steps:

  1. Open a terminal (Ctrl+Alt+T).
  2. Run the df -h command. This command is used to display the disk space usage for all mounted filesystems. Identify the device where your root filesystem is mounted. It is typically /dev/sda1 or similar.
df -h
  1. Once you have identified the device, run the tune2fs -c 0 /dev/yourdevicehere command, replacing yourdevicehere with your device name. This command sets the maximum mount count to 0, effectively disabling the filesystem check on boot.
sudo tune2fs -c 0 /dev/yourdevicehere

Method 2: Modifying the fstab File

The fstab (file system table) file is a system configuration file on Ubuntu systems. The file contains descriptive information about the various file systems.

Steps:

  1. Open a terminal.
  2. Run the sudo nano /etc/fstab command to open the fstab file in the nano text editor.
sudo nano /etc/fstab
  1. Locate the line corresponding to the partition that is being checked at boot. This line will end with a 1 or 2 in the sixth field (also known as the “pass” field). This number determines the order in which the filesystem checks are performed at boot time.
  2. Change the value of the “pass” argument from 1 or 2 to 0 for that partition. This will disable the filesystem check for that partition at boot.
  3. After making the changes, press Ctrl+X to close the editor, Y to save the changes, and Enter to confirm.

Method 3: Adding a Kernel Parameter

You can also disable filesystem checking by adding a kernel parameter in the GRUB (GRand Unified Bootloader) configuration file.

Steps:

  1. Open a terminal.
  2. Run the sudo nano /etc/default/grub command to open the GRUB configuration file.
sudo nano /etc/default/grub
  1. Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and add the parameter fsck.mode=skip to the existing options.
  2. After adding the parameter, the line should look something like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash fsck.mode=skip"
  1. Save the changes and exit the editor (Ctrl+X, then Y, then Enter).
  2. Run the sudo update-grub command to update the GRUB configuration. This command will generate a new GRUB configuration file with the updated kernel parameters.
sudo update-grub

Conclusion

In this article, we have covered three methods to disable filesystem checking on boot in Ubuntu 20.04. Remember, disabling filesystem checks can lead to undetected filesystem corruption in case of an unclean shutdown. Therefore, use these methods sparingly and only when necessary.

For more information on filesystem checks and how they work, you can refer to the Ubuntu man pages for fsck, fstab, and tune2fs.

Sources:

  • Ubuntu Manpage: fsck – check and repair a Linux filesystem
  • Ubuntu Manpage: fstab – static information about the filesystems
  • Ubuntu Manpage: tune2fs – adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems
What are the risks of disabling filesystem checking on boot?

Disabling filesystem checking on boot can lead to undetected filesystem corruption in case of an unclean shutdown. It is recommended to use these methods sparingly and only when necessary.

How can I identify the device where my root filesystem is mounted?

You can use the df -h command in the terminal to display the disk space usage for all mounted filesystems. Look for the device with the mount point of "/" or "/root". It is typically listed as "/dev/sda1" or a similar name.

Can I enable filesystem checking again after disabling it?

Yes, you can enable filesystem checking again by reversing the changes made in the methods mentioned in this article. For method 1, you can run the sudo tune2fs -c 1 /dev/yourdevicehere command, replacing yourdevicehere with your device name. For method 2, change the "pass" argument back to 1 or 2 in the /etc/fstab file. For method 3, remove the fsck.mode=skip parameter from the GRUB_CMDLINE_LINUX_DEFAULT line in the /etc/default/grub file, and then run sudo update-grub to update the configuration.

Are there any other methods to disable filesystem checking on boot?

The methods mentioned in this article are the most common and recommended ways to disable filesystem checking on boot in Ubuntu 20.04. However, there may be alternative methods available, such as using systemd units or modifying kernel boot parameters directly, but these methods are more advanced and not covered in this article.

Can I selectively disable filesystem checking for specific partitions?

Yes, you can selectively disable filesystem checking for specific partitions by following method 2 mentioned in this article. Locate the line corresponding to the partition you want to disable the check for in the /etc/fstab file and change the "pass" argument to 0 for that partition. This will disable the filesystem check only for that specific partition at boot.

Leave a Comment

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