Created
April 9, 2016 15:30
-
-
Save jesseleite/62d762e203ae6a9f5324be3e6f1a9ebf to your computer and use it in GitHub Desktop.
1G Swap Forge Script/Recipe
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
if [ -f /swapfile ]; then | |
echo "Swapfile already exists." | |
exit 1 | |
fi | |
fallocate -l 1G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab' | |
echo "Swapfile successfully created." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment