How to force fsck (File System Check)
Linux, Ubuntu July 13th, 2008
Ubuntu linux, by default performs an ‘fsck’ one every 30 times the file-system is mounted to make sure the hard disk has no errors.
Sometimes you may need to perform an ‘fsck’ during next boot. Here’s the solution -
Create a file /forcefsck without any contents. This can be simply accomplished by
$ sudo touch /forcefsck
The next time you bootup fsck will be performed on all the partitions of your hard drive. Since the file /forcefsck is deleted during the bootup process, this will force ‘fsck’ just ones.
On the contrary, if you frequently turn off your machine, you may be annoyed by regular fsck done every 30 times filesystem is mounted. So, you may sometime wish to disable fsck and boot up fast. This can be done by creating a file /fastboot
$ sudo touch /fastboot
This file is also deleted during the boot up. So this method disables fsck only once. To change the frequency of ‘fsck’ according to your need you may use a very good utility ‘tune2fs’.
Check out its man pages for more details.
P.S.: These methods are generic to all Linux distros, but I am not sure about the frequency.
Leave a Comment