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:
1 | su - |
1 | touch /forcefsck |
1 | shutdown -r now |
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:
1 | shutdown -rF now |
No comments:
Post a Comment