Flaxplax

Personal documentation

Swapfile

To create a swapfile on btrfs filesystem.

Only works on kernel 5.0 or higher.

# truncate -s 0 /swapfile
# chattr +C /swapfile
# btrfs property set /swapfile compression none
# fallocate -l 512M /swapfile
# chmod 600 /swapfile
# mkswap /swapfile
Last updated on 21 Aug 2022
Published on 21 Aug 2022