Skip to content

Instantly share code, notes, and snippets.

@koderhun
Last active January 9, 2024 08:36
Show Gist options
  • Save koderhun/3ab9d8e3b1a7dd0357a452fed9629cd2 to your computer and use it in GitHub Desktop.
Save koderhun/3ab9d8e3b1a7dd0357a452fed9629cd2 to your computer and use it in GitHub Desktop.
Swapfile enable in ubuntu system
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04
sudo fallocate -l 10G /swapfile &&
sudo chmod 600 /swapfile &&
sudo mkswap /swapfile &&
sudo cp /etc/fstab /etc/fstab.bak &&
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab /swapfile none swap sw 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment