To force a check on your next reboot (here for your root partition), simply:
touch /forcefsck
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"./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.