Friday, May 26, 2017

how to add swap on 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 chmod 600 /var/swap.1
sudo /sbin/swapon /var/swap.1

add this line to /etc/fstab:
swap        /var/swap.1 swap    defaults        0   0

No comments: