my system was running with a Raspb. 3 and openhabian (2.3.0.1) without any big problems since 2017.
Today some lamps in the garden didnt turn on and i thought i reboot my raspberry. (sudo reboot)
All was looking normally via ssh before reboot. And now “Host is down”. (aaaahhhhhhhhhh)
Via HDMI i get KERNEL PANIC now !?
What is happening ? Can someone help me to get my system back ?
i can see all my data with “linux reader” (boot and files) on windows and already created an image of my files.
i have done nothing the last few months with my raspberry/openhab, only today to reboot.
The part “since 2017” scared me the most I just assume you are using a sd-card then I have to bring bad news. The sd-card is DEAD.
I hope you made some backups.
It’s a dead card, you can hope to read some data of it.
Try to just copy the data to save it example the openHAB conf /etc/openHAB2/ files and database files for example /var/lib/influxdb. (or the whole data)
For the future, I highly advice to use an ssd/usb for your RaspBerryPI. I had like 5-10 sd-cards failing.
There is some binary file that is part of the operating system kernel that has become corrupted. There are two ways this can happen.
Most Common: Power Loss
If the RPi loses power while it is writing to the SD card, it will lose that file write. No big deal, right? Wrong, because of the way SD cards work. Let’s say that OH is writing to it’s log file when power is lost. When writing to an SD card, what happens is it writes the full contents of a sector to another sector with the changes made. But more than one file can share the same sector, meaning that when you lose power, you lose not only part of openhab.log, but you also lose those parts of the other files that also were stored in that sector. Thus, on a power failure you can lose a part of the operating system kernel while writing to openhab.log.
Less Common: SD card wear out
Each sector of an SD card has a finite number of writes that it will support. When you hit that limit, the SD card simply just fails to save the writes. But there is no error. There is no indication that the write failed. It just doesn’t make the change, or when you reboot the changes made are lost. For example, I once had an SD card that would come up full when I restarted it. It turns out that the log rotation was failing. I’d manually delete the log files and when I rebooted the files would come right back.
Again, there is no error from the write. It just fails. And because of the way flash memory is written to, when it fails to write that log statement to openhab.log, it might just take a part of the kernel with it.
ALL flash memory has this problem: USB thumb drives, SD cards, eMMC, and SDDs. But SDDs are the safest of the group as they possess more circuitry and fail safes and have way more space to wear level across. But they still can wear out (but HDDs can also wear out) and they are very much susceptible to the power loss problem discussed above.
So honestly, you would be better off investing in a battery backup for your RPi rather than or in addition to an SDD. And there are alternatives to an UPS that can preserve your SD card such as moving most of the writes to RAM disk (see the zram option in openHABian) and configuring your root FS as read only (which is very effective but it can be a pain to then administer the device, AdaFruit has a script to help setting this up).