Last active
August 29, 2015 13:56
-
-
Save stansidel/8840630 to your computer and use it in GitHub Desktop.
Activate swap file on Ubuntu (based on the tutorial for DigitalOcean - https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024k | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
echo "/swapfile none swap sw 0 0 " | sudo tee -a /etc/fstab | |
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 | |
swapon -s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment