Skip to content

Instantly share code, notes, and snippets.

@jesseleite
Created April 9, 2016 15:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesseleite/62d762e203ae6a9f5324be3e6f1a9ebf to your computer and use it in GitHub Desktop.
Save jesseleite/62d762e203ae6a9f5324be3e6f1a9ebf to your computer and use it in GitHub Desktop.
1G Swap Forge Script/Recipe
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