Comment 20 for bug 1818811

Revision history for this message
amano (jyaku) wrote (last edit ):

I can confirm that with the proper Ubuntu 22.04 Beta on baremetal. I get the error message on bootup. Is there a workaround?

(output of `swapon -s` is empty).

15:41:11 systemd-oomd: Swap is currently not detected; memory pressure usage will be degraded
15:41:11 systemd: swap.target: Job swap.target/start failed with result 'dependency'.
15:41:11 systemd: swap.target: Job swap.target/start failed with result 'dependency'.
15:41:11 systemd: Dependency failed for Swaps.
15:41:11 systemd: Failed to activate swap /swapfile.
15:41:11 systemd: swapfile.swap: Failed with result 'exit-code'.
15:41:11 systemd: swapfile.swap: Swap process exited, code=exited, status=255/EXCEPTION
15:41:11 kernel: BTRFS warning (device nvme0n1p2): swapfile must not be copy-on-write
15:41:11 swapon: swapon: /swapfile: swapon fehlgeschlagen: Das Argument ist ungültig
15:41:11 systemd: Activating swap /swapfile...
15:41:10 kernel: swapon: /swapfile: swapon fehlgeschlagen: Das Argument ist ungültig
15:41:10 kernel: swap.target: Job swap.target/start failed with result 'dependency'.
15:41:10 kernel: Dependency failed for Swaps.
15:41:10 kernel: Failed to activate swap /swapfile.
15:41:10 kernel: swapfile.swap: Failed with result 'exit-code'.
15:41:10 kernel: BTRFS warning (device nvme0n1p2): swapfile must not be copy-on-write
15:41:10 kernel: Activating swap /swapfile...
15:41:10 kernel: zswap: loaded using pool lzo/zbud

Fixed that by:
# truncate -s 0 /swapfile
# chattr +C /swapfile
# btrfs property set /swapfile compression none
# fallocate -l 512M /swapfile
# chmod 600 /swapfile
# mkswap /swapfile

Now swapon /swapfile should succeed.