ZRAM status

Understood :wink:

I understand it that way, that this would sync the content too (without rebooting) but is not intended for that purpose and may bring some additional risk and cannot be recommended for a regular task (e.g. by cron or systemd-timer) - right?

Wouldn’t it be possible to regularly rsync instead between some of the overlay and the underlay directories similar to how ASD it does (“anything-sync-daemon”)?

Taken from https://wiki.archlinux.org/index.php/Anything-sync-daemon :

anything-sync-daemon (asd) is a tiny pseudo-daemon designed to manage user specified directories referred to as sync targets from here on out, in tmpfs and to periodically sync them back to the physical disc (HDD/SSD). This is accomplished via a symlinking step and an innovative use of rsync to maintain synchronization between a tmpfs copy and media-bound backups. Additionally, asd features several crash recovery features.

Well the main problem is I didn’t write the original code so I’m not aware of all the dependencies there may be, and ZRAM is an OverlayFS that is unlike decoupled systems where you can apply rsync/asd/whatever.
I already implemented the “sync” option to execute what it otherwise does on “stop” but ran into some issues by the time I did. Those still may or may no longer exist but I haven’t found the time to follow up.
Feel free to experiment with that and let me know how it works
But use a test system - no warranties.

Great work @mstormi! :smiley:

Only in OpenHABian I take it, correct? Not regular vanilla self-installed (from Debian repos) OpenHAB, amirite?

<offtopic

Every time I read something like this, it re-affirms (to me, anyway) that I made the right decision in keeping all my configs purely in text files this time around. :wink:

</offtopic

Not sure if that is the default in Raspbian or not, but I know it is in Armbian (which is what I use).

Which makes me wonder how the two might interact. Seems this is just for OpenHABian distro though, not OpenHAB itself if I am understanding correctly.

Yes of course.

OpenHABian on Armbian ? Duh, dunno. It might work but we don’t test that so you need to be prepared to hit issues.
But why complicate things and risk availability ? Run openHABian on a supported OS instead, Raspbian and Debian these are. If you want to stick with Armbian by all means, it also has ZRAM.

Oh no, I run regular OpenHAB on Armbian, not OpenHABian. Both of the latter I would consider as “distributions” essentially. In other words “one or the other.”

So in other words, if this change only affects OpenHABian (as you now confirmed) it doesn’t affect me at all.

Sorry if I was unclear!

12 posts were split to a new topic: ZRAM issues

I have the same lines on the log, but zram works anyway.

Didn’t you put the latest file revision of zram-config in place ?

Last month I installed OpenHab 2.5.4 from scratch starting from a fresh standard openhabian image and porting all bindings configurations one by one: therefore I am using standard zram settings now. I then upgraded to 2.5.5 (and I had some issue of standard bindings not being loaded, possibly related to the fact that my openhab installation take a significant amount of memory, but after a couple of openhab restarts and raspberry reboots everything came back to normal)

I’m referring to the zram-config script, latest version should not exhibit that behavior.
If it still does please open a GitHub issue there to track.

The version that I download from the link you wrote does not correspond to the one that is installed in my system. To be sure, I used openhabian-config and switched to the master branch (option which was not in place when I set up the new image, or at least, I did not pay attention). Then I applied the zram option (I have not uninstalled the earlier one). Finally I rebooted.
The date of the script in /usr/local/bin/zram-config is today, so I conclude that it has been downloaded from the master openhabian repository.

Is the latest version of the script at the link you indicated different from the one in the master openhabian repository?

zram-config is not part of openHABian but a dedicated repository which is where my link points to, so as you say you installed recently I wonder why yours is different

I would conclude that the openhabian-config script that is installed in my openhabian image (and that I actually updated using the menu option) does not point to your zram-config (as I am experiencing the same error as another user, I would not blame my system, which by way is one month old and I have not customized it)

Ok, that’s not a full but sort of an explanation.
You should be able to simply replace the script/binary with the one from my link, see if that makes your error messages go away.

So Zram on latest Openhabian is already installed and enabled?

I replaced the zram-config script and rebooted. The message is gone, but there is a missing file error,that you also had in your system

● zram-config.service - zram-config
 Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; vendor pres
 Active: active (exited) since Mon 2020-06-15 16:20:33 CEST; 2min 42s ago
 Process: 193 ExecStart=/usr/local/bin/zram-config start (code=exited, status=0
 Main PID: 193 (code=exited, status=0/SUCCESS)

Jun 15 16:20:31 openhab systemd[1]: Starting zram-config...
Jun 15 16:20:32 openhab zram-config[193]: grep: /boot/cmdline.txt: No such file
Jun 15 16:20:33 openhab systemd[1]: Started zram-config.

Anything misunderstandable about line 3 of post 1 ?

I’ve updated the link, download again. No need to reboot or restart.
I wonder why that file is missing on your system though.

[16:56:58] root@devpi:/boot# cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=b3faac31-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

I didn’t know it was enabled and was getting errors enabling it ,that is probably why.

I’ve update the script. The file /boot/cmdline.txt is present in my system, and \boot is present in my /etc/fstab file. If I remember well, a few months ago we possibly related this error to the mount order of the /srv/openhab2-* and zram. But with your version of the script this is gone.

In any case evertything continues to work flawlessly (I have to remember to shut-down the zram-config service before backup, in order to write the /srv/openhab2-userdata and reboot after backup). I have to say that I have not had sd corruptions since a long time thanks to to the zram-config implementation in openhbian. So thank you for your continuous hard work in supporting the openhab community,
Lionello