mywindowsdownloads.blogspot.com
Click here for all Free Linux Downloads
It is generally a dedicated space on swap partition. It also can be a swap file or combination of both. Swap space is used when the amount of physical memory is full. The inactive pages from main memory are moved ( i.e. swapped ) to this swap space. We should not consider this functionality to be the replacement of adding more RAM, because swap has slower access time than main memory.
Minimum size of the swap partition should be equal to twice the system’s physical memory for physical RAM up to 2 GB, but for additional RAM above 2 GB the size of swap partition should be previous size plus amount of RAM above 2 GB. Using this formula, the system with 2 GB physical memory will have 4 GB of swap, while the system with 3 GB of memory will have 5 GB of swap.
The swap should never be less than 32 MB.
Adding more swap space
Many a times it becomes necessary to increase swap space after installation. For example, we may upgrade RAM in our system from 512 MB to 1 GB, but there is only 1 GB of swap space.
We have three options: 1- create new swap file, 2- create new swap partition, 3- extend swap on current LVM2 logical volume। The best is to extend the existing logical volume.
Extend the existing logical volume to increase swap
Assuming /dev/vol_gr0/log_vol1 is the volume we want to extend. We will be performing following steps for extending swap:
1. Disable swap for associated logical volume:
# swapoff -v /dev/vol_gr0/log_vol1
2. Now resize the logical volume by 512 MB:
# lvm lvresize /dev/vol_gr0/log_vol1 -L +512
3. We will format the new swap space using following command:
# mkswap /dev/vol_gr0/log_vol1
4. Lastly, enable the extended logical volume using following command:
# swapon -va
5. We may test this logical volume, for its proper extension:
# cat /proc/swaps
Or
# free
No comments:
Post a Comment