Openhab suddenly doesn't start anymore

To be very clear I don’t know the cause, nor am I saying the following is the cause. The following is advice that will make your setup more reliable. Your SD card will be fine to use if you refresh its contents, but it is safer to not touch it in case your backups miss something, you can go back and grab what you need.

Make sure you buy SD cards from a reliable source you can trust, counterfeit cards are common if you look for the cheapest source. If we rule out a counterfeit card, then it could be corruption due to not having a UPS.

If the power fails in the middle of a flash based write, it does not just corrupt the file that is being written but because of the way flash needs to write in BLOCKS, it can corrupt files which were not being written to. A UPS stops this to some extent up until the battery is flat and if the power fails off and on, with a flat battery some UPS can actually make this worse. The way that commercial devices that boot from flash storage get around this like your wifi router, is to stop writing to flash completely. No writes = no chance for corruption. So make sure you use openhabian’s zram features.

ZRAM status - Tutorials & Examples - openHAB Community

1 Like