image1 image2 image3

HELLO I'M FERNANDO|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I'M PROFESSIONAL DEVELOPER

How to create swap file for amazon EC2 EBS instance


Amazon instances do not create a swap partition by default. If you want an easy solution to create it, we can do the following:

sudo dd if=/dev/zero of=/var/swapfile bs=1M count=2048
sudo chmod 600 /var/swapfile
sudo mkswap /var/swapfile
echo /var/swapfile none swap defaults 0 0 | sudo tee -a /etc/fstab
sudo swapon -a

These instructions will create a 2Gb swap file. If you want to increase or reduce, just change the value of count=2048 in the first instruction

Share this:

CONVERSATION

0 comentarios:

Post a Comment