ZRAM nightly sync, openhab service restart

I lost power yesterday, and subsequently lost all historic data since I booted the Raspberry Pi.

Do I understand the statement I quoted correctly, that zram is syncing nightly to disk?

I just ran sudo /usr/local/sbin/zram-config sync which caused OH to restart. This implies to me running the command is not advisable when OH is running.

So, is there a way to sync the zram data to disk? Ideally automatically.


[edit1] Reading on Git: When running zram on a directory that has services accessing it, they will need to be stopped before starting or stopping zram. For example, in the log zram device zram-config stops the services that run by default in the /var/log directory before starting or stopping. If your system has other services that write to /var/log that are not stopped zram may fail to properly sync files and remove the zram device when stopping, and will probably outright fail to start when initializing a zram device. This issue is not limited to logs, if you are running zram on another directory that is written to by a service you will run into the same issue.

It seems zram cannot be synced to disk while OH is running.

1 Like