Last active
November 1, 2016 05:55
-
-
Save igez/2b58c830b0251d18bfb0fb291cb1ecb1 to your computer and use it in GitHub Desktop.
Add Swap Centos 7
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 | |
sudo fallocate -l 2G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo echo "/swapfile swap swap sw 0 0" >> /etc/fstab | |
sudo sysctl vm.swappiness=10 | |
sudo echo "vm.swappiness = 10" >> /etc/sysctl.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment