Read more

How to check your file system's integrity with fsck

Arne Hartherz
May 07, 2012Software engineer at makandra GmbH

To force a check on your next reboot (here for your root partition), simply:

touch /forcefsck
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

To manually do this, here is how to do it for the first partition on sda, when you are using ext4:

fsck.ext4 -fn /dev/sda1
  • -f forces the check, even if everything seems okay.
  • -n is a "read only" check, where nothing is changed and every question is answered with "no".
  • When using dmcrypt, you probably want to check something like /dev/mapper/lvm-root.

This does not work properly when doing this on mounted devices (i.e. while your system is up), even when using the -n switch.

Kudos to Kim.

Posted by Arne Hartherz to makandra dev (2012-05-07 14:35)