Mapdb doesn't restoreOnStartup

:roll_eyes: any other dir is ok, just not that one which must get unmounted.

what’s the point of your post then. You must have ZRAM and openhab running, then create the file, then reboot, then check if the file is still there.

i’m sorry, but i really don’t understand what i’m doing and why…
in the previous steps at least i had an idea of why i did what you told me…

but this last step is above me…

so i should create “another file” somewhere on the system?
if i create “some file” in /home/openhabian/ mapdb wouldn’t bother, would it?

i’m not trying to tease you - i really am this … “unskillful”. :disappointed:

:roll_eyes:
was bitte ist daran so schwer zu verstehen ? Du bist mit deiner Shell in genau dem Verzeichnis das beim Reboot abgemountet werden soll, was dazu führen kann dass ebendas nicht funktioniert. Also wechsel das Verzeichnis BEVOR du rebootest! z.B. cd /tmp.

unglaublich :man_facepalming:
i was thinking about the directory where i should create the file - not where i should run the reboot command from… sorry

still don’t understand what mapdb should do.
anyway:

[16:55:30] root@oha2:/home/openhabian# hostname > /var/lib/openhab2/persistence/host
[16:56:07] root@oha2:/home/openhabian# cat /var/lib/openhab2/persistence/host
oha2

reboot

[17:16:23] openhabian@oha2:~$ cat /var/lib/openhab2/persistence/host
oha2

okay, file still there!

and ZRAM was running for sure when you created the file ?

It should write to the persistence dir. I think on OH shutdown so browse the messages it gives after you issue reboot. If it does not your problem is with mapdb configuration and not ZRAM.
Is it enabled ? (persistence= line in /etc/openhab2/services/addons.cfg or the respective tab in PaperUI)
Does /var/lib/openhab2/persistence/mapdb exist ? Can user openhab write to it ?

mhm…
persisted data (mapdb) are still not restored properly:

[17:29:26] openhabian@oha2:~$ zramctl
NAME       ALGORITHM DISKSIZE  DATA  COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 26.1M 432.9K  860K       4 /opt/zram/zram2
/dev/zram1 lzo-rle       500M 17.3M 284.7K  704K       4 /opt/zram/zram1
/dev/zram0 lzo-rle       600M    4K    87B   12K       4 [SWAP]
2020-07-28 17:38:48.954 [ome.event.ItemCommandEvent] - Item 'WT_RN_1' received command OFF
2020-07-28 17:38:48.961 [vent.ItemStateChangedEvent] - WT_RN_1 changed from ON to OFF

2020-07-28 17:38:48.959 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for WT_RN_1
2020-07-28 17:38:48.963 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored 'WT_RN_1' with state 'OFF' in mapdb database

REBOOT

2020-07-28 17:41:39.869 [vent.ItemStateChangedEvent] - WT_RN_1 changed from NULL to ON

persistence
if it were disabled i wouldn’t get the log msg, would i?

yes:

[18:03:39] openhabian@oha2:~$ ls -l /var/lib/openhab2/persistence/mapdb
total 280
-rwxr-xr-x 1 openhab openhab     32 Jul 27 18:13 Readme.txt
-rw-r--r-- 1 openhab openhab  33064 Jul 28 18:03 storage.mapdb
-rw-r--r-- 1 openhab openhab 228192 Jul 28 18:03 storage.mapdb.p
-rw-r--r-- 1 openhab openhab     16 Jul 28 18:03 storage.mapdb.t

yes:

[18:06:27] openhabian@oha2:~$ sudo -u openhab touch /var/lib/openhab2/persistence/mapdb/testfile
[18:08:24] openhabian@oha2:~$ ls -l /var/lib/openhab2/persistence/mapdb
total 280
-rwxr-xr-x 1 openhab openhab     32 Jul 27 18:13 Readme.txt
-rw-r--r-- 1 openhab openhab  33064 Jul 28 18:08 storage.mapdb
-rw-r--r-- 1 openhab openhab 228192 Jul 28 18:08 storage.mapdb.p
-rw-r--r-- 1 openhab openhab     16 Jul 28 18:08 storage.mapdb.t
-rw-r--r-- 1 openhab openhab      0 Jul 28 18:08 testfile

mapdb.persist:

Strategies {
    everyHour       : "0 0 * * * ?"
    everyDay        : "0 0 0 * * ?"
    
    default = everyChange
}

Items {

        *   :   strategy = everyChange,restoreOnStartup

}

Okay, you have a log showing mapdb writing to (zram) file.
Now shut down openHAB tidily, then check to see if mapdb “hard” database file got touched.

sudo systemctl stop openhab2 ?

could you explain this?

Better systemctl disable openhab2 and then reboot so OH does not auto-start. Then check timestamps of the mapdb files. If they’re from the time of shutdown it’s not ZRAM.

BTW it takes some time after OH start until persistence gets restored. You should see a log message when.

are you sure you yourself caused the item to change or can it have been a message at restoration time ?

on the contrary! i didn’t do anything, this comes without me doing anything. i’m just looking at the log.

[18:59:08] root@oha2:/home/openhabian# systemctl disable openhab2
Removed /etc/systemd/system/multi-user.target.wants/openhab2.service.
[18:59:16] root@oha2:/home/openhabian# reboot
[19:05:49] openhabian@oha2:~$ ls -l /var/lib/openhab2/persistence/mapdb
total 268
-rwxr-xr-x 1 openhab openhab     32 Jul 27 18:13 Readme.txt
-rw-r--r-- 1 openhab openhab  33064 Jul 28 17:06 storage.mapdb
-rw-r--r-- 1 openhab openhab 228192 Jul 28 17:06 storage.mapdb.p
-rw-r--r-- 1 openhab openhab     16 Jul 28 17:06 storage.mapdb.t

