Increase Swap Space to Amazon EC2 Linux

Type the following command with count being equal to the desired block size:

dd if=/dev/zero of=/extraswap bs=1M count=4024

Setup the swap file with the command:

mkswap /extraswap

To enable the swap file immediately but not automatically at boot time:

swapon /extraswap

To enable it at the boot time, add the following entry into /etc/fstab:

/extraswap swap swap defaults 0 0

Leave a Comment