Sometimes it is necessary to add more swap space after installation. For example, you may upgrade the amount of RAM in your system from 1 GB to 2 GB, but there is only 2 GB of swap space. It might be advantageous to increase the amount of swap space to 4 GB if you perform memory-intense operations or run applications that require a large amount of memory.
You have three options: create a new swap partition, create a new swap file, or extend swap on an existing LVM2 logical volume. It is recommended that you extend an existing logical volume.
To do so, perform the following procedure (assuming /dev/VolGroup00/LogVol01 is the volume you want to extend by 2 GB):
1.Disable swapping for the associated logical volume:
# swapoff -v /dev/VolGroup00/LogVol01
2.Resize the LVM2 logical volume by 2 GB:
# lvresize /dev/VolGroup00/LogVol01 -L +2G
3.Format the new swap space:
# mkswap /dev/VolGroup00/LogVol01
4.Enable the extended logical volume:
# swapon -v /dev/VolGroup00/LogVol01
To test if the logical volume was successfully extended, use “cat /proc/swaps” or “free -m” to inspect the swap space.
Recent Comments