and i don’t know where the testfile from before went. i didn’t delete it :frowning:

Restore on startup actioned by persistence is silent (by design) and does not leave change events footprints.
A change event from NULL is by some other update- manual, binding.

With debug logging on you should see when OH restore mapdb items.

before i disabled OH the only message regarding this item was that line i posted. there’s nothing else in events.log / openhab.log


on my post from before mapdb files had timestamp 18:03,
now it’s 17:06 ?

i have only done what i posted here, except clicking some switches on habpanel.
i have not disabled zram-config…

[19:31:39] openhabian@oha2:~$ ls -l /var/lib/openhab2/persistence/mapdb
total 280
-rwxr-xr-x 1 openhab openhab     32 Jul 27 18:13 Readme.txt
-rw-r--r-- 1 openhab openhab  33064 Jul 28 19:32 storage.mapdb
-rw-r--r-- 1 openhab openhab 228192 Jul 28 19:32 storage.mapdb.p
-rw-r--r-- 1 openhab openhab     16 Jul 28 19:32 storage.mapdb.t
[19:33:20] openhabian@oha2:~$ zramctl
NAME       ALGORITHM DISKSIZE  DATA  COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 26.1M 409.8K  820K       4 /opt/zram/zram2
/dev/zram1 lzo-rle       500M 17.3M 200.9K  584K       4 /opt/zram/zram1
/dev/zram0 lzo-rle       600M    4K    87B   12K       4 [SWAP]
[19:33:30] openhabian@oha2:~$ sudo systemctl disable openhab2
[sudo] password for openhabian:
Removed /etc/systemd/system/multi-user.target.wants/openhab2.service.
[19:34:00] openhabian@oha2:~$ sudo reboot

[19:35:17] openhabian@oha2:~$ ls -l /var/lib/openhab2/persistence/mapdb
total 268
-rwxr-xr-x 1 openhab openhab     32 Jul 27 18:13 Readme.txt
-rw-r--r-- 1 openhab openhab  33064 Jul 28 17:06 storage.mapdb
-rw-r--r-- 1 openhab openhab 228192 Jul 28 17:06 storage.mapdb.p
-rw-r--r-- 1 openhab openhab     16 Jul 28 17:06 storage.mapdb.t
[19:35:21] openhabian@oha2:~$ zramctl
NAME       ALGORITHM DISKSIZE  DATA  COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 25.3M 165.1K  572K       4 /opt/zram/zram2
/dev/zram1 lzo-rle       500M 16.4M     7K   96K       4 /opt/zram/zram1
/dev/zram0 lzo-rle       600M    4K    87B   12K       4 [SWAP]

No doubt, but it wouldn’t be the events.log ItemStateChangedEvent
I’m just saying that indicates a binding or manual update and tells us nothing directly about restore … except that in this case it shows us a restore did not happen because the from-state was NULL.

Possibly because they were not synced. See timestamps in /opt/zram/persistence.bind/ for the storage on SD.
Check journalctl -xu zram-config and /usr/local/share/zram-config/log/zram-config.log what it did when you issued reboot.

[22:37:25] root@oha2:/home/openhabian# ls -l /opt/zram/persistence.bind/
total 20
-rw-r--r-- 1 root    root      30 Jul 28 14:24 date
drwxr-xr-x 2 openhab openhab 4096 Jul 27 18:13 db4o
-rw-r--r-- 1 root    root       5 Jul 28 16:56 host
drwxr-xr-x 2 openhab openhab 4096 Jul 28 17:06 mapdb
drwxr-xr-x 2 openhab openhab 4096 Jul 28 17:06 rrd4j

woah, that’s many lines:

