Data loss in rrd4j database after reboot

If you working with OH3 and openhabian try a disable and subsequently enable zram.

Yes OH3. I have deactivated the Zram for persistence in the /etc/ztab config and the data was stored after reboot. Afterwards I have activated it again and data between was lost again. So definitely something wrong with the reboot and Zram persistence.
I will keep deactivated but maybe somebody knows how to solve that issue.
I had a fresh installation and no migration.

Why you didn’t take the openhabian-config menu ?

+1 for me: RRD4j data loss after rebooting my Raspberry. Removed ZRAM now and now the perstisted data survive the reboot.

Because I wanted to have Zram enabled for log files

@mstormi maybe you can help for this topic?

Please don’t ping people. Most users feel annoyed by that and so do I.

Current ZRAM code works and is reboot safe. There have been issues lately though so if you have problems on your system first thing is to ensure you run the latest code.
Uninstall and reinstall ZRAM from the menu.

1 Like

Good to know.

I uninstalled and reinstalled from the menu and now it works. I updated everything before but I missed to reinstall again.
Thanks for the hint

I have the same issue. Pi 4 with OpenHabian, OH2.5 still, but the same, losing all RRD4J data. I tried to enable/disable ZRAM via the openhabian-config, but i get the following error:

image

OK, maybe the config tool error is nothing… after i tried a couple of times to enable ZRAM, but got the above error, i rebooted the Pi to see if that helped. Much to my delight, the rrd4j data was saved… so i guess it changed something, even though it gave the error!

I’ve been able to have the rrd4j data persist throughout reboots, but a power failure still resulted in data loss. Now I just moved persistence away from ZRAM entirely.

I had the exact same issue and uninstall ZRAM and enable it again via openhabian config worked for me. (raspi 4 and openHAB3)

Which will increase likelihood of a system crash by some fair n00 percent.
As stated above multiple times, uninstall + reinstall ZRAM.

How many times? Because once is obviously not enough.
I did read this topic, and did reinstall ZRAM already. I was happy to get from a place, where persistence was not persisted at all, to where it could survive a programmatic reboot. Then the power outage happened and I lost the persistence records again.
I am aware this will increase the wear on my SD card. I’m thinking of switching to a cloud based
(DynamoDB most likely) persistence to avoid that.

Of course. That’s what is to be expected on a power outage, isn’t it.
Read up ZRAM status - Tutorials & Examples - openHAB Community.

1 Like

Well that explains it then! Thanks for pointing this out. Seems like cloud persistence is a way for me then.

Ugh. I’d never make myself dependent on the Internet to work. But it’s your choice of course.

I get you. However until I can afford a UPS I don’t have that many options.

Take backups ?

1 Like

That goes without saying, yes :slight_smile:

Apparently not so. With standard nightly backup you loose at most 1 day of persistence data in case of a power outage (which shouldn’t be too often), so what.
You could even setup a cron job to copy persistence data every minute if you feel that to be important.