Enabling Dynamic Swap stops the systemd-swap service

Here is the config i use…

 
zswap_enabled=1
zram_enabled=0
swapfc_enabled=1

Logs from the Journalctl…

journalctl -xeu systemd-swap.service
░░ The job identifier is 2139.
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Load: /etc/systemd/swap.conf.d/myswap.conf
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Removing working directory...
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Removing files in /var/lib/systemd-swap/swapfc/...
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Load: /etc/systemd/swap.conf.d/myswap.conf
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Zswap: backup current configuration: start
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Zswap: backup current configuration: complete
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Zswap: set new parameters: start
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Zswap: Enable: 1, Comp: zstd, Max pool %: 25, Zpool: z3fold
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Zswap: set new parameters: complete
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: Writing destroy info...
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: swapD: pick up devices from systemd-gpt-auto-generator
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: INFO: swapD: searching swap devices
Jan 24 02:45:00 HPRYZEN systemd-swap[8041]: ERRO: swapfc_path is located on an unknown filesystem
Jan 24 02:45:00 HPRYZEN systemd[1]: systemd-swap.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ An ExecStart= process belonging to unit systemd-swap.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Jan 24 02:45:00 HPRYZEN systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ The unit systemd-swap.service has entered the 'failed' state with result 'exit-code'.
Jan 24 02:45:00 HPRYZEN systemd[1]: Failed to start Manage swap spaces on zram, files and partitions..
░░ Subject: A start job for unit systemd-swap.service has failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit systemd-swap.service has finished with a failure.
░░ 
░░ The job identifier is 2139 and the job result is failed.




enabling only zram does work but when enabled you cant login in wayland after reboot and you need to login in to X11 than you can login in wayland and few more bug i cant recall correctly…

Dont know what causes this issue, but right now im using zram with fedora defaults and it seems to work really good, hitting the max of physical capacity of ram and swap started increasing the system was responsive the whole time…which was not the case with zswap( swap was on SSD)

I saw the same problem today. I checked after the whole system freezes. No idea how this happen actually, but here is how I solved it:

  1. Filesystem: BTRFS
  2. TimeShift with autosnap

Problem:

sudo btrfs subvolume list  /
ID 257 gen 142377 top level 5 path @home
ID 310 gen 139209 top level 5 path @swap
ID 824 gen 141132 top level 5 path timeshift-btrfs/snapshots/2021-12-19_22-51-31/@
ID 1244 gen 108447 top level 824 path timeshift-btrfs/snapshots/2021-12-19_22-51-31/@/var/lib/systemd-swap/swapfc
ID 1264 gen 142377 top level 5 path @
ID 1294 gen 142377 top level 5 path timeshift-btrfs/snapshots/2022-02-08_21-43-00/@

Timeshift did a snapshot of the swapfc path and systemd-swap use the backup path somehow…

  1. I needed to delete this subvolume:
ID 1244 gen 108447 top level 824 path timeshift-btrfs/snapshots/2021-12-19_22-51-31/@/var/lib/systemd-swap/swapfc

:arrow_down:

sudo btrfs subvolume delete  /run/timeshift/backup/timeshift-btrfs/snapshots/2021-12-19_22-51-31/@/var/lib/systemd-swap/swapfc
  1. Remove the folder:
sudo rm -Rf /var/lib/systemd-swap/swapfc
  1. Start again:
sudo systemctl start systemd-swap.service 
sudo systemctl status systemd-swap.service  

Now it should work again.

I guess systemd-swap has not timeshift in mind:

But this issue could be solved when it is addressed.

Was that your problem @knight ?

1 Like

Thanks will look into it… and update here

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