Skip to content
XADE edited this page Dec 10, 2023 · 1 revision

How to create a swapfile

a swap file [bit larger than RAM] is always recommended

swapoff -a
rm -rf /.swap
btrfs subvolume create /.swap
truncate -s 0 /.swap/swap
chattr +C /.swap/swap
head -c 8G /dev/zero > /.swap/swap  # replace 8 with desired value
chmod 600 /.swap/swap
mkswap /.swap/swap
swapon /.swap/swap
printf "
/.swap/swap none swap defaults 0 0
" >> /etc/fstab

Features

Requirements

Notes


Walk Through :

  1. Execute the script

  1. Select Distro & Packages

Click one of the Distros below for Detailed steps

Distro non Systemd Immutable musl support compilation support
Arch
Artix
Alpine
Void
Gentoo
Funtoo
NixOS
GUIX

Questions :

How ?

Why ?

Clone this wiki locally