Last active
June 13, 2016 04:24
-
-
Save sharshenov/a34db47c2311acd38c92 to your computer and use it in GitHub Desktop.
add swapfile to ubuntu host
This file contains 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
#Original article: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-12-04 | |
dd if=/dev/zero of=/swapfile bs=1M count=1k | |
mkswap /swapfile | |
swapon /swapfile | |
echo '/swapfile none swap sw 0 0 ' >> /etc/fstab | |
echo 1 | tee /proc/sys/vm/swappiness | |
echo vm.swappiness = 1 | tee -a /etc/sysctl.conf | |
chown root:root /swapfile | |
chmod 0600 /swapfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment