I have several RaspberryPi's running (~100). After a power breakdown some devices no longer started with the following error message:

enter image description here

It seems that the root-partition is broken. After I have connected the SD-card to the PC I was able to run fsck and within a few seconds everything was fixed and the SD-card booted without any problems.

My question: Is it possible to include fsck or something similar to the partition with the linux kernel? I like to make an automatic fsck at the boot-time to fix filesystem problems (especially problems onthe /-partition). Is this somehow possible or what is the best-practice to solve this problem?

The only alternative I see is to make the system read-only, but for this more effort is required. I hope I can avoid this now (and implement it later when I have more time).

Thank you very much

  • Have you considered a UPS? Aug 2, 2017 at 6:33
  • This probably would be too expensive for all devices, but otherwise it could be a solution. Unfortunately some of the users also just disconnect the device from the power source and then the filesystem still could break. Aug 2, 2017 at 6:35

2 Answers 2


After trying out the approach of creating a forcefsck file in /, fsck actually complained with the message:

Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system.

So instead of creating this file on every boot, I added fsck.mode=force to /boot/cmdline.txt.

This forces a fsck check on every reboot as well.

The setting fsck.repair=yes which is already in place should ensure that fsck always tries to repair issues, avoiding the need for manual interaction during the process.


You can place a file named forcefsck in /boot. So you can plug the SD card into any computer that is able to mount the FAT file system and create the file there.

But I don't know in wich stage of booting your panic happens and if you will reach the fsck stage before it. So it might or might not work.


A quick search on the raspberry pi forum suggests that forcesck has to placed be on the root and not the boot partition. /forcefsck instead of /boot/forcefsck. I think the latter will run fsck only on the boot partition.

  • The "mount error" is shown at the very beginning. So I'm not sure if the "/forcefsck" trick will work, because I think the kernel would require to mount to filesystem to recognize this file? Unfortunately I cannot test this, because if I create the file, I first have to fix the filesystem. Aug 2, 2017 at 8:14
  • Can you confirm that using the /forcefsck method it will automatically fix issues and not halt the process waiting for user input or anything like that?
    – Adam Reis
    Jun 13, 2018 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.