Last active
December 22, 2021 05:09
-
-
Save choyno/8c578083848c1b1a417bd313e4e1d2aa to your computer and use it in GitHub Desktop.
Amazon Linux adding Swap Memory
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
https://www.photographerstechsupport.com/tutorials/adding-swap-space-ec2-amazon-linux-instance/ | |
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-memory-swap-file/ | |
Here are the steps I took to enable swap space | |
sudo dd if=/dev/zero of=/swapfile bs=1M count=512 | |
sudo mkswap /swapfile | |
sudo chmod 600 /swapfile | |
sudo swapon /swapfile | |
You also have to edit your fstab file so the swap is available after reboot | |
sudo vi /etc/fstab | |
Add the following to the bottom of the file – I made sure it lined up with the existing entries, but that’s probably not necessary. | |
/swapfile swap swap defaults 0 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment