Linux Force Fsck Disk Check on Boot
Scenario / Question:
How to force fsck on the next reboot?
Solution / Answer:
By creating an empty forcefsck file in the root directoy
FSCK Command:
fsck – check and repair a Linux file system
DESCRIPTION:
fsck is used to check and optionally repair one or more Linux file systems.
Create empty forcefsck file:
In order to force your system to run fsck on your file systems during the next reboot you need to create a file called “forcefsck” in your root “/” folder.
Become Root
$ su -
Create forcefsck file in root folder
# touch /forcefsck
Reboot System
# shutdown -r now
The information provided is for educational purposes only. All content including links and comments is provided "as is" with no warranty, expressed or implied. Use is at your own risk and you are solely responsible for what you do with it.



Such a simple thing, yet so hard to find the answer. Thanks…
Karl A. Krogmann
… well, beware of this advice. It is a partial answer. If you applied this solution to a remote server and a problem occured… what happens? Your server would probably get stuck at the fsck prompt and you would need human intervention! A BIG problem if the server is half way across the country… or in another country. MAKE SURE, appropriately to your system, that the options which tell fsck to automatically fix the file system are set.
This didn’t work on my CentOS server. Is there some other setting needed?