Can't create swap file: swapon failed: Invalid argument

On btrfs, swap files need to be a on a subvolume with no snapshots and CoW should be disabled.

Did you create a separate subvolume to hold the swapfile?

Full instructions are here:
https://wiki.archlinux.org/title/btrfs#Swap_file

Also, welcome to the forum!

1 Like