Note to self: If you create a swapfile on a BTRFS system, make sure you set the "no copy on write" file attribute. If you do not set this attribute, dd
and fallocate
will create files "with holes in it," which swapon
will not accept.
This is how you create a swapfile on BTRFS:
$ sudo touch swapfile $ sudo chmod 0600 swapfile $ sudo chattr +C swapfile $ sudo fallocate -l 2G swapfile $ sudo mkswap swapfile Setting up swapspace version 1, size = 2 GiB (2147479552 bytes) no label, UUID=e6d9da68-d5bb-4344-a3b4-84d979c80dc4 $ sudo swapon swapfile
To check what is mounted as swap, you can enter the following:
$ swapon NAME TYPE SIZE USED PRIO /swap/swapfile file 2G 90.8M -2
Published: 2022-06-22
=> Back to Gemlog This content has been proxied by September (ba2dc).Proxy Information
text/gemini;