How to Force an fsck Disk Check on the Next Reboot in Ubuntu

In Ubuntu (and Linux in general), the filesystem consistency check utility—known as fsck—is a critical tool used to scan your hard drives for bad sectors, corrupted data, and structural errors. If your system experienced an unexpected power loss, a sudden kernel panic, or if you suspect your storage drive is failing, running a thorough fsck scan is the first step in diagnosing the problem.

However, there is a catch: you cannot safely run an fsck scan on a mounted, active filesystem. Doing so can cause catastrophic data corruption. Because your primary Ubuntu root partition (/) is always mounted while the operating system is running, you cannot simply type the command into the terminal and expect it to scan your main drive.

To scan your root partition safely, you must instruct Ubuntu to execute the fsck utility during the boot process, before the drive is mounted for daily use.

The Modern Method (For systemd Systems)

For many years, Linux users relied on a simple trick: creating an empty file named forcefsck in the root directory. However, since Ubuntu transitioned to the systemd init system (starting with Ubuntu 15.04), that old file-based trick is completely ignored.

Instead, you must modify the kernel boot parameters.

  1. Open your Ubuntu Terminal.
  2. You need to edit the GRUB bootloader configuration file. Type the following command and press Enter:
sudo nano /etc/default/grub
  1. Scroll down the text file using your arrow keys until you find the line that begins with GRUB_CMDLINE_LINUX_DEFAULT=. It usually contains the words “quiet splash”.
  2. Move your cursor inside the quotation marks and append the following parameter exactly as shown:
fsck.mode=force

The entire line should now look something like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash fsck.mode=force"

  1. Press Ctrl + O then Enter to save the file, and Ctrl + X to exit the nano editor.
  2. Update the actual GRUB bootloader by running:
sudo update-grub

Reboot the System

With the new parameter saved, simply restart your computer:

sudo reboot

During the next boot sequence, Ubuntu will automatically pause before mounting your drives and run a comprehensive fsck scan. Depending on the size of your drive and the number of errors it finds, this could take anywhere from a few seconds to several minutes.

Crucial Post-Scan Cleanup

Because you hard-coded the “force” parameter into the GRUB configuration, Ubuntu will now run a disk check on every single boot. This will significantly slow down your computer’s startup time.

Once your system has successfully booted and repaired any errors, you must immediately reopen the terminal, edit the /etc/default/grub file again, and delete the fsck.mode=force parameter. Do not forget to run sudo update-grub one final time to finalize the change!

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.