Creating a swap file on btrfs

Anyone knows how to create swap file? I tried with creating file, changing permition, setting it mkswap and the swapon but it always fails on swapon command. I read that this is because btrfs doesn’t support swap file.

Use gnome disk app and create a space that you want and then format that space with swap once done restart system.

1 Like

Someone on Ask Ubuntu has written down all steps for creating swap file on a btrfs subvolume swap - Can I have a swapfile on btrfs? - Ask Ubuntu