ZRAM compatibility on Raspberry Pi 4 8 GB

  • Platform information:
    • Hardware: Raspberry Pi 4 8GB
    • OS: openhabian
    • openHAB version: 2.5.10

I understand that currently ZRAM is not enabled on RPI4 8 GB by default due to some compatibility issues.

Is there a way of getting ZRAM working on RPI4 even if it is a little unstable?
Is there any alternative to stop my SD Card from corrupting?
Will there be a patch in OH 3 that might fix this issue?

I recently bought a RPI4 8 GB just to run OpenHAB and it is pretty disappointing knowing that my SD card will easily corrupt with long term use :frowning:

Will it?

Here’s an anecdotal data point: I’ve been running with the same SD Card in the same Pi since January 2019 - almost two years. I know others have even longer working setups. I take care to save logs to a USB stick, and don’t pull power from the Pi without shutting it down properly first.

Anyway, slightly off topic I guess, but don’t be afraid to use what you’ve got already: just take care not to fill up the SD card, use a good quality SD card, don’t pull the power whilst it’s on, and regularly backup! That should be enough to get you running until ZRAM becomes an option on the 8GB version.

Its because of the way the 32bit kernal addresses the ram because it is over 4 gig.

Use the 64bit openhabian. I have it working with oh3 and zram on pi4 8gig

Thats reassuring! Just a quick question - how were you able to move the location of where logs are saved?

Just make sure that the new folder can be written to by whatever user openHAB operates under.

But do take note of @denominator

Now that I have more than 1 gig of ram I use more

How about just mount log folders in tmpfs?
I did so for my Pi3 and it’s work perfect. The only note you should do as described in my post here /var/log on tmpfs - openhab2 directory issue.
Also ALWAYS use UPS for raspberry and you will not have any problems with SD cards.

You can do but there’s much more to write to SD than just logs so it’ll not buy you much.

Wrong. It ain’t that simple. See Corrupt FileSystems every 2-3 month?

This two simple steps solved issue with SD/USB cards in my case.

No it’s no “solution”. It just lowered the probability you get hit.

If that’s the case, do you know when we might see a fix for ZRAM on RPI4 8GB?

No. It’s a Linux kernel issue but I doubt kernel devs are really aware of it.
Use the 64bit openHABian or restrict your mem to 4GB via kernel parameters.
Or sell your big iron on *bay, get a 4G one and sponsor the openHAB foundation with the net profit.

2 Likes

Not sure what that means. RPi3/4 are 64bit HW.

Wishing to start exploring OpenHAB, I read some articles in this community (on which I subscribed today) in order to determine the best hardware to start with. When searching for a Raspberry PI 4 in the, to me available online, shops I discovered that the 4 GB RAM versions are all sold out. The 8 GB version is available. While i do understand that this is a waste of memory and buck I wonder whether there is a negative effect on OpenHAB installation and running on this (too large RAM’med) platform?

The 8gig HW issue has been resolved.

Buy either if you get a 8gig because of wait times go for it.

A 2GB Pi is also fine for openHAB if you want to go in the other direction.

James and Russ, thank you for the fast answers.