How To Create EC2 Swap Partition Using AWS EBS(Elastic Block Store)

aws-ebs-logo

Note: Before we going ahead you have to follow 1-9 steps using below link.

https://www.cloudjojo.com/how-to-create-ebselastic-block-store-in-aws

Step 10. Use below commands to create swap on our system.

#  mkswap -f /dev/xvdf


EBS swap make swap page

Step 11. Now we have to on that swap on our system by below command.

#  swapon /dev/xvdf

Step 12. To make it enable on system boot, simply edit /etc/fstab file and add following entry at end of file.

#vim /etc/fstab
/dev/xvdf        swap         swap        defaults       0 0

 

EBS Swap mount page

Step 13. Run below command to mount your volume permanently

# mount -a

Step 14. To check your mounted volume run below command

# free -m

EBS swap swap check page

Note: Your swap partition is successfully configured.