Enabling Dynamic Swap stops the systemd-swap service

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