Failed to start manage swap and zram

Every boot I see failed to start manage swa*n zram. * stands for letter that is not displayed correctly, so I don’t know what it is. I use btrfs and swap file (instead of swap partition).

I think I don’t use zram, and least I don’t remember doing anything related to zram and I don’t know what it is.

Operating System: Manjaro Linux
KDE Plasma Version: 5.19.4
KDE Frameworks Version: 5.73.0
Qt Version: 5.15.0
Kernel Version: 5.7.15-1-MANJARO
OS Type: 64-bit

for zswap
https://wiki.archlinux.org/index.php/Zswap

for zram
https://wiki.archlinux.org/index.php/Improving_performance#Zram_or_zswap

btrfs use a compression
https://wiki.archlinux.org/index.php/Btrfs

sudo swapoff /dev/zram0
swapoff: /dev/zram0: swapoff failed: No such file or folder
sudo rmmod zram
rmmod: ERROR: Module zram is not currently loaded

zram is not installed or started

Have you created your swap file similar to what is described in this guide?

https://wiki.archlinux.org/index.php/Swap#Swap_file_creation

So, why the problem occurs? I use swapfile more than half a year and only after recent updates have started to experience problem.

Yes. And it works just fine.

swapon
NAME           TYPE  SIZE   USED PRIO
/swap/swapfile file 1024M 916,4M   -2

This is error as displayed:

I found report by another Manjaro user:

I did:

sudo systemctl status systemd-swap
[sudo] hasło użytkownika user: 
● systemd-swap.service - Manage swap spaces on zram, files and partitions.
     Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Thu 2020-08-27 09:24:53 CEST; 5h 24min ago
    Process: 365 ExecStart=/usr/bin/systemd-swap start (code=exited, status=1/FAILURE)
   Main PID: 365 (code=exited, status=1/FAILURE)
     Status: "Monitoring memory status..."

sie 27 09:24:53 user-pc systemd-swap[365]:   File "/usr/bin/systemd-swap", line 733, in start
sie 27 09:24:53 user-pc systemd-swap[365]:     swap_fc = SwapFc(config, sem)
sie 27 09:24:53 user-pc systemd-swap[365]:   File "/usr/bin/systemd-swap", line 172, in __init__
sie 27 09:24:53 user-pc systemd-swap[365]:     subprocess.run(
sie 27 09:24:53 user-pc systemd-swap[365]:   File "/usr/lib/python3.8/subprocess.py", line 512, in run
sie 27 09:24:53 user-pc systemd-swap[365]:     raise CalledProcessError(retcode, process.args,
sie 27 09:24:53 user-pc systemd-swap[365]: subprocess.CalledProcessError: Command '['btrfs', 'subvolume', 'crea>
sie 27 09:24:53 user-pc systemd[1]: systemd-swap.service: Main process exited, code=exited, status=1/FAILURE
sie 27 09:24:53 user-pc systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
sie 27 09:24:53 user-pc systemd[1]: Failed to start Manage swap spaces on zram, files and partitions..
1 Like

I did:

sudo systemctl disable systemd-swap
sudo systemctl stop systemd-swap
sudo systemctl mask systemd-swap

And the problem is solved.

But this just disables the sytemd-swap, right?

You may have encountered the same problem I did.
systemd-swap conf files have recently been changed : No swapfile ! · Issue #172 · Nefelim4ag/systemd-swap · GitHub

BTW, I found zram not being very efficient and I rather use zswap & swapfc (there also are rationales for that)
Uninstalling/reinstalling systemd-swap and properly amending conf files does the trick (french tuto with easy translation here)

It is supposed to do so. But when I do

swapon
NAME           TYPE  SIZE  USED PRIO
/swap/swapfile file 1024M 13,8M   -2

So, swap file is working.

@nam1962 Thank you for information. I will look into that.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.