Change website

From Jan 16 2015,


All post content will be move to we's offical website with many content...

Can access website here: http://justox.com

Thanks for your visit!

Thursday, 19 December 2013

Linux Tips: How to force fsck on the next reboot or boot

fsck is a file system consistency check and interactive repair tool.
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 for some reason, you want to force the system to run fsck on the next reboot just use one of the following options:
1. Force fsck on a boot using /forcefsck
On boot Linux looks for a file called "forcefsck" in the root "/" directory. If this file exists then the system will invoke a full file system check on boot.
To create the file you first need to be the root user:
1su -
Create a the file forcefsck in the root directory:
1touch /forcefsck
Reboot the system:
1shutdown -r now
During the first reboot the system will run fsck and after completing this it will also remove the /forcefsck file from the system.
2. Force fsck on a boot using shutdown command
The -F option force fsck on reboot, login as root and type the following command to reboot and run fsck:
1shutdown -rF now

No comments:

Post a Comment