How to force a File System Check at next boot

If your system bas been powered down unexpectedly without being shutdown it is probably a good idea to check the file systems, but if you try to check a mounted file system if you do you almost certainly damage it. Since you can’t unmount the root files system this makes checking it difficult.

Normally the system automatically checks all the file systems when the system boots depending on the number of reboots, days, or times the file system has been mounted since the last check. To force the system to check the root file system the next time the system boots you need to create an empty file in the root directory using ‘touch’. To do this we need to be running as root.

$ su
Password:

OR

$ sudo -i
Password:

Then we just need to create an empty file in the root folder called ‘forcefsck’.

# touch /forcefsck

The next time the system boots it will check the file system before it is mounted and delete the 'forcefsck' file.

Advertisements
This entry was posted in Debian, Linux, Raspbian, Ubuntu and tagged . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s