Force Filesystem Repair in Raspbian

Raspberry Pi

Raspberry Pi systems use microSD cards and therefore are more error prone than typical servers with hard disks or SSD. Such corruptions are especially tricky when the only storage available to Raspberry Pi is the microSD card which booted Raspbian OS.

How To Force Filesystem Check

Best thing is to update the /boot/cmdline.txt file to force filesystem repair on the next boot.

Change the file from this:

greys@becky:~ $ cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait plymouth.enable=0

to this:

greys@becky:~ $ cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes fsck.mode=force rootwait plymouth.enable=0

And then just reboot:

greys@becky:~ $ sudo shutdown -r now

See Also