Jul 28 19:34:20 oha2 systemd[1]: Stopping zram-config...
-- Subject: A stop job for unit zram-config.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit zram-config.service has begun execution.
--
-- The job identifier is 644.
Jul 28 19:34:20 oha2 zram-config[1743]: + ZSHARE=/usr/local/share/zram-config
Jul 28 19:34:20 oha2 zram-config[1743]: + ZLOG=/usr/local/share/zram-config/log/zram-config.log
Jul 28 19:34:20 oha2 zram-config[1743]: + ZDIR=/opt/zram
Jul 28 19:34:20 oha2 zram-config[1743]: + [[ -f /boot/cmdline.txt ]]
Jul 28 19:34:20 oha2 zram-config[1743]: + ZEPHEMERAL=false
Jul 28 19:34:20 oha2 zram-config[1743]: + case "$1" in
Jul 28 19:34:20 oha2 zram-config[1743]: ++ date +%Y-%m-%d-%H:%M:%S
Jul 28 19:34:20 oha2 zram-config[1743]: + echo 'zram-config stop 2020-07-28-19:34:20'
Jul 28 19:34:20 oha2 zram-config[1743]: + tac /usr/local/share/zram-config/zram-device-list
Jul 28 19:34:20 oha2 zram-config[1743]: + file=/usr/local/share/zram-config/zram-device-list.rev
Jul 28 19:34:20 oha2 zram-config[1743]: + read -r line
Jul 28 19:34:20 oha2 zram-config[1743]: + case "$line" in
Jul 28 19:34:20 oha2 zram-config[1743]: + set -- log /zram2 /var/log /log.bind
Jul 28 19:34:20 oha2 zram-config[1743]: + echo 'ztab remove log /zram2 /var/log /log.bind'
Jul 28 19:34:20 oha2 zram-config[1743]: + case "$1" in
Jul 28 19:34:20 oha2 zram-config[1743]: + ZTYPE=log
Jul 28 19:34:20 oha2 zram-config[1743]: + ZRAM_DEV=/zram2
Jul 28 19:34:20 oha2 zram-config[1743]: + TARGET_DIR=/var/log
Jul 28 19:34:20 oha2 zram-config[1743]: + BIND_DIR=/log.bind
Jul 28 19:34:20 oha2 zram-config[1743]: + '[' false = false ']'
Jul 28 19:34:20 oha2 zram-config[1743]: + removeZlog
Jul 28 19:34:20 oha2 zram-config[1743]: + '[' '!' -z '' ']'
Jul 28 19:34:20 oha2 zram-config[1743]: + echo /zram2
Jul 28 19:34:20 oha2 zram-config[1743]: ++ echo /zram2
Jul 28 19:34:20 oha2 zram-config[1743]: ++ tr -dc 0-9
Jul 28 19:34:20 oha2 zram-config[1743]: + DEV_NUM=2
Jul 28 19:34:20 oha2 zram-config[1743]: + '[' '!' -z /var/log ']'
Jul 28 19:34:20 oha2 zram-config[1743]: + invoke-rc.d rsyslog stop
Jul 28 19:34:20 oha2 zram-config[1743]: + invoke-rc.d nginx stop
Jul 28 19:34:20 oha2 zram-config[1743]: + umount --verbose /var/log/
Jul 28 19:34:20 oha2 zram-config[1743]: + sleep .1
Jul 28 19:34:20 oha2 zram-config[1743]: + invoke-rc.d rsyslog stop
Jul 28 19:34:20 oha2 zram-config[1743]: + invoke-rc.d nginx stop
Jul 28 19:34:20 oha2 zram-config[1743]: + umount --verbose -l /var/log/
Jul 28 19:34:20 oha2 zram-config[1743]: + mergeOverlay
Jul 28 19:34:20 oha2 zram-config[1743]: + return 1
Jul 28 19:34:20 oha2 zram-config[1743]: + read -r line
Jul 28 19:34:20 oha2 zram-config[1743]: + case "$line" in
Jul 28 19:34:20 oha2 zram-config[1743]: + set -- dir /zram1 /var/lib/openhab2/persistence /persistence.bind
Jul 28 19:34:20 oha2 zram-config[1743]: + echo 'ztab remove dir /zram1 /var/lib/openhab2/persistence /persistence.bind'
Jul 28 19:34:20 oha2 zram-config[1743]: + case "$1" in
Jul 28 19:34:20 oha2 zram-config[1743]: + ZTYPE=dir
Jul 28 19:34:20 oha2 zram-config[1743]: + ZRAM_DEV=/zram1
Jul 28 19:34:20 oha2 zram-config[1743]: + TARGET_DIR=/var/lib/openhab2/persistence
Jul 28 19:34:20 oha2 zram-config[1743]: + BIND_DIR=/persistence.bind
Jul 28 19:34:20 oha2 zram-config[1743]: + '[' false = false ']'
Jul 28 19:34:20 oha2 zram-config[1743]: + removeZdir
Jul 28 19:34:20 oha2 zram-config[1743]: + echo /zram1
Jul 28 19:34:20 oha2 zram-config[1743]: ++ echo /zram1
Jul 28 19:34:20 oha2 zram-config[1743]: ++ tr -dc 0-9
Jul 28 19:34:20 oha2 zram-config[1743]: + DEV_NUM=1
Jul 28 19:34:20 oha2 zram-config[1743]: + '[' '!' -z /var/lib/openhab2/persistence ']'
Jul 28 19:34:20 oha2 zram-config[1743]: + umount --verbose /var/lib/openhab2/persistence/
Jul 28 19:34:20 oha2 zram-config[1743]: + echo 'umount /var/lib/openhab2/persistence/'
Jul 28 19:34:20 oha2 zram-config[1743]: + mergeOverlay
Jul 28 19:34:20 oha2 zram-config[1743]: + return 1
Jul 28 19:34:20 oha2 zram-config[1743]: + read -r line
Jul 28 19:34:20 oha2 zram-config[1743]: + case "$line" in
Jul 28 19:34:20 oha2 zram-config[1743]: + set -- swap /zram0 zram-config0
Jul 28 19:34:20 oha2 zram-config[1743]: + echo 'ztab remove swap /zram0 zram-config0 '
Jul 28 19:34:20 oha2 zram-config[1743]: + case "$1" in
Jul 28 19:34:20 oha2 zram-config[1743]: + ZTYPE=swap
Jul 28 19:34:20 oha2 zram-config[1743]: + ZRAM_DEV=/zram0
Jul 28 19:34:20 oha2 zram-config[1743]: + LABEL=zram-config0
Jul 28 19:34:20 oha2 zram-config[1743]: + removeZswap
Jul 28 19:34:20 oha2 zram-config[1743]: ++ echo /zram0
Jul 28 19:34:20 oha2 zram-config[1743]: ++ tr -dc 0-9
Jul 28 19:34:20 oha2 zram-config[1743]: + DEV_NUM=0
Jul 28 19:34:20 oha2 zram-config[1743]: + swapoff /dev/zram0
Jul 28 19:34:20 oha2 zram-config[1743]: + echo 0
Jul 28 19:34:21 oha2 zram-config[1743]: + /sbin/zramctl -r /dev/zram0
Jul 28 19:34:21 oha2 zram-config[1743]: + echo '/dev/zram0 removed'
Jul 28 19:34:21 oha2 zram-config[1743]: + read -r line
Jul 28 19:34:21 oha2 zram-config[1743]: + rm -fv /usr/local/share/zram-config/zram-device-list.rev /usr/local/share/zram
Jul 28 19:34:21 oha2 systemd[1]: zram-config.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit zram-config.service has successfully entered the 'dead' state.
Jul 28 19:34:21 oha2 systemd[1]: Stopped zram-config.
-- Subject: A stop job for unit zram-config.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit zram-config.service has finished.
--
-- The job identifier is 644 and the job result is done.
-- Reboot --
Jul 28 19:34:22 oha2 systemd[1]: Starting zram-config...
-- Subject: A start job for unit zram-config.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit zram-config.service has begun execution.
--
-- The job identifier is 70.
Jul 28 19:34:22 oha2 zram-config[262]: + ZSHARE=/usr/local/share/zram-config
Jul 28 19:34:22 oha2 zram-config[262]: + ZLOG=/usr/local/share/zram-config/log/zram-config.log
Jul 28 19:34:22 oha2 zram-config[262]: + ZDIR=/opt/zram
Jul 28 19:34:22 oha2 zram-config[262]: + [[ -f /boot/cmdline.txt ]]
Jul 28 19:34:22 oha2 zram-config[262]: + ZEPHEMERAL=false
Jul 28 19:34:22 oha2 zram-config[262]: + case "$1" in
Jul 28 19:34:22 oha2 zram-config[262]: ++ date +%Y-%m-%d-%H:%M:%S
Jul 28 19:34:22 oha2 zram-config[262]: + echo 'zram-config start 2020-07-28-19:34:22'
Jul 28 19:34:22 oha2 zram-config[262]: + rm -f /usr/local/share/zram-config/zram-device-list.new
Jul 28 19:34:22 oha2 zram-config[262]: + file=/etc/ztab
Jul 28 19:34:22 oha2 zram-config[262]: + ZTAB_EMPTY=true
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + set -- swap lz4 200M 600M 75 0 90
Jul 28 19:34:22 oha2 zram-config[262]: + echo 'ztab create swap lz4 200M 600M 75 0 90  '
Jul 28 19:34:22 oha2 zram-config[262]: + ZTAB_EMPTY=false
Jul 28 19:34:22 oha2 zram-config[262]: + ZTYPE=swap
Jul 28 19:34:22 oha2 zram-config[262]: + ALG=lz4
Jul 28 19:34:22 oha2 zram-config[262]: + MEM_SIZE=200M
Jul 28 19:34:22 oha2 zram-config[262]: + DISK_SIZE=600M
Jul 28 19:34:22 oha2 zram-config[262]: + '[' -f /usr/local/share/zram-config/zram-device-list ']'
Jul 28 19:34:22 oha2 zram-config[262]: + test -f /usr/local/share/zram-config/zram-device-list.new
Jul 28 19:34:22 oha2 zram-config[262]: + case "$1" in
Jul 28 19:34:22 oha2 zram-config[262]: + PRIORITY=75
Jul 28 19:34:22 oha2 zram-config[262]: + PAGE_CLUSTER=0
Jul 28 19:34:22 oha2 zram-config[262]: + SWAPPINESS=90
Jul 28 19:34:22 oha2 zram-config[262]: + createZswap
Jul 28 19:34:22 oha2 zram-config[262]: + createZdevice
Jul 28 19:34:22 oha2 zram-config[262]: + '[' '!' -d /sys/class/zram-control ']'
Jul 28 19:34:22 oha2 zram-config[262]: + modprobe --verbose zram
Jul 28 19:34:22 oha2 zram-config[262]: + RAM_DEV=0
Jul 28 19:34:22 oha2 zram-config[262]: + '[' '!' -z 200M ']'
Jul 28 19:34:22 oha2 zram-config[262]: + echo 200M
Jul 28 19:34:22 oha2 zram-config[262]: + '[' '!' -z 600M ']'
Jul 28 19:34:22 oha2 zram-config[262]: + echo 600M
Jul 28 19:34:22 oha2 zram-config[262]: + '[' '!' -z lz4 ']'
Jul 28 19:34:22 oha2 zram-config[262]: + echo lz4
Jul 28 19:34:22 oha2 zram-config[262]: + echo 'zram0 created comp_algorithm=lz4 mem_limit=200M disksize=600M'
Jul 28 19:34:22 oha2 zram-config[262]: + mkswap --label zram-config0 /dev/zram0
Jul 28 19:34:22 oha2 zram-config[262]: + '[' '!' -z 75 ']'
Jul 28 19:34:22 oha2 zram-config[262]: + swapon -v -p 75 /dev/zram0
Jul 28 19:34:22 oha2 zram-config[262]: + '[' '!' -z 0 ']'
Jul 28 19:34:22 oha2 zram-config[262]: + sysctl vm.page-cluster=0
Jul 28 19:34:22 oha2 zram-config[262]: + '[' '!' -z 90 ']'
Jul 28 19:34:22 oha2 zram-config[262]: + sysctl vm.swappiness=90
Jul 28 19:34:22 oha2 zram-config[262]: + echo 'swap                /zram0                zram-config0'
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + continue
Jul 28 19:34:22 oha2 zram-config[262]: + read -r line
Jul 28 19:34:22 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:22 oha2 zram-config[262]: + set -- dir lz4 150M 500M /var/lib/openhab2/persistence /persistence.bind
Jul 28 19:34:22 oha2 zram-config[262]: + echo 'ztab create dir lz4 150M 500M /var/lib/openhab2/persistence /persistence.
Jul 28 19:34:22 oha2 zram-config[262]: + ZTAB_EMPTY=false
Jul 28 19:34:22 oha2 zram-config[262]: + ZTYPE=dir
Jul 28 19:34:22 oha2 zram-config[262]: + ALG=lz4
Jul 28 19:34:22 oha2 zram-config[262]: + MEM_SIZE=150M
Jul 28 19:34:22 oha2 zram-config[262]: + DISK_SIZE=500M
Jul 28 19:34:22 oha2 zram-config[262]: + '[' -f /usr/local/share/zram-config/zram-device-list ']'
Jul 28 19:34:22 oha2 zram-config[262]: + '[' dir = swap ']'
Jul 28 19:34:22 oha2 zram-config[262]: ++ egrep 'dir.*/var/lib/openhab2/persistence' /usr/local/share/zram-config/zram-d
Jul 28 19:34:22 oha2 zram-config[262]: + entry=
Jul 28 19:34:22 oha2 zram-config[262]: + '[' -n '' ']'
Jul 28 19:34:22 oha2 zram-config[262]: + test -f /usr/local/share/zram-config/zram-device-list.new
Jul 28 19:34:22 oha2 zram-config[262]: + case "$1" in
Jul 28 19:34:22 oha2 zram-config[262]: + TARGET_DIR=/var/lib/openhab2/persistence
Jul 28 19:34:22 oha2 zram-config[262]: + BIND_DIR=/persistence.bind
Jul 28 19:34:22 oha2 zram-config[262]: + '[' false = false ']'
Jul 28 19:34:22 oha2 zram-config[262]: + createZdir
Jul 28 19:34:22 oha2 zram-config[262]: + '[' '!' -z /persistence.bind ']'
Jul 28 19:34:22 oha2 zram-config[262]: + mkdir -p /opt/zram/persistence.bind
Jul 28 19:34:22 oha2 zram-config[262]: + '[' '!' -z /var/lib/openhab2/persistence ']'
Jul 28 19:34:22 oha2 zram-config[262]: ++ stat -c %a /var/lib/openhab2/persistence
Jul 28 19:34:22 oha2 zram-config[262]: + dirPerm=755
Jul 28 19:34:22 oha2 zram-config[262]: ++ stat -c %u /var/lib/openhab2/persistence
Jul 28 19:34:22 oha2 zram-config[262]: + dirUser=110
Jul 28 19:34:22 oha2 zram-config[262]: ++ stat -c %g /var/lib/openhab2/persistence
Jul 28 19:34:22 oha2 zram-config[262]: + dirGroup=115
Jul 28 19:34:22 oha2 zram-config[262]: + echo 'dirPerm /var/lib/openhab2/persistence 755 110:115'
Jul 28 19:34:22 oha2 zram-config[262]: + mount --verbose --bind /var/lib/openhab2/persistence/ /opt/zram/persistence.bin
Jul 28 19:34:23 oha2 zram-config[262]: + mount --verbose --make-private /opt/zram/persistence.bind/
Jul 28 19:34:23 oha2 zram-config[262]: ++ awk -v a=/opt/zram/persistence.bind '$2 == a {print $4}' /proc/mounts
Jul 28 19:34:23 oha2 zram-config[262]: ++ head -1
Jul 28 19:34:23 oha2 zram-config[262]: + dirMountOpt=rw,noatime
Jul 28 19:34:23 oha2 zram-config[262]: ++ awk -v a=/opt/zram/persistence.bind '$2 == a {print $3}' /proc/mounts
Jul 28 19:34:23 oha2 zram-config[262]: ++ head -1
Jul 28 19:34:23 oha2 zram-config[262]: + dirFsType=ext4
Jul 28 19:34:23 oha2 zram-config[262]: + echo 'dirMountOpt rw,noatime dirFsType ' ext4
Jul 28 19:34:23 oha2 zram-config[262]: + createZdevice
Jul 28 19:34:23 oha2 zram-config[262]: + '[' '!' -d /sys/class/zram-control ']'
Jul 28 19:34:23 oha2 zram-config[262]: ++ cat /sys/class/zram-control/hot_add
Jul 28 19:34:23 oha2 zram-config[262]: + RAM_DEV=1
Jul 28 19:34:23 oha2 zram-config[262]: + '[' '!' -z 150M ']'
Jul 28 19:34:23 oha2 zram-config[262]: + echo 150M
Jul 28 19:34:23 oha2 zram-config[262]: + '[' '!' -z 500M ']'
Jul 28 19:34:23 oha2 zram-config[262]: + echo 500M
Jul 28 19:34:23 oha2 zram-config[262]: + '[' '!' -z lz4 ']'
Jul 28 19:34:23 oha2 zram-config[262]: + echo lz4
Jul 28 19:34:23 oha2 zram-config[262]: + echo 'zram1 created comp_algorithm=lz4 mem_limit=150M disksize=500M'
Jul 28 19:34:23 oha2 zram-config[262]: + mke2fs -v -t ext4 /dev/zram1
Jul 28 19:34:23 oha2 zram-config[262]: + mkdir -p /opt/zram/zram1
Jul 28 19:34:23 oha2 zram-config[262]: + mount --verbose --types ext4 -o rw,noatime /dev/zram1 /opt/zram/zram1/
Jul 28 19:34:23 oha2 zram-config[262]: + mkdir -p /opt/zram/zram1/upper /opt/zram/zram1/workdir /var/lib/openhab2/persis
Jul 28 19:34:23 oha2 zram-config[262]: + mount --verbose --types overlay -o redirect_dir=on,lowerdir=/opt/zram/persisten
Jul 28 19:34:23 oha2 zram-config[262]: + chown 110:115 /opt/zram/zram1/upper /opt/zram/zram1/workdir /var/lib/openhab2/p
Jul 28 19:34:23 oha2 zram-config[262]: + chmod 755 /opt/zram/zram1/upper /opt/zram/zram1/workdir /var/lib/openhab2/persi
Jul 28 19:34:23 oha2 zram-config[262]: + echo 'dir                /zram1                /var/lib/openhab2/persistence
Jul 28 19:34:23 oha2 zram-config[262]: + read -r line
Jul 28 19:34:23 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:23 oha2 zram-config[262]: + continue
Jul 28 19:34:23 oha2 zram-config[262]: + read -r line
Jul 28 19:34:23 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:23 oha2 zram-config[262]: + continue
Jul 28 19:34:23 oha2 zram-config[262]: + read -r line
Jul 28 19:34:23 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:23 oha2 zram-config[262]: + continue
Jul 28 19:34:23 oha2 zram-config[262]: + read -r line
Jul 28 19:34:23 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:23 oha2 zram-config[262]: + continue
Jul 28 19:34:23 oha2 zram-config[262]: + read -r line
Jul 28 19:34:23 oha2 zram-config[262]: + case "$line" in
Jul 28 19:34:23 oha2 zram-config[262]: + set -- log lzo 150M 500M /var/log /log.bind
Jul 28 19:34:23 oha2 zram-config[262]: + echo 'ztab create log lzo 150M 500M /var/log /log.bind   '
Jul 28 19:34:23 oha2 zram-config[262]: + ZTAB_EMPTY=false
Jul 28 19:34:23 oha2 zram-config[262]: + ZTYPE=log
Jul 28 19:34:23 oha2 zram-config[262]: + ALG=lzo
Jul 28 19:34:23 oha2 zram-config[262]: + MEM_SIZE=150M
Jul 28 19:34:23 oha2 zram-config[262]: + DISK_SIZE=500M
Jul 28 19:34:23 oha2 zram-config[262]: + '[' -f /usr/local/share/zram-config/zram-device-list ']'
Jul 28 19:34:23 oha2 zram-config[262]: + '[' log = swap ']'
Jul 28 19:34:23 oha2 zram-config[262]: ++ egrep 'log.*/var/log' /usr/local/share/zram-config/zram-device-list
Jul 28 19:34:23 oha2 zram-config[262]: + entry=
Jul 28 19:34:23 oha2 zram-config[262]: + '[' -n '' ']'
Jul 28 19:34:23 oha2 zram-config[262]: + test -f /usr/local/share/zram-config/zram-device-list.new
Jul 28 19:34:23 oha2 zram-config[262]: + case "$1" in
Jul 28 19:34:23 oha2 zram-config[262]: + TARGET_DIR=/var/log
Jul 28 19:34:23 oha2 zram-config[262]: + BIND_DIR=/log.bind
Jul 28 19:34:23 oha2 zram-config[262]: + OLDLOG_DIR=
Jul 28 19:34:23 oha2 zram-config[262]: + '[' false = false ']'
Jul 28 19:34:23 oha2 zram-config[262]: + createZlog
Jul 28 19:34:23 oha2 zram-config[262]: + invoke-rc.d rsyslog stop
Jul 28 19:34:24 oha2 zram-config[262]: + invoke-rc.d nginx stop
Jul 28 19:34:25 oha2 zram-config[262]: + createZdir
Jul 28 19:34:25 oha2 zram-config[262]: + '[' '!' -z /log.bind ']'
Jul 28 19:34:25 oha2 zram-config[262]: + mkdir -p /opt/zram/log.bind
Jul 28 19:34:25 oha2 zram-config[262]: + '[' '!' -z /var/log ']'
Jul 28 19:34:25 oha2 zram-config[262]: ++ stat -c %a /var/log
Jul 28 19:34:25 oha2 zram-config[262]: + dirPerm=755
Jul 28 19:34:25 oha2 zram-config[262]: ++ stat -c %u /var/log
Jul 28 19:34:25 oha2 zram-config[262]: + dirUser=0
Jul 28 19:34:25 oha2 zram-config[262]: ++ stat -c %g /var/log
Jul 28 19:34:25 oha2 zram-config[262]: + dirGroup=0
Jul 28 19:34:25 oha2 zram-config[262]: + echo 'dirPerm /var/log 755 0:0'
Jul 28 19:34:25 oha2 zram-config[262]: + mount --verbose --bind /var/log/ /opt/zram/log.bind/
Jul 28 19:34:25 oha2 zram-config[262]: + mount --verbose --make-private /opt/zram/log.bind/
Jul 28 19:34:25 oha2 zram-config[262]: ++ awk -v a=/opt/zram/log.bind '$2 == a {print $4}' /proc/mounts
Jul 28 19:34:25 oha2 zram-config[262]: ++ head -1
Jul 28 19:34:25 oha2 zram-config[262]: + dirMountOpt=rw,noatime
Jul 28 19:34:25 oha2 zram-config[262]: ++ awk -v a=/opt/zram/log.bind '$2 == a {print $3}' /proc/mounts
Jul 28 19:34:25 oha2 zram-config[262]: ++ head -1
Jul 28 19:34:25 oha2 zram-config[262]: + dirFsType=ext4
Jul 28 19:34:25 oha2 zram-config[262]: + echo 'dirMountOpt rw,noatime dirFsType ' ext4
Jul 28 19:34:25 oha2 zram-config[262]: + createZdevice
Jul 28 19:34:25 oha2 zram-config[262]: + '[' '!' -d /sys/class/zram-control ']'
Jul 28 19:34:25 oha2 zram-config[262]: ++ cat /sys/class/zram-control/hot_add
Jul 28 19:34:25 oha2 zram-config[262]: + RAM_DEV=2
Jul 28 19:34:25 oha2 zram-config[262]: + '[' '!' -z 150M ']'
Jul 28 19:34:25 oha2 zram-config[262]: + echo 150M
Jul 28 19:34:25 oha2 zram-config[262]: + '[' '!' -z 500M ']'
Jul 28 19:34:25 oha2 zram-config[262]: + echo 500M
Jul 28 19:34:25 oha2 zram-config[262]: + '[' '!' -z lzo ']'
Jul 28 19:34:25 oha2 zram-config[262]: + echo lzo
Jul 28 19:34:25 oha2 zram-config[262]: + echo 'zram2 created comp_algorithm=lzo mem_limit=150M disksize=500M'
Jul 28 19:34:25 oha2 zram-config[262]: + mke2fs -v -t ext4 /dev/zram2
Jul 28 19:34:25 oha2 zram-config[262]: + mkdir -p /opt/zram/zram2
Jul 28 19:34:25 oha2 zram-config[262]: + mount --verbose --types ext4 -o rw,noatime /dev/zram2 /opt/zram/zram2/
Jul 28 19:34:25 oha2 zram-config[262]: + mkdir -p /opt/zram/zram2/upper /opt/zram/zram2/workdir /var/log
Jul 28 19:34:25 oha2 zram-config[262]: + mount --verbose --types overlay -o redirect_dir=on,lowerdir=/opt/zram/log.bind,
Jul 28 19:34:25 oha2 zram-config[262]: + chown 0:0 /opt/zram/zram2/upper /opt/zram/zram2/workdir /var/log
Jul 28 19:34:25 oha2 zram-config[262]: + chmod 755 /opt/zram/zram2/upper /opt/zram/zram2/workdir /var/log
Jul 28 19:34:25 oha2 zram-config[262]: + echo 'log                /zram2                /var/log                /log.bin
Jul 28 19:34:25 oha2 zram-config[262]: + invoke-rc.d rsyslog start
Jul 28 19:34:25 oha2 zram-config[262]: + invoke-rc.d nginx start
Jul 28 19:34:26 oha2 zram-config[262]: + journalctl --flush
Jul 28 19:34:26 oha2 zram-config[262]: + '[' '!' -z '' ']'
Jul 28 19:34:26 oha2 zram-config[262]: + echo 'createZlog no oldlog dir in ztab'
Jul 28 19:34:26 oha2 zram-config[262]: + read -r line
Jul 28 19:34:26 oha2 zram-config[262]: + '[' false = true ']'
Jul 28 19:34:26 oha2 systemd[1]: Started zram-config.
-- Subject: A start job for unit zram-config.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit zram-config.service has finished successfully.
--
-- The job identifier is 70.

