Create Swap Space on Amazon EC2 Image


I am creating an Oracle XE database server in Amazon, I know that Amazon has Oracle RDS but I need an inexpense solution for this particular application.

Upon downloading the oracle-xe rpm and trying to install it discovered that you need a swap file space. How therefore do you create a swap file space ?????

sudo su
dd if=/dev/zero of=/swapfile bs=1024 count=1048576

( this should give you 1024MB but in the Amazon world it registers 1023MB AAAARRRGGGHHHH !!!!!) I therefore used the following

Please note to delete a swap file use

swapoff /swapfile

 rm /swapfile

dd if=/dev/zero of=/swapfile bs=1536 count=1572864 
/sbin/mkswap /swapfile
/sbin/swapon /swapfile
/sbin/swapon -s

I found this on a site burried away and thought I would add this to post to bolster the chances of you finding something 🙂


5 Comments on “Create Swap Space on Amazon EC2 Image”

  1. […] need a swap space on the server to allow Oracle to be installed this can be found at survivalguides create swap space written by […]

  2. […] need a swap space on the server to allow Oracle to be installed this can be found at survivalguides create swap space written by […]

  3. Frank says:

    Hey thanks, this is helpful!

  4. […] not worry just follow these instructions on creating swap space  and then get right back to this […]


Leave a reply to Frank Cancel reply