nefelim4ag / systemd-swap

Script for creating hybrid swap space from zram swaps, swap files and swap partitions.
GNU General Public License v3.0
550 stars 81 forks source link

zram failed to enable #177

Closed felixonmars closed 3 years ago

felixonmars commented 3 years ago

With default settings in a 32 core machine:

Aug 14 14:22:34 houndour.felixc.at systemd[1]: Activating swap Swap Block/Partition...
Aug 14 14:22:34 houndour.felixc.at swapon[3947]: swapon: /dev/zram27: swapon failed: Operation not permitted
Aug 14 14:22:34 houndour.felixc.at systemd[1]: dev-zram27.swap: Swap process exited, code=exited, status=255/EXCEPTION
Aug 14 14:22:34 houndour.felixc.at systemd[1]: dev-zram27.swap: Failed with result 'exit-code'.
Aug 14 14:22:34 houndour.felixc.at systemd[1]: Failed to activate swap Swap Block/Partition.
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3946]: Job failed. See "journalctl -xe" for details.
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]: Traceback (most recent call last):
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]:   File "/usr/bin/systemd-swap", line 904, in <module>
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]:     main()
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]:   File "/usr/bin/systemd-swap", line 892, in main
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]:     start()
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]:   File "/usr/bin/systemd-swap", line 682, in start
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]:     subprocess.run(["systemctl", "start", unit_name], check=True)
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]:   File "/usr/lib/python3.8/subprocess.py", line 512, in run
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]:     raise CalledProcessError(retcode, process.args,
Aug 14 14:22:34 houndour.felixc.at systemd-swap[3250]: subprocess.CalledProcessError: Command '['systemctl', 'start', 'dev-zram27.swap']' returned non-zero exit status 1.
Aug 14 14:22:34 houndour.felixc.at systemd[1]: Cannot find unit for notify message of PID 3946, ignoring.
Aug 14 14:22:34 houndour.felixc.at systemd[1]: systemd-swap.service: Main process exited, code=exited, status=1/FAILURE
Aug 14 14:22:34 houndour.felixc.at systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
Aug 14 14:22:34 houndour.felixc.at systemd[1]: Failed to start Manage swap spaces on zram, files and partitions..
vilgotf commented 3 years ago

Probably related to #176

daiaji commented 3 years ago

@Jarel1337 This kind of situation will be rare in the past, but it will become more and more common as the number of cores of mainstream CPU increases