i think there’s a zram-config start and stop job? :slight_smile:
and this one:

[22:33:51] root@oha2:/home/openhabian# cat /usr/local/share/zram-config/log/zram-config.log
ztab remove log /zram2 /var/log /log.bind
/zram2
Failed to stop nginx.service: Unit nginx.service not loaded.
invoke-rc.d: initscript nginx, action "stop" failed.
umount: /var/log (overlay2) unmounted
+ echo 'overlay --lowerdir=/opt/zram/log.bind --upperdir=/opt/zram/zram2/upper'
overlay --lowerdir=/opt/zram/log.bind --upperdir=/opt/zram/zram2/upper
+ cd /usr/local/lib/zram-config/
+ echo y
+ ./overlay merge -l /opt/zram/log.bind -u /opt/zram/zram2/upper
Upper directory not specified.
Try './overlay --help' for more information.
+ return 1
ztab remove dir /zram1 /var/lib/openhab2/persistence /persistence.bind
/zram1
umount /var/lib/openhab2/persistence/
+ echo 'overlay --lowerdir=/opt/zram/persistence.bind --upperdir=/opt/zram/zram1/upper'
overlay --lowerdir=/opt/zram/persistence.bind --upperdir=/opt/zram/zram1/upper
+ cd /usr/local/lib/zram-config/
+ echo y
+ ./overlay merge -l /opt/zram/persistence.bind -u /opt/zram/zram1/upper
Upper directory not specified.
Try './overlay --help' for more information.
+ return 1
ztab remove swap /zram0 zram-config0
/dev/zram0 removed
removed '/usr/local/share/zram-config/zram-device-list.rev'
removed '/usr/local/share/zram-config/zram-device-list'
zram-config start 2020-07-28-19:34:22
ztab create swap lz4 200M 600M 75 0 90
insmod /lib/modules/5.4.51-v7l+/kernel/mm/zsmalloc.ko
insmod /lib/modules/5.4.51-v7l+/kernel/drivers/block/zram/zram.ko
zram0 created comp_algorithm=lz4 mem_limit=200M disksize=600M
Setting up swapspace version 1, size = 600 MiB (629141504 bytes)
LABEL=zram-config0, UUID=92929d5c-c26f-47ba-b8c3-5e02939e8acd
swapon: /dev/zram0: found signature [pagesize=4096, signature=swap]
swapon: /dev/zram0: pagesize=4096, swapsize=629145600, devsize=629145600
swapon /dev/zram0
vm.page-cluster = 0
vm.swappiness = 90
ztab create dir lz4 150M 500M /var/lib/openhab2/persistence /persistence.bind
dirPerm /var/lib/openhab2/persistence 755 110:115
mount: /var/lib/openhab2/persistence bound on /opt/zram/persistence.bind.
mount: /opt/zram/persistence.bind propagation flags changed.
dirMountOpt rw,noatime dirFsType  ext4
zram1 created comp_algorithm=lz4 mem_limit=150M disksize=500M
mke2fs 1.44.5 (15-Dec-2018)
fs_types for mke2fs.conf resolution: 'ext4', 'small'
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
128000 inodes, 128000 blocks
6400 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=132120576
4 block groups
32768 blocks per group, 32768 fragments per group
32000 inodes per group
Filesystem UUID: a1f5d58d-ee33-4430-8dbf-2a0a2fe2a23a
Superblock backups stored on blocks:
        32768, 98304

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

