How to force fsck on boot?

'Forum Post ulist at gs1.ubuntuforums.org
Wed Dec 7 20:20:46 UTC 2005


Randall J. Parr Wrote: 
> 
> Creating file "forcefsck" in the root directory should cause an fsck to
> 
> be run on next reboot.
> 
> # sudo touch /forcefsck
> 
> or
> 
> # sudo echo " " >/forcefsck
> 
> I know this works well on Red Hat.  I have not really tested it on
> Breezy.
> 
It works fine with ubuntu too :)
Some lines from /etc/init.d/checkfs.sh:

Code:
--------------------
    #
  # Check the rest of the file systems.
  #
  if [ ! -f /fastboot ] && [ -z "$ac" ]
  then
  if [ -f /forcefsck ]
  then
  force="-f"
  else
  force=""
  fi
  
--------------------

...


Code:
--------------------
    sudo touch /forcefsck
--------------------
 will force check at boottime while 
Code:
--------------------
    sudo touch /fastboot
--------------------
 will bypass check

Also, tune2fs -i interval[d|m|w] allows you to set the interval between
each check:

Code:
--------------------
    tune2fs -i 1w
--------------------
 for a weekly check:cool:


-- 
tukuyomi




More information about the ubuntu-users mailing list