About Linux FAQ

Browse More FAQs:

Linux Force fsck on the next reboot or boot sequence

Posted by Vivek Gite [Last updated: December 28, 2007]

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.

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

E-mail this to a friend      Printable version

Related Other Helpful FAQs:

Discussion on This FAQ

  1. Tom Says:

    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)

  2. Ifan Says:

    nice! didn’t know that at alL!!

  3. sudar Says:

    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

  4. dj Says:

    shutdown -rF now <-will reboot and forcefsck now. More info: man shutdown

  5. Martijn Says:

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

  6. Jason B Says:

    On RHEL 4, ’shutdown -rF’ just writes /forcefsck anyway.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.