Contact our honeypot department if you are desperate to get blacklisted.

Monday, November 23, 2009

Increasing your swap file

The rule of thumb (I really need to stop using that phrase) is that your swap file size should be equal to the size of your physical RAM.  If you increase your RAM, you may want to increase your swap file size as well.  If you're using an LVM partition as swap, then it's pretty easy:

First find your swap file:
fdisk -l | grep swap

Then:
swapoff  /dev/VolGroup00/LogVol01
lvresize /dev/VolGroup00/LogVol01 -L 768M
mkswap   /dev/VolGroup00/LogVol01
swapon   /dev/VolGroup00/LogVol01

This is based mostly on Ben Stokes' article.  In fact except for the omission of the mkswap command, his is the superior post.  For a more terse treatment from RedHat see http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.4/html/Deployment_Guide/s1-swap-adding.html