zram-config
zram-config copied to clipboard
Zram is not loaded after a power outage
Zram is not loaded after a power outage (e.g. when disconnecting power cable from rpi).
Default ztab config, zram-config v1.7.0, RaspiOS Trixie, Pi Zero 2W, disabled dphys-swapfile.service
Terminal output
pi@rpizero:~ $ systemctl status zram-config.service
● zram-config.service - zram-config
Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; preset: enabled)
Active: active (exited) since Sun 2025-09-14 09:53:26 CEST; 2min 24s ago
Invocation: 4e4b3756d54b4a2f9b01446487622b7a
Docs: https://github.com/ecdye/zram-config/blob/main/README.md
Process: 302 ExecStart=/usr/local/sbin/zram-config start (code=exited, status=0/SUCCESS)
Main PID: 302 (code=exited, status=0/SUCCESS)
Mem peak: 4.8M
CPU: 249ms
Notice: journal has been rotated since unit was started, output may be incomplete.
pi@rpizero:~ $ zramctl
pi@rpizero:~ $
pi@rpizero:~ $ sudo systemctl restart zram-config.service
pi@rpizero:~ $ systemctl status zram-config.service
● zram-config.service - zram-config
Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; preset: enabled)
Active: active (exited) since Sun 2025-09-14 09:58:38 CEST; 3s ago
Invocation: 17cc4eead28145cbb6fc278fd5acff63
Docs: https://github.com/ecdye/zram-config/blob/main/README.md
Process: 1373 ExecStart=/usr/local/sbin/zram-config start (code=exited, status=0/SUCCESS)
Main PID: 1373 (code=exited, status=0/SUCCESS)
Mem peak: 5.1M
CPU: 489ms
Sep 14 09:58:38 rpizero zram-config[1391]: vm.page-cluster = 0
Sep 14 09:58:38 rpizero zram-config[1392]: vm.swappiness = 150
pi@rpizero:~ $ zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle 150M 320K 5.5K 172K 4 /opt/zram/zram2
/dev/zram1 lzo-rle 750M 64K 3.5K 256K 4 [SWAP]
For now I created workaround:
zram-config-restart.service
sudo tee /etc/systemd/system/zram-config-restart.service > /dev/null <<EOF
[Unit]
Description=Conditional restart of zram-config service if active
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'systemctl is-active --quiet zram-config.service && systemctl restart zram-config.service || echo "zram-config not running, skipping restart"'
[Install]
WantedBy=multi-user.target
EOF
It's hard to know the root issue here. Can you provide logs of what happened on power on when it didn't start? Because reading this it looks like it started (or at least systemctl thinks it did) on the power loss, but didn't complete successfully.
Power outage dmesg
[ 10.033052] systemd[1]: Starting zram-config.service - zram-config...
[ 10.038736] vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes
[ 10.039793] vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes
[ 10.129327] systemd[1]: Finished console-setup.service - Set console font and keymap.
[ 10.162703] systemd[1]: proc-sys-fs-binfmt_misc.automount: Got automount request for /proc/sys/fs/binfmt_misc, triggered by 312 (systemd-binfmt)
[ 10.171293] systemd[1]: Mounting proc-sys-fs-binfmt_misc.mount - Arbitrary Executable File Formats File System...
[ 10.194387] Bluetooth: hci0: BCM: chip id 94
[ 10.194838] Bluetooth: hci0: BCM: features 0x2e
[ 10.198398] Bluetooth: hci0: BCM43430A1
[ 10.198426] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[ 10.225591] Bluetooth: hci0: BCM43430A1 'brcm/BCM43430A1.raspberrypi,model-zero-2-w.hcd' Patch
[ 10.238490] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[ 10.246492] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 10.248633] usbcore: registered new interface driver brcmfmac
[ 10.296692] systemd[1]: Mounted proc-sys-fs-binfmt_misc.mount - Arbitrary Executable File Formats File System.
[ 10.304687] systemd[1]: Finished systemd-binfmt.service - Set Up Additional Binary Formats.
[ 10.491043] brcmfmac: brcmf_c_process_txcap_blob: no txcap_blob available (err=-2)
[ 10.491735] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Jun 14 2023 07:27:45 version 7.45.96.s1 (gf031a129) FWID 01-70bd2af7 es7
[ 10.586473] systemd[1]: Finished zram-config.service - zram-config.
[ 10.608950] systemd[1]: Starting systemd-journald.service - Journal Service...
[ 10.826588] systemd[1]: Listening on systemd-rfkill.socket - Load/Save RF Kill Switch Status /dev/rfkill Watch.
[ 10.839150] systemd[1]: Starting systemd-rfkill.service - Load/Save RF Kill Switch Status...
[ 10.873981] systemd-journald[357]: Collecting audit messages is disabled.
[ 10.891949] Bluetooth: hci0: BCM: features 0x2e
[ 10.893510] Bluetooth: hci0: BCM43436 37.4MHz Class 1.5 RaspBerry Pi Zero2 [Version: 1017.1042]
[ 10.893552] Bluetooth: hci0: BCM43430A1 (001.002.009) build 1042
[ 10.894459] Bluetooth: hci0: BCM: Using default device address (43:43:a1:12:1f:ac)
[ 11.024958] systemd[1]: Started systemd-journald.service - Journal Service.
[ 11.284573] systemd-journald[357]: Received client request to flush runtime journal.
[ 11.356931] systemd-journald[357]: Time jumped backwards, rotating.
[ 12.205509] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 12.205536] Bluetooth: BNEP filters: protocol multicast
[ 12.205557] Bluetooth: BNEP socket layer initialized
[ 12.235476] Bluetooth: MGMT ver 1.23
[ 12.264847] NET: Registered PF_ALG protocol family
[ 12.725298] Bluetooth: RFCOMM TTY layer initialized
[ 12.725345] Bluetooth: RFCOMM socket layer initialized
[ 12.725377] Bluetooth: RFCOMM ver 1.11
[ 13.347171] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[ 16.716684] tun: Universal TUN/TAP device driver, 1.6
[ 27.445045] overlayfs: failed to set xattr on upper
[ 27.445067] overlayfs: ...falling back to redirect_dir=nofollow.
[ 27.445072] overlayfs: ...falling back to uuid=null.
[ 27.445077] overlayfs: try mounting with 'userxattr' option
Clean reboot dmesg
[ 9.244384] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 9.286897] Loaded X.509 cert '[email protected]: 577e021cb980e0e820821ba7b54b4961b8b4fadf'
[ 9.287769] Loaded X.509 cert '[email protected]: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'
[ 9.288585] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 9.289470] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[ 9.306580] systemd[1]: Finished console-setup.service - Set console font and keymap.
[ 9.335038] systemd[1]: proc-sys-fs-binfmt_misc.automount: Got automount request for /proc/sys/fs/binfmt_misc, triggered by 308 (systemd-binfmt)
[ 9.344633] systemd[1]: Mounting proc-sys-fs-binfmt_misc.mount - Arbitrary Executable File Formats File System...
[ 9.375141] Bluetooth: hci0: BCM: chip id 94
[ 9.378347] Bluetooth: hci0: BCM: features 0x2e
[ 9.379686] Bluetooth: hci0: BCM43430A1
[ 9.379713] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[ 9.402479] Bluetooth: hci0: BCM43430A1 'brcm/BCM43430A1.raspberrypi,model-zero-2-w.hcd' Patch
[ 9.500628] systemd[1]: Mounted proc-sys-fs-binfmt_misc.mount - Arbitrary Executable File Formats File System.
[ 9.525910] Console: switching to colour dummy device 80x25
[ 9.530515] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[ 9.531889] systemd[1]: Finished systemd-binfmt.service - Set Up Additional Binary Formats.
[ 9.538800] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[ 9.543919] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 9.544579] usbcore: registered new interface driver brcmfmac
[ 9.545213] Registered IR keymap rc-cec
[ 9.545438] rc rc0: vc4-hdmi as /devices/platform/soc/3f902000.hdmi/rc/rc0
[ 9.545675] input: vc4-hdmi as /devices/platform/soc/3f902000.hdmi/rc/rc0/input0
[ 9.581501] input: vc4-hdmi HDMI Jack as /devices/platform/soc/3f902000.hdmi/sound/card0/input1
[ 9.587532] vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])
[ 9.587964] vc4-drm soc:gpu: bound 3f004000.txp (ops vc4_txp_ops [vc4])
[ 9.588275] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops [vc4])
[ 9.588543] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops [vc4])
[ 9.588809] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops [vc4])
[ 9.589000] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])
[ 9.603819] [drm] Initialized vc4 0.0.0 for soc:gpu on minor 0
[ 9.606697] vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes
[ 9.607677] vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes
[ 9.758696] brcmfmac: brcmf_c_process_txcap_blob: no txcap_blob available (err=-2)
[ 9.759289] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Jun 14 2023 07:27:45 version 7.45.96.s1 (gf031a129) FWID 01-70bd2af7 es7
[ 9.770188] zram: Added device: zram0
[ 9.780793] zram0: detected capacity change from 0 to 1536000
[ 9.866736] Adding 767996k swap on /dev/zram0. Priority:75 extents:1 across:767996k SS
[ 9.895541] systemd[1]: Listening on systemd-rfkill.socket - Load/Save RF Kill Switch Status /dev/rfkill Watch.
[ 9.907525] systemd[1]: Starting systemd-rfkill.service - Load/Save RF Kill Switch Status...
[ 10.059575] Bluetooth: hci0: BCM: features 0x2e
[ 10.061121] Bluetooth: hci0: BCM43436 37.4MHz Class 1.5 RaspBerry Pi Zero2 [Version: 1017.1042]
[ 10.061155] Bluetooth: hci0: BCM43430A1 (001.002.009) build 1042
[ 10.061773] Bluetooth: hci0: BCM: Using default device address (43:43:a1:12:1f:ac)
[ 10.176928] systemd[1]: dev-hugepages.mount - Huge Pages File System was skipped because of an unmet condition check (ConditionPathExists=/sys/kernel/mm/hugepages).
[ 10.177202] systemd[1]: apparmor.service - Load AppArmor profiles was skipped because of an unmet condition check (ConditionSecurity=apparmor).
[ 10.183628] systemd[1]: Starting fake-hwclock-load.service - Restore the current clock...
[ 10.192345] systemd[1]: Starting modprobe@efi_pstore.service - Load Kernel Module efi_pstore...
[ 10.192929] systemd[1]: systemd-hibernate-clear.service - Clear Stale Hibernate Storage Info was skipped because of an unmet condition check (ConditionPathExists=/sys/firmware/efi/efivars/HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67).
[ 10.193457] systemd[1]: systemd-hwdb-update.service - Rebuild Hardware Database was skipped because of an unmet condition check (ConditionNeedsUpdate=/etc).
[ 10.193739] systemd[1]: systemd-pcrmachine.service - TPM PCR Machine ID Measurement was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[ 10.194327] systemd[1]: systemd-sysusers.service - Create System Users was skipped because no trigger condition checks were met.
[ 10.194580] systemd[1]: systemd-tpm2-setup-early.service - Early TPM SRK Setup was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[ 10.194686] systemd[1]: systemd-tpm2-setup.service - TPM SRK Setup was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[ 10.218357] zram: Added device: zram1
[ 10.223452] zram1: detected capacity change from 0 to 307200
[ 10.313186] systemd[1]: modprobe@efi_pstore.service: Deactivated successfully.
[ 10.314674] systemd[1]: Finished modprobe@efi_pstore.service - Load Kernel Module efi_pstore.
[ 10.316280] systemd[1]: Started systemd-rfkill.service - Load/Save RF Kill Switch Status.
[ 10.317969] systemd[1]: systemd-pstore.service - Platform Persistent Storage Archival was skipped because of an unmet condition check (ConditionDirectoryNotEmpty=/sys/fs/pstore).
[ 10.335238] systemd[1]: fake-hwclock-load.service: Deactivated successfully.
[ 10.336770] systemd[1]: Finished fake-hwclock-load.service - Restore the current clock.
[ 10.392207] EXT4-fs (zram1): mounted filesystem 3cb4e9b2-1dee-42da-bcb9-bdb3130618c2 r/w with ordered data mode. Quota mode: none.
[ 10.482760] systemd[1]: dev-hugepages.mount - Huge Pages File System was skipped because of an unmet condition check (ConditionPathExists=/sys/kernel/mm/hugepages).
[ 10.483012] systemd[1]: apparmor.service - Load AppArmor profiles was skipped because of an unmet condition check (ConditionSecurity=apparmor).
[ 10.488017] systemd[1]: Starting fake-hwclock-load.service - Restore the current clock...
[ 10.493947] systemd[1]: Starting modprobe@efi_pstore.service - Load Kernel Module efi_pstore...
[ 10.494674] systemd[1]: systemd-hibernate-clear.service - Clear Stale Hibernate Storage Info was skipped because of an unmet condition check (ConditionPathExists=/sys/firmware/efi/efivars/HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67).
[ 10.495351] systemd[1]: systemd-hwdb-update.service - Rebuild Hardware Database was skipped because of an unmet condition check (ConditionNeedsUpdate=/etc).
[ 10.495655] systemd[1]: systemd-pcrmachine.service - TPM PCR Machine ID Measurement was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[ 10.496083] systemd[1]: systemd-sysusers.service - Create System Users was skipped because no trigger condition checks were met.
[ 10.496254] systemd[1]: systemd-tpm2-setup-early.service - Early TPM SRK Setup was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[ 10.496337] systemd[1]: systemd-tpm2-setup.service - TPM SRK Setup was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[ 10.571464] systemd[1]: modprobe@efi_pstore.service: Deactivated successfully.
[ 10.572647] systemd[1]: Finished modprobe@efi_pstore.service - Load Kernel Module efi_pstore.
[ 10.574484] systemd[1]: systemd-pstore.service - Platform Persistent Storage Archival was skipped because of an unmet condition check (ConditionDirectoryNotEmpty=/sys/fs/pstore).
[ 10.582569] systemd[1]: fake-hwclock-load.service: Deactivated successfully.
[ 10.583810] systemd[1]: Finished fake-hwclock-load.service - Restore the current clock.
[ 10.720770] zram: Added device: zram2
[ 10.723597] zram2: detected capacity change from 0 to 307200
[ 10.776509] EXT4-fs (zram2): mounted filesystem 51316004-f6ba-46b4-8ca7-ee30822a9a8d r/w with ordered data mode. Quota mode: none.
[ 10.817254] systemd[1]: Finished zram-config.service - zram-config