After the latest updates it is no longer possible to make zram service work.
Vento:/home/xxxxxx # systemctl status zramswap.service × zramswap.service - Service enabling compressing RAM with zRam
Loaded: loaded (/usr/lib/systemd/system/zramswap.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-06-22 17:58:00 CEST; 38s ago
Process: 3615 ExecStart=/usr/sbin/zramswapon (code=exited, status=255/EXCEPTION)
Main PID: 3615 (code=exited, status=255/EXCEPTION)
jun 22 17:58:00 Vento zramswapon[3639]: swapon: impossível abrir /dev/zram1: Ficheiro ou pasta inexistente
jun 22 17:58:00 Vento zramswapon[3640]: swapon: impossível abrir /dev/zram2: Ficheiro ou pasta inexistente
jun 22 17:58:00 Vento zramswapon[3641]: swapon: impossível abrir /dev/zram3: Ficheiro ou pasta inexistente
jun 22 17:58:00 Vento zramswapon[3642]: swapon: impossível abrir /dev/zram4: Ficheiro ou pasta inexistente
jun 22 17:58:00 Vento zramswapon[3643]: swapon: impossível abrir /dev/zram5: Ficheiro ou pasta inexistente
jun 22 17:58:00 Vento zramswapon[3644]: swapon: impossível abrir /dev/zram6: Ficheiro ou pasta inexistente
jun 22 17:58:00 Vento zramswapon[3645]: swapon: impossível abrir /dev/zram7: Ficheiro ou pasta inexistente
jun 22 17:58:00 Vento systemd[1]: zramswap.service: Main process exited, code=exited, status=255/EXCEPTION
jun 22 17:58:00 Vento systemd[1]: zramswap.service: Failed with result ‘exit-code’.
jun 22 17:58:00 Vento systemd[1]: Failed to start Service enabling compressing RAM with zRam.
I have found two workarounds:
- Running command manually works: sudo zramswapon
- In service file /usr/lib/systemd/system/zramswap.service, there is automatic added code:
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=true
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions.
Remove all that. Call sudo systemctl daemon-reload and sudo systemctl enable zramswap.service and now it works.
The bugs referenced in that thread are against the zram service in Tumbleweed, but at the bottom ofBugzilla – Bug 1193402, it’s noted that the problem exists in 15.4, too.