mount: /dev/zram1 mounted on /opt/zram/zram1.
mount: overlay1 mounted on /var/lib/openhab2/persistence.
ztab create log lzo 150M 500M /var/log /log.bind
Warning: Stopping rsyslog.service, but it can still be activated by:
  syslog.socket
Failed to stop nginx.service: Unit nginx.service not loaded.
invoke-rc.d: initscript nginx, action "stop" failed.
dirPerm /var/log 755 0:0
mount: /var/log bound on /opt/zram/log.bind.
mount: /opt/zram/log.bind propagation flags changed.
dirMountOpt rw,noatime dirFsType  ext4
zram2 created comp_algorithm=lzo mem_limit=150M disksize=500M
mke2fs 1.44.5 (15-Dec-2018)
fs_types for mke2fs.conf resolution: 'ext4', 'small'
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
128000 inodes, 128000 blocks
6400 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=132120576
4 block groups
32768 blocks per group, 32768 fragments per group
32000 inodes per group
Filesystem UUID: eb6752ca-2d77-44ac-b41d-ef5ae272d04e
Superblock backups stored on blocks:
        32768, 98304

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

mount: /dev/zram2 mounted on /opt/zram/zram2.
mount: overlay2 mounted on /var/log.
createZlog no oldlog dir in ztab

