Skip to content

Instantly share code, notes, and snippets.

@edymerchk
Created February 18, 2014 15:39
Show Gist options
  • Select an option

  • Save edymerchk/9073313 to your computer and use it in GitHub Desktop.

Select an option

Save edymerchk/9073313 to your computer and use it in GitHub Desktop.
how-to-add-swap-on-ubuntu-12-04
full explanation: https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04
sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k
sudo mkswap /swapfile
sudo swapon /swapfile
echo 0 | sudo tee /proc/sys/vm/swappiness
echo vm.swappiness = 0 | sudo tee -a /etc/sysctl.conf
sudo chown root:root /swapfile
sudo chmod 0600 /swapfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment