Force fsck on next reboot

Submit to reddit

fsck your main partition on the next bootLet’s say you run a headless server and you want to fsck the main partition. The easy solution in this case is (if possible) to force fsck to run on the next boot.

If you run slackware than all you really need is to create an empty file in /etc called forcefsck

You could do this by running:

touch /etc/forcefsck

Other linux distributions might check for this file elsewhere, for example in the root directory so the command would be

touch /forcefsck

Checking the documentation will always help.

  • Do
    sudo tune2fs -C 10000 /dev/xxxx && rebooot

    This change the counter of times de system is booted.
    -C is in uppercase and xxxx is the device to check

    • Indeed this would work as well. Still I find my sollution is the proper way.