- Hardware: Raspberry Pi 3B
- OS: Raspbian Buster
- Java Runtime Environment: Zulu (openjdk version “1.8.0_152”)
- openHAB version: 2.4.0 (Build)
In order to preserve the SD card I’m using zram as described here:
In my setup zram is used to move all log files and the openHAB persistence files to RAM:
Using the checking tools provided in the instructions zram seems to work.
To be really sure that nothing is written to the SD-card I use this command to see what files have been changed:
sudo find / -cmin -1
Curiously this indicates that data is written to the SD-card as well as to zram (excerpt):
/var/lib/openhab2/persistence/rrd4j/nCpuTemperature.rrd /var/log/openhab2/events.log /opt/zram/zram1/upper/persistence/rrd4j/nCpuTemperature.rrd /opt/zram/zram2/upper/openhab2/events.log
Looking at these files using ls -al shows that they have the exact same time stamp which seems to confirm my apprehension.
The help section in the instruction says:
zram_dir is the directory you wish to hold in zram, the original is moved to a bind mount bind_dir and is synchronised on start/stop and write commands.
Does that mean that the SD card is written with every change of data in zram? If that’s so, what’s the benefit of zram?
How can I make sure the data only is written to zram and stored on the SD-card only when shutting down the system or maybe once a day?
Thanks a lot for any help!