SD Card errors

First of all here is the log:

After Krypton update, the raspi was stuck on the addons update process, after that I get an error every time I boot the raspi about SD card errors. It seems it is asking for a manual fsck but I can not do it as it is mounted, so I am not sure how to fixit aside of formating and reinstalling everything.

My system is a windows desktop, not sure if windows will be able to fix the SD.

I must say that even with the error everything works, but I have fear that it may stop working anytime soon.

If the system works, you should be ok. If you want to run fsck then you must do so before the system is mounted. If you add recovery to the end of the line of text in /boot/cmdline.txt and add a keyboard to your pi before then rebooting you will be able to run fsck manually in the recovery shell and then remove the recovery option to reboot normally.

From the logs /bin/e2fsck -f -y -C 0 /dev/mmcblk0p2 is the command you would need to run to clean up the errors.

At this point the partition with all the data on /dev/mmcblk0p2 (if you have a standard install) will not be mounted and so you can run fsck in whatever mode you need.

1 Like

OSMC should automatically do a filesystem check if it detects an unclean filesystem.
How do you power off your system?
Just pulling the plug will trigger the check but should be avoided at any cost.

You can also force a filesystem check on reboot.
Please search the forum to find out how.
I think you need to create a file in the boot partition.

The log is after a console reboot, but when the raspi stop responding (happens from time to time) I can only reboot removing the power.

fsck is run automatically and still says I need to do it manually.

feb 08 00:00:44 osmc fsck: E2fsck run: /bin/e2fsck -f -y -C 0 /dev/mmcblk0p2
feb 08 00:00:44 osmc fsck: e2fsck 1.42.13 (17-May-2015)
feb 08 00:00:44 osmc fsck: Filesystem UUID: 4eb79e36-c927-4248-98ce-e7b5713cb0a9
feb 08 00:00:44 osmc fsck: Superblock needs_recovery flag is clear, but journal has data.
feb 08 00:00:44 osmc fsck: Run journal anyway? yes
feb 08 00:00:44 osmc fsck:
feb 08 00:00:44 osmc fsck: Filesystem UUID: 4eb79e36-c927-4248-98ce-e7b5713cb0a9
feb 08 00:00:44 osmc fsck:
feb 08 00:00:44 osmc fsck: /dev/mmcblk0p2: ********** WARNING: Filesystem still has errors **********
feb 08 00:00:44 osmc fsck:

I wil try @yknivag solution

Running fsck on a mounted filesystem is not a good idea.
sudo touch /forcefsck && sudo reboot and OSMC will run a full filesystem check on reboot.

I get the same error about not being able to fix it.

You can try and fsck via a LiveCD.
But it sounds like bad corruption. You may need to reinstall. I would also recommend that you check your SD card.

Ok, the recovery method did not work (it boots the same way) and in fact the file appear without recovery after the reboot (I did a sudo and checked the file was changed twice after saving it).

And trying to fix it with windows did not fix anything, I will probably go with a reinstall as the raspi probably was installed almost 2 years ago with the firsts osmc versions, so it not a bad idea to restart everything.

Is it not possible to run fsck in busybox at the recovery console either before it mounts or unmount and run there?

Your SD card is failing (or one of the ones that reports fake capacity). I think you would be wise to look at replacing it. The OSMC store sells good quality cards at an affordable price.

Yes. If you suggested that then I missed that, apologies.
forcefsck usually works well though if the filesystem is salvageable.