While testing cloning and syncing of SD cards in openhabian, I inspected the zram-config script and made a couple of observations that may be relevant for your application.
- when zram-config “sync” is issued the script stops an harcoded list of services, including openhab, but with the
--no-blockoption. The intent is to avoid that the services write on persistence, but it does not wait for the service to properly stop . Especially under heavy load it may take a while for the service to stop but zram-config does not wait and proceed immediately. - The power loss condition is very similar to live raw copy or sync. I think that the lack of ZRAM devices at first boot is due to the remnants of ZRAM temporary files, such as
/usr/local/lib/zram-config/zram-device-list. I reported some tests in my post