Skip to content

Instantly share code, notes, and snippets.

@a-bx
Created December 14, 2015 22:18
Show Gist options
  • Save a-bx/7d0184851ed9005b93f1 to your computer and use it in GitHub Desktop.
Save a-bx/7d0184851ed9005b93f1 to your computer and use it in GitHub Desktop.
Enable swap ec2
# To add this extra space to your instance you type:
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
# If you need more than 1024 then change that to something higher.
# To enable it by default after reboot, add this line to /etc/fstab:
/var/swap.1 swap swap defaults 0 0
# Source: http://stackoverflow.com/questions/17173972/how-do-you-add-swap-to-an-ec2-instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment