How to Modify Swap Size – Ubuntu 10.04

When installing Ubuntu, I was never asked about the desired size for my swap size. Oracle recommends to use at least 2GB of memory in order to create a database, let alone run it.
With help from this excellent post from LinuxReaders, I expanded my swap size to 2GB (again, Oracle’s recommended size for 11g) by executing the following:

$ dd if=/dev/zero of=/tmp/swapfile bs=1MB count=2048
2048+0 records in
2048+0 records out
2048000000 bytes (2.0 GB) copied, 36.257 s, 56.5 MB/s
$ mkswap /tmp/swapfile
mkswap: /tmp/swapfile: warning: don't erase bootbits sectors
on whole disk. Use -f to force.
Setting up swapspace version 1, size = 1999996 KiB
no label, UUID=aa8617a8-9500-498e-90da-f5164190ad00
$ sudo swapon /tmp/swapfile

Checked my swap memory with free -m
total used free shared buffers cached
Mem: 3895 3841 53 0 1008 1799
-/+ buffers/cache: 1033 2861
Swap: 2208 0 2208

And made the swap size permanent by adding the following to /etc/fstab:

/tmp/swapfile swap swap defaults 0 0

Cheers!

Advertisements

Software developer. Currently working at MercadoLibre.com and other personal projects.

Tagged with: , , , , , ,
Posted in Tech
One comment on “How to Modify Swap Size – Ubuntu 10.04
  1. Thanks a bunch for sharing this with all
    folks you actually realize what you’re speaking about! Bookmarked. Please additionally visit my site =). We will have a hyperlink trade agreement between us

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

%d bloggers like this: