Comment 21 for bug 1818811

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

The problem is that a swapfile in btrfs cannot have CoW activated on the file, and cannot be compressed. Also, you should not leave the file in the root filesystem (even if it would work with the above settings) because it will make snapshots of /@ messy.

If you manually do this, it will work:

- create a separate subvolume just for swap
- mount it somewhere like /swap (also add to fstab)
- create an empty file (/swap/swapfile)
- set non-compress and no-CoW on the file
- grow the file to the desired size
- mkswap on the file
- add swap file to fstab

now you can swapon -a and it will work.

The installer does not do that, it just creates a /swapfile as it would do on any other filesystem and then on reboot it will not start.

Amano instructions above will work, but I would advise to also create the subvolume.