Created
June 9, 2017 15:53
-
-
Save joseramonc/62a52616602db6e0d14c1aa10f0e7afb to your computer and use it in GitHub Desktop.
Add swap into ubuntu
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
# bin/bash | |
# Has configured swap? | |
# sudo swapon -s | |
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo nano /etc/fstab | |
# persist between reboots, add this line at the bottom: | |
# /swapfile none swap sw 0 0 | |
sudo sysctl vm.swappiness=10 | |
sudo nano /etc/sysctl.conf | |
# add at the bottom: | |
# vm.swappiness=10 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment