Linux Tips: force fsck run during the next reboot
Here is a quick tip that will show how you can tell your Linux system to perform a fsck on its partitions on the next reboot. Normally this will happen by default, after some time as configured in the filesystem at creation time (or changed later): after a number of days or a number of filesystem mounts. If you are using ext3 filesystems you can check these intervals configured with:
tune2fs -l <device>
...
Mount count: 5
Maximum mount count: 37
...
Last checked: Sat May 17 16:39:18 2008
Check interval: 15552000 (6 months)
Next check after: Thu Nov 13 15:39:18 2008
If for some reason, you want to force the system to run fsck on the next reboot just create an empty file called forcefsck in your system / like this:
touch /forcefsck
During the first reboot the system will run fsck and after completing this it will also remove the /forcefsck file from the system.
>
Tags: tips

25th October 2008, 11:17
As opposite: put /fastboot file to skip file system check.
26th October 2008, 15:03
Thanks Jam for your addition.
27th October 2008, 01:50
Also useful, when working on remote boxes, you’ll need a “y” in /forcefsck, otherwise the fsck will be stuck waiting for your input.
27th October 2008, 10:46
So the remote safe version of the command will be:
# echo y > /forcefsck
Anyway a good tip
30th October 2008, 12:05
[...] ???????? ?????? ?????: ??????? ???????: ??????? [...]
3rd November 2008, 05:52
Also will work with shutdown.
Shutdown -r -F now