Last active
November 2, 2017 16:59
-
-
Save kieetnvt/5ba09f49332ea9c9fda61d22b573b951 to your computer and use it in GitHub Desktop.
Adding swap space to an EC2 Amazon Linux instance
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
With instance EC2 T2.micro 1.0 GiB 1 vCPUs (http://www.ec2instances.info/?cost_duration=monthly&selected=t2.micro) | |
Here are the steps I took to enable swap space: | |
dd if=/dev/zero of=/swapfile bs=1M count=512 | |
mkswap /swapfile | |
chmod 600 /swapfile | |
swapon /swapfile | |
You also have to edit your fstab file so the swap is available after reboot: | |
sudo vim /etc/fstab | |
Add the following to the bottom of the file: | |
/swapfile swap swap defaults 0 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment