Q. I want to force fsck on the next reboot? How do I force fsck? Is there any configuration file that I need to alter for this purpose.
A. fsck is used to check and optionally repair one or more Linux file systems. You don't have to create or alter/modify any file. All you need to do is just create empty file /forcefsck.
Force fsck on boot using /forcefsck
By creating /forcefsck file you will force the Linux system (or rc scripts) to perform a full file system check.
Login as the root:
$ su -
Change directory to root (/) directory:
# cd /
Create a file called forcefsck:
# touch /forcefsck
Now reboot the system:
# reboot
Frce fsck on next boot using shutdown command
The -F option force fsck on reboot, login as root and type the following command to reboot and run fsck:
# shutdown -rF now
- Email FAQ to a friend
- Printable version
- Rss Feed
- Last Updated: 12-20-08

{ 11 comments… read them below or add one }
Good info. You don’t need to goto the root directory if you’re providing the full path, as you are. You can:
touch /forcefsck
from anywhere… You do need to cd / if you are using a relative path, such as
cd /
touch forcefsck
or
cd /
touch ./forcefsk
but not
cd ~
touch ../forcefsk
(changes to /root, and creates the file one directory level higher)
nice! didn’t know that at alL!!
Hi every one,
I’m able to reboot my target board using the command [reboot] from the bash prompt.
But i can able to by the command [reboot -f].
What should i need to do if i want to use the command [reboot]
Plz help me.
Thanks in Advance
shutdown -rF now <-will reboot and forcefsck now. More info: man shutdown
@dj:
Your ’shutdown’ tip won’t work on many modern distributions, since they use Upstart instead of the old Sysvinit system.
Upstart has dropped many legacy commands that would be better done differently, in favor of a modern lean system.
‘touch /forcefsck’ is currently the most universal way.
On RHEL 4, ’shutdown -rF’ just writes /forcefsck anyway.
There’s no need to use the touch command, “>/forcefsck” will do.
thanks! sudo touch /forcefsck is a good way :)
What about trying to force fsck another partition ?
then u could just umount it……
umount /dev/hdb2; fsck -y -c -f /dev/hdb2;echo ‘w00t’