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
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
Fabio Milano has written 79 articles for us. Fabio Milano is a certified RHCE, MCP, and CFOI. He runs an IT consulting and services company called RDS Support inc. Website:http://www.rdssupport.com
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.

3 Comments so far

  1. Computer Repair, Lake Geneva, WI on September 18th, 2010

    Such a simple thing, yet so hard to find the answer. Thanks…

    Karl A. Krogmann

  2. Robert on December 28th, 2010

    … 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.

  3. Rich on November 10th, 2011

    This didn’t work on my CentOS server. Is there some other setting needed?

Leave a reply