John Paul van Helvoort, Linux | Tags:

In some cases its handy to quickly be able to adjust your swap.
Here is a little trick i mostly use to do so.

First you can check your physical memory total :

grep MemTotal /proc/meminfo

To check your swap space total :

grep SwapTotal /proc/meminfo

So if you find yourself short in swap space , lets say for an Oracle installation.
You can safely expand your swap space like this

$>su – root

( You have to be root to be able to do this)

$>dd if=/dev/zero of=tmpswap bs=1k count=900000

( 900000 being 900 Megabytes )

$>chmod 600 tempswap
$>mkswap tempswap
$>swapon tempswap

Whenever you want to remove this extra swap space, use these commands :

$>su – root
$>swapoff tempswap
$>rm tempswap
No TweetBacks yet. (Be the first to Tweet this post)


Leave a Reply