Skip to content

Instantly share code, notes, and snippets.

@jjlorenzo
Created May 22, 2016 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjlorenzo/8a9c22ef594c949bf24690f1d6a1ef64 to your computer and use it in GitHub Desktop.
Save jjlorenzo/8a9c22ef594c949bf24690f1d6a1ef64 to your computer and use it in GitHub Desktop.
# I know a lot of people feel icky about using files instead of partitions,
# but it certainly works well enough as emergency swap space.
sudo dd if=/dev/zero of=/var/swapfile bs=1M count=3072
sudo chmod 600 /var/swapfile
sudo mkswap /var/swapfile
echo /var/swapfile none swap defaults 0 0 | sudo tee -a /etc/fstab
sudo swapon -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment