Mapdb doesn't restoreOnStartup

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 $?

should i stop zram-config before downloading latest version of zram-config?

does not matter

[23:37:01] root@oha2:/usr/local/bin# rm zram-config
[23:37:05] root@oha2:/usr/local/bin# wget https://raw.githubusercontent.com/mstormi/openhabian-zram/master/zram-config
...
2020-07-28 23:37:15 (5.71 MB/s) - ‘zram-config’ saved [11573/11573]

[23:37:15] root@oha2:/usr/local/bin# chmod 755 zram-config
[23:37:25] root@oha2:/usr/local/bin# nano zram-config
[23:37:48] root@oha2:/usr/local/bin# sudo reboot
[23:39:39] 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:39:41] root@oha2:/home/openhabian# zramctl
[23:39:55] root@oha2:/home/openhabian# ls -al /opt/zram/zram2 /opt/zram/zram2/upper /opt/zram/persistence.bind
ls: cannot access '/opt/zram/zram2/upper': No such file or directory
/opt/zram/persistence.bind:
total 8
drwxr-xr-x 2 root root 4096 Jul 28 23:36 .
drwxr-xr-x 8 root root 4096 Jul 28 23:36 ..

/opt/zram/zram2:
total 8
drwxr-xr-x 2 root root 4096 Jul 28 23:36 .
drwxr-xr-x 8 root root 4096 Jul 28 23:36 ..
[23:40:12] root@oha2:/home/openhabian# /usr/local/bin/zram-config stop
/usr/local/bin/zram-config: line 423: unexpected EOF while looking for matching `"'
/usr/local/bin/zram-config: line 427: syntax error: unexpected end of file

i guess there’s something wrong with the new zram-config ?

download again

and systemctl disable openhab2 before reboot.

[23:43:07] root@oha2:/home/openhabian# rm -f /usr/local/share/zram-config/zram-device-list*

(not sure if i have to do delete this file before downloading new zram-config?)

already disabled
downloaded zram-config again and rebootet

[23:55:55] 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:56:10] root@oha2:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 27.8M  1.3M  1.8M       4
[23:56:14] 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:56:24] 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:56:31'
+ 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:56:31] 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:56:38] root@oha2:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 27.9M  1.3M  1.8M       4
[23:56:45] 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.
[23:56:49] root@oha2:/home/openhabian# echo $?
1

Why do you stop openhab2 when it is not running?
Why is there only 1 zram dir ? You must have screwed up something.
Reboot, DO NOT stop OH and show zramctl. Eventually zram-config start.

it’s what you posted a few minutes ago. (and i assumed that it wouldn’t hurt top stop even if the service wasn’t started)

yes. but all i do is what i post here. i’m not doing anything else since this morning.

[00:08:49] root@oha2:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M   25M 87.9K  516K       4 /opt/zram/zram2
/dev/zram1 lzo-rle       500M 16.4M  7.1K   80K       4 /opt/zram/zram1
/dev/zram0 lzo-rle       600M    4K   87B   12K       4 [SWAP]

still need to zram-config start ?

no. now do the rest of commands

[00:08:51] root@oha2:/home/openhabian# ls -al /opt/zram/zram2 /opt/zram/zram2/upper /opt/zram/persistence.bind
/opt/zram/persistence.bind:
total 28
drwxr-xr-x 5 openhab openhab 4096 Jul 28 17:06 .
drwxr-xr-x 8 root    root    4096 Jul 29 00:02 ..
-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 23:11 mapdb
drwxr-xr-x 2 openhab openhab 4096 Jul 28 23:11 rrd4j

/opt/zram/zram2:
total 36
drwxr-xr-x 5 root root  4096 Jul 29 00:05 .
drwxr-xr-x 8 root root  4096 Jul 29 00:02 ..
drwx------ 2 root root 16384 Jul 29 00:05 lost+found
drwxr-xr-x 6 root root  4096 Jul 29 00:05 upper
drwxr-xr-x 3 root root  4096 Jul 29 00:05 workdir

/opt/zram/zram2/upper:
total 492
drwxr-xr-x  6 root      root              4096 Jul 29 00:05 .
drwxr-xr-x  5 root      root              4096 Jul 29 00:05 ..
-rw-r-----  1 root      adm              86142 Jul 29 00:09 auth.log
drwxr-sr-x+ 3 root      systemd-journal   4096 Jul 26 23:19 journal
-rw-rw-r--  1 root      utmp            292292 Jul 29 00:08 lastlog
drwxr-xr-x  2 mosquitto root              4096 Jul 28 23:56 mosquitto
drwxr-x---  2 root      root              4096 Jul 28 23:56 samba
drwxr-x---  2 root      root              4096 Jul 28 23:56 unattended-upgrades
-rw-rw-r--  1 root      utmp             60672 Jul 29 00:08 wtmp
[00:11:19] 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-29-00:11:26'
+ tac /usr/local/share/zram-config/zram-device-list
+ file=/usr/local/share/zram-config/zram-device-list.rev
+ read -r line
+ case "$line" in
+ set -- log /zram2 /var/log /log.bind
+ echo 'ztab remove log /zram2 /var/log /log.bind'
+ case "$1" in
+ ZTYPE=log
+ ZRAM_DEV=/zram2
+ TARGET_DIR=/var/log
+ BIND_DIR=/log.bind
+ '[' false = false ']'
+ removeZlog
+ '[' '!' -z '' ']'
+ echo /zram2
++ echo /zram2
++ tr -dc 0-9
+ DEV_NUM=2
+ '[' '!' -z /var/log ']'
+ invoke-rc.d rsyslog stop
+ invoke-rc.d nginx stop
+ umount --verbose /var/log/
+ sleep .1
+ invoke-rc.d rsyslog stop
+ invoke-rc.d nginx stop
+ umount --verbose -l /var/log/
+ mergeOverlay
+ '[' '!' -z /zram2 ']'
+ umount --verbose /opt/zram/zram2/
+ umount overlay2
+ rm -rv /opt/zram/zram2
+ '[' '!' -z /log.bind ']'
+ umount --verbose /opt/zram/log.bind/
+ rm -rv /opt/zram/log.bind
+ invoke-rc.d rsyslog stop
+ invoke-rc.d nginx stop
+ echo 2
+ /sbin/zramctl -r /dev/zram2
+ invoke-rc.d rsyslog start
+ invoke-rc.d nginx start
+ journalctl --flush
+ echo '/dev/zram2 removed'
+ read -r line
+ case "$line" in
+ set -- dir /zram1 /var/lib/openhab2/persistence /persistence.bind
+ echo 'ztab remove dir /zram1 /var/lib/openhab2/persistence /persistence.bind'
+ case "$1" in
+ ZTYPE=dir
+ ZRAM_DEV=/zram1
+ TARGET_DIR=/var/lib/openhab2/persistence
+ BIND_DIR=/persistence.bind
+ '[' false = false ']'
+ removeZdir
+ echo /zram1
++ echo /zram1
++ tr -dc 0-9
+ DEV_NUM=1
+ '[' '!' -z /var/lib/openhab2/persistence ']'
+ umount --verbose /var/lib/openhab2/persistence/
+ echo 'umount /var/lib/openhab2/persistence/'
+ mergeOverlay
+ '[' '!' -z /zram1 ']'
+ umount --verbose /opt/zram/zram1/
+ umount overlay1
umount: overlay1: no mount point specified.
+ rm -rv /opt/zram/zram1
+ '[' '!' -z /persistence.bind ']'
+ umount --verbose /opt/zram/persistence.bind/
+ rm -rv /opt/zram/persistence.bind
+ echo 1
+ /sbin/zramctl -r /dev/zram1
+ echo '/dev/zram1 removed'
+ read -r line
+ case "$line" in
+ set -- swap /zram0 zram-config0
+ echo 'ztab remove swap /zram0 zram-config0 '
+ case "$1" in
+ ZTYPE=swap
+ ZRAM_DEV=/zram0
+ LABEL=zram-config0
+ removeZswap
++ echo /zram0
++ tr -dc 0-9
+ DEV_NUM=0
+ swapoff /dev/zram0
+ echo 0
+ /sbin/zramctl -r /dev/zram0
+ echo '/dev/zram0 removed'
+ read -r line
+ rm -fv /usr/local/share/zram-config/zram-device-list.rev /usr/local/share/zram-config/zram-device-list
[00:11:29] 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
[00:11:32] root@oha2:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA  COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 26.9M 847.4K  1.3M       4
[00:11:38] 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.
[00:11:42] root@oha2:/home/openhabian# echo $?
1
[00:11:49] root@oha2:/home/openhabian#

The zram2 device is removed but zramctl shows it’s still there.
I don’t understand why your system behaves like that.

Download zram-config one last time and retry. Show /usr/local/share/zram-config/log/zram-config.log too