Linux: skip or force fsck on reboot

shutdown is the typical way to bring your system down in a Unix environment. It takes care of notifying logged in users that the system is going down, takes care of sending SIGTERM to processes and more.

One interesting feature of shutdown is the ability to force or skip the check and repair of the filesystem after a reboot. This is done by two flags that could be passed to the command. According to the man pages:

The -f flag means 'reboot fast'. This only creates an advisory file /fastboot which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide not to run fsck(1) since the system has been shut down in the proper way. After that, the boot process should remove /fastboot.

The -F flag means 'force fsck'. This only creates an advisory file /forcefsck which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide to run fsck(1) with a special 'force' flag so that even properly unmounted file systems get checked. After that, the boot process should remove /forcefsck.

Tags: ,

Leave a Reply

You must be logged in to post a comment.