docs / linux / swap
.swap
sudo swapoff -a sudo fallocate -l 2G /swapfile sudo dd if=/dev/zero of=/swapfile bs=1M count=2048 sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo ‘/swapfile none swap sw 0 0’ | sudo tee -a /etc/fstab
Or manually edit /etc/fstab and ensure this line exists:
textcopy
/swapfile none swap sw 0 0textcopy
sudo swapon --show
free -hYou should now see your new swap size reflected in the output.