Will my system fsck when I reboot?

Solution 1:

If all you want to do is avoid an fsck, adding the -f option to shutdown should help with that. shutdown -F to force fsck.

tune2fs -l /dev/foo will tell you the interesting bits of information.

Here's a start at extracting just what you need:

mount -l -t ext3,ext2 | cut -d' ' -f1 | xargs -n1 tune2fs -l | egrep -i 'state|mount|check'

If the "Next check after" date is in the past, there will be an fsck.

If the filesystem state is not clean, there will be an fsck. (this could also happen if there's a problem with the system during reboot/shutdown that prevents a clean unmount)

If the mount count has reached the maximum mount count, there will be an fsck.

Solution 2:

Using tune2fs -l /path/to/device:

  • If "Mount count" will be greater than "Maximum mount counts" then use -c to change the max or -C to change the count
  • If "Last Checked" is not recent enough for the "Check interval" use -i to change the interval or -T to change the last checked

Solution 3:

the other option is you can manually make it skip fsck checks at boot by updating the 6th field in your /etc/fstab:

/dev/sda2  /  ext3  defaults,errors=remount-ro 0       1

This is the similar to what most fstabs will have 1 means that it should be checked and is a root file system, 2 means it should be checked but will be done in parallel with other file systems and 0 means skip checking

this is also true no matter the file system

Tags:

Linux

Fsck