That’s what happens in the sync routine but that’s a strange error.
Try

systemctl stop openhab2
zramctl
ls -al /opt/zram/zram2 /opt/zram/zram2/upper /opt/zram/persistence.bind 
/usr/local/bin/zram-config stop
ls -al /opt/zram/zram2 /opt/zram/zram2/upper /opt/zram/persistence.bind 
zramctl

and/or insert ls -la $ZDIR$BIND_DIR $ZDIR$ZRAM_DEV/upper" >>${ZLOG}
into zram-config after the line mergeOverlay() {
What happens if you run

/usr/local/lib/zram-config/overlay merge -l /opt/zram/persistence.bind -u /opt/zram/zram1/upper
echo $?
[22:38:01] root@oha2:/home/openhabian# systemctl stop openhab2
Warning: The unit file, source configuration file or drop-ins of openhab2.service changed on disk. Run 'systemctl daemon                                 -reload' to reload units.
[23:11:15] root@oha2:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 28.8M  2.2M  2.7M       4
[23:11:19] root@oha2:/home/openhabian# ls -al /opt/zram/zram2 /opt/zram/zram2/upper /opt/zram/persistence.bind
ls: cannot access '/opt/zram/zram2': No such file or directory
ls: cannot access '/opt/zram/zram2/upper': No such file or directory
ls: cannot access '/opt/zram/persistence.bind': No such file or directory
[23:12:02] root@oha2:/home/openhabian# /usr/local/bin/zram-config stop
+ ZSHARE=/usr/local/share/zram-config
+ ZLOG=/usr/local/share/zram-config/log/zram-config.log
+ ZDIR=/opt/zram
+ [[ -f /boot/cmdline.txt ]]
+ grep -q init=/bin/ro-root.sh /boot/cmdline.txt
+ ZEPHEMERAL=false
+ case "$1" in
++ date +%Y-%m-%d-%H:%M:%S
+ echo 'zram-config stop 2020-07-28-23:12:13'
+ tac /usr/local/share/zram-config/zram-device-list
+ file=/usr/local/share/zram-config/zram-device-list.rev
+ read -r line
+ rm -fv /usr/local/share/zram-config/zram-device-list.rev /usr/local/share/zram-config/zram-device-list
[23:12:13] root@oha2:/home/openhabian# ls -al /opt/zram/zram2 /opt/zram/zram2/upper /opt/zram/persistence.bind
ls: cannot access '/opt/zram/zram2': No such file or directory
ls: cannot access '/opt/zram/zram2/upper': No such file or directory
ls: cannot access '/opt/zram/persistence.bind': No such file or directory
[23:12:19] root@oha2:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 28.8M  2.3M  2.8M       4
[23:12:23] root@oha2:/home/openhabian#

I’m note sure i got this right? was i supposed to enter just line 1?

[23:12:23] root@oha2:/home/openhabian# /usr/local/lib/zram-config/overlay merge -l /opt/zram/persistence.bind -u /opt/zram/zram1/upper
Lower directory not specified.
Try '/usr/local/lib/zram-config/overlay --help' for more information.

Disable OH start and reboot to make sure you have a proper starting point. zram2 was already gone so that output was useless.
Download latest version of zram-config, insert -x and try again

systemctl stop openhab2
zramctl
ls -al /opt/zram/zram2 /opt/zram/zram2/upper /opt/zram/persistence.bind 
/usr/local/bin/zram-config stop
ls -al /opt/zram/zram2 /opt/zram/zram2/upper /opt/zram/persistence.bind 
zramctl
/usr/local/lib/zram-config/overlay merge -l /opt/zram/persistence.bind -u /opt/zram/zram1/upper
echo $?