when I zram-config stop and zram-config start
It does not mount /var/lib/openhab2 afterwards
zram-config start 2019-08-10-23:22:09
ztab create swap lz4 200M 600M 75 0 90
zram6 created comp_algorithm=lz4 mem_limit=200M disksize=600M
Setting up swapspace version 1, size = 600 MiB (629141504 bytes)
LABEL=zram-config6, UUID=b0c868b9-98ec-4943-b3c6-4fec196b850c
swapon: /dev/zram6: found signature [pagesize=4096, signature=swap]
swapon: /dev/zram6: pagesize=4096, swapsize=629145600, devsize=629145600
swapon /dev/zram6
vm.page-cluster = 0
vm.swappiness = 90
ztab create dir lz4 200M 400M /var/lib/openhab2 /openhab2.bind
mount: /var/lib/openhab2 bound on /opt/zram/openhab2.bind.
mount: /opt/zram/openhab2.bind propagation flags changed.
zram7 created comp_algorithm=lz4 mem_limit=200M disksize=400M
mke2fs 1.44.5 (15-Dec-2018)
mke2fs: invalid blocks 'ext4' on device 'ext4'
ztab create log lzo 100M 300M /var/log /log.bind
Warning: Stopping rsyslog.service, but it can still be activated by:
syslog.socket
mount: /var/log bound on /opt/zram/log.bind.
mount: /opt/zram/log.bind propagation flags changed.
zram8 created comp_algorithm=lzo mem_limit=100M disksize=300M
mke2fs 1.44.5 (15-Dec-2018)
mke2fs: invalid blocks 'ext4' on device 'ext4'
it seems like first run of sudo zram-config sync is working fine (and i rebooted with unpluging power cable right after sync -> data were there after boot), so this is OK
but, when you run first update and then re-run the command it’s complaining about Upper directory not specified => not syncing after first run at all
(scroll down in log to 2019-08-10-23:52:59)
note: i renamed stop to sync and added some dashes to be able to see new entries in logfile
--------------------------------------------
zram-config sync 2019-08-10-23:52:56
ztab sync log /zram2 /var/log /log.bind
overlay --lowerdir=/opt/zram/log.bind --upperdir=/opt/zram/zram2/upper
The OverlayFS involved is still mounted.
It is strongly recommended to unmount OverlayFS first. Still continue (not recommended)?:
The script overlay-tools-wzesyt.sh is created. Run the script to do the actual work please. Remember to run it when the OverlayFS is not mounted.
+ set -x
+ rm -rf /opt/zram/log.bind/messages
+ mv -T /opt/zram/zram2/upper/messages /opt/zram/log.bind/messages
+ rm -rf /opt/zram/log.bind/unattended-upgrades/unattended-upgrades-shutdown.log
+ mv -T /opt/zram/zram2/upper/unattended-upgrades/unattended-upgrades-shutdown.log /opt/zram/log.bind/unattended-upgrades/unattended-upgrades-shutdown.log
+ rmdir /opt/zram/zram2/upper/unattended-upgrades
+ rm -rf /opt/zram/log.bind/auth.log
+ mv -T /opt/zram/zram2/upper/auth.log /opt/zram/log.bind/auth.log
+ rm -rf /opt/zram/log.bind/syslog
+ mv -T /opt/zram/zram2/upper/syslog /opt/zram/log.bind/syslog
+ rm -rf /opt/zram/log.bind/wtmp
+ mv -T /opt/zram/zram2/upper/wtmp /opt/zram/log.bind/wtmp
+ rm -rf /opt/zram/log.bind/daemon.log
+ mv -T /opt/zram/zram2/upper/daemon.log /opt/zram/log.bind/daemon.log
+ rm -rf /opt/zram/log.bind/kern.log
+ mv -T /opt/zram/zram2/upper/kern.log /opt/zram/log.bind/kern.log
+ rm -rf /opt/zram/log.bind/lastlog
+ mv -T /opt/zram/zram2/upper/lastlog /opt/zram/log.bind/lastlog
+ rmdir /opt/zram/zram2/upper
removed 'overlay-tools-wzesyt.sh'
ztab sync dir /zram1 /var/lib/openhab2 /openhab2.bind
overlay --lowerdir=/opt/zram/openhab2.bind --upperdir=/opt/zram/zram1/upper
The OverlayFS involved is still mounted.
It is strongly recommended to unmount OverlayFS first. Still continue (not recommended)?:
The script overlay-tools-Ad5DaI.sh is created. Run the script to do the actual work please. Remember to run it when the OverlayFS is not mounted.
+ set -x
+ chmod --reference /opt/zram/zram1/upper /opt/zram/openhab2.bind
+ rm -rf /opt/zram/openhab2.bind/jsondb/StorageHandler.For.OAuthClientService.json
+ mv -T /opt/zram/zram1/upper/jsondb/StorageHandler.For.OAuthClientService.json /opt/zram/openhab2.bind/jsondb/StorageHandler.For.OAuthClientService.json
+ rm -rf /opt/zram/openhab2.bind/jsondb/backup/1565473908059--StorageHandler.For.OAuthClientService.json
+ mv -T /opt/zram/zram1/upper/jsondb/backup/1565473908059--StorageHandler.For.OAuthClientService.json /opt/zram/openhab2.bind/jsondb/backup/1565473908059--StorageHandler.For.OAuthClientService.json
+ rmdir /opt/zram/zram1/upper/jsondb/backup
+ rmdir /opt/zram/zram1/upper/jsondb
+ rm -rf /opt/zram/openhab2.bind/cache/org.eclipse.osgi/100/data/configdispatcher_pid_list.json
+ mv -T /opt/zram/zram1/upper/cache/org.eclipse.osgi/100/data/configdispatcher_pid_list.json /opt/zram/openhab2.bind/cache/org.eclipse.osgi/100/data/configdispatcher_pid_list.json
+ rmdir /opt/zram/zram1/upper/cache/org.eclipse.osgi/100/data
+ rmdir /opt/zram/zram1/upper/cache/org.eclipse.osgi/100
+ rm -rf /opt/zram/openhab2.bind/cache/org.eclipse.osgi/framework.info.41
+ mv -T /opt/zram/zram1/upper/cache/org.eclipse.osgi/framework.info.41 /opt/zram/openhab2.bind/cache/org.eclipse.osgi/framework.info.41
+ rm -rf /opt/zram/openhab2.bind/cache/org.eclipse.osgi/.manager/.fileTableLock
+ mv -T /opt/zram/zram1/upper/cache/org.eclipse.osgi/.manager/.fileTableLock /opt/zram/openhab2.bind/cache/org.eclipse.osgi/.manager/.fileTableLock
+ rm -rf /opt/zram/openhab2.bind/cache/org.eclipse.osgi/.manager/.fileTable.41
+ mv -T /opt/zram/zram1/upper/cache/org.eclipse.osgi/.manager/.fileTable.41 /opt/zram/openhab2.bind/cache/org.eclipse.osgi/.manager/.fileTable.41
+ rm -r /opt/zram/openhab2.bind/cache/org.eclipse.osgi/.manager/.fileTable.39
+ rm /opt/zram/zram1/upper/cache/org.eclipse.osgi/.manager/.fileTable.39
+ rm -rf /opt/zram/openhab2.bind/cache/org.eclipse.osgi/.manager/.fileTable.42
+ mv -T /opt/zram/zram1/upper/cache/org.eclipse.osgi/.manager/.fileTable.42 /opt/zram/openhab2.bind/cache/org.eclipse.osgi/.manager/.fileTable.42
+ rm -r /opt/zram/openhab2.bind/cache/org.eclipse.osgi/.manager/.fileTable.38
+ rm /opt/zram/zram1/upper/cache/org.eclipse.osgi/.manager/.fileTable.38
+ rmdir /opt/zram/zram1/upper/cache/org.eclipse.osgi/.manager
+ rm -rf /opt/zram/openhab2.bind/cache/org.eclipse.osgi/44/data/FeatureDeploymentListener.cfg
+ mv -T /opt/zram/zram1/upper/cache/org.eclipse.osgi/44/data/FeatureDeploymentListener.cfg /opt/zram/openhab2.bind/cache/org.eclipse.osgi/44/data/FeatureDeploymentListener.cfg
+ rmdir /opt/zram/zram1/upper/cache/org.eclipse.osgi/44/data
+ rmdir /opt/zram/zram1/upper/cache/org.eclipse.osgi/44
+ rm -r /opt/zram/openhab2.bind/cache/org.eclipse.osgi/framework.info.38
+ rm /opt/zram/zram1/upper/cache/org.eclipse.osgi/framework.info.38
+ rmdir /opt/zram/zram1/upper/cache/org.eclipse.osgi
+ rm -rf /opt/zram/openhab2.bind/cache/org.eclipse.core.runtime/.manager/.fileTableLock
+ mv -T /opt/zram/zram1/upper/cache/org.eclipse.core.runtime/.manager/.fileTableLock /opt/zram/openhab2.bind/cache/org.eclipse.core.runtime/.manager/.fileTableLock
+ rm -rf /opt/zram/openhab2.bind/cache/org.eclipse.core.runtime/.manager/.tmp3042662714532364119.instance
+ mv -T /opt/zram/zram1/upper/cache/org.eclipse.core.runtime/.manager/.tmp3042662714532364119.instance /opt/zram/openhab2.bind/cache/org.eclipse.core.runtime/.manager/.tmp3042662714532364119.instance
+ rmdir /opt/zram/zram1/upper/cache/org.eclipse.core.runtime/.manager
+ rmdir /opt/zram/zram1/upper/cache/org.eclipse.core.runtime
+ rmdir /opt/zram/zram1/upper/cache
+ rm -rf /opt/zram/openhab2.bind/config/org/eclipse/smarthome/core/i18nprovider.config
+ mv -T /opt/zram/zram1/upper/config/org/eclipse/smarthome/core/i18nprovider.config /opt/zram/openhab2.bind/config/org/eclipse/smarthome/core/i18nprovider.config
+ rmdir /opt/zram/zram1/upper/config/org/eclipse/smarthome/core
+ rmdir /opt/zram/zram1/upper/config/org/eclipse/smarthome
+ rmdir /opt/zram/zram1/upper/config/org/eclipse
+ rmdir /opt/zram/zram1/upper/config/org
+ rmdir /opt/zram/zram1/upper/config
+ mv -T /opt/zram/zram1/upper/tmp/.paxweb5860413992892411305 /opt/zram/openhab2.bind/tmp/.paxweb5860413992892411305
+ rm -rf /opt/zram/openhab2.bind/tmp/instances/instance.properties
+ mv -T /opt/zram/zram1/upper/tmp/instances/instance.properties /opt/zram/openhab2.bind/tmp/instances/instance.properties
+ rmdir /opt/zram/zram1/upper/tmp/instances
+ rm -rf /opt/zram/openhab2.bind/tmp/lock
+ mv -T /opt/zram/zram1/upper/tmp/lock /opt/zram/openhab2.bind/tmp/lock
+ mv -T /opt/zram/zram1/upper/tmp/fileinstall--2571855421841853508 /opt/zram/openhab2.bind/tmp/fileinstall--2571855421841853508
+ rm -rf /opt/zram/openhab2.bind/tmp/karaf.pid
+ mv -T /opt/zram/zram1/upper/tmp/karaf.pid /opt/zram/openhab2.bind/tmp/karaf.pid
+ rm -rf /opt/zram/openhab2.bind/tmp/port
+ mv -T /opt/zram/zram1/upper/tmp/port /opt/zram/openhab2.bind/tmp/port
+ rmdir /opt/zram/zram1/upper/tmp
+ rmdir /opt/zram/zram1/upper
removed 'overlay-tools-Ad5DaI.sh'
ztab sync swap /zram0 zram-config0
removed '/usr/local/share/zram-config/zram-device-list.rev'
--------------------------------------------
zram-config sync 2019-08-10-23:52:59
ztab sync log /zram2 /var/log /log.bind
overlay --lowerdir=/opt/zram/log.bind --upperdir=/opt/zram/zram2/upper
Upper directory not specified.
Try './overlay --help' for more information.
ztab sync dir /zram1 /var/lib/openhab2 /openhab2.bind
overlay --lowerdir=/opt/zram/openhab2.bind --upperdir=/opt/zram/zram1/upper
Upper directory not specified.
Try './overlay --help' for more information.
ztab sync swap /zram0 zram-config0
removed '/usr/local/share/zram-config/zram-device-list.rev'
That following code or log is a little confusing…what tool output is that?
where do you see openhab2 mount fail? or what is it supposed to show?
Are you sure it was after you started again ? If you stop (without reboot) then the /var/log mount will fail to unmount because it’s still in use, resulting in the same picture as if /var/lib/openhab2 didn’t mount again.
Don’t know if that’s related but try increasing mem_limit of /var/lib/openhab2 in ztab.
I’ve hit that limit, resulting in the FS becoming read-only.
There is at least one problem on stop.
Insert /bin/sh in file /opt/openhabian/functions/zram.bash at the beginning of the “...uninstall.sh” line and retry.
I’ve been unable to reproduce that doing start-stop-start-stop… please apply that little patch and try again. Multiple stops in a row also are no problem but multiple starts seem to be.
So you called sync twice and on second occasion it claims the upper dir does not exist although it’s the same as on first call and you haven’t changed it inbetween?
Sounds a little strange. Did you change any file inbetween ? Can you set -x at the beginning of the script and repeat so we see everything that happens?
Do not mix cases. Do sync-sync or stop-start-stop without sync inbetween.
Check what happens to /usr/local/share/zram-config/zram-device-list{.new,rev} on each command.