Adding secondary swap space consists of:
creating a logical volume
adding a line to /etc/fstab
and finally, executing the swapon cmmand
A rough calculation of swap space requirements for a small standalone system can be made by determing the total size of the applications likely to be running at peak times and add this to the size of physical memory. A precise and detailed calculation can be made. To do this refer to the system administration tasks chapter titled managing swap space and dump areas.
As a guideline, it is recommended that swap space be equal to 1.5 times the size of physical memory though this may be reduced for systems with very large amounts of memory.
Once the total swap size has been estimated or precisely calculated, proceed with the following:
1,Determine the current state of the system's swap space
# swapinfo
The output of the swapinfo command will indicate the type of swap by location, how much of it is available, used, and free. If hold is diplayed, it indicates how much space the system has reserved based on possible requirements of running processes
2,Create a logical volume of sufficient size to bring total swap space to the required amount. Specify the size of the logical volume to be created in M following the -L parameter
# lvcreate -L xxx vgxx
3,Add a new line in /etc/fstab using vi or ed for the new logical volume
/dev/vgxx/lvolx /swap swap defaults 0 0
4,Enable swapping on the new device
# swapon -a
5,Verify that the new swap device is enabled
# swapinfo
6,Backup the LVM data structures. the default path name for the backup will be /etc/lvmconf/vgxx.cnf
# vgcfgbackup /dev/vgxx
阅读(2534) | 评论(0) | 转发(0) |