Reducing Swap on an LVM2 Logical Volume
1) Check swap space and its utilization
cat /proc/swaps # free
2) Scan (all disks) for Logical Volumes
lvscan
[root@localhost ~]# lvscan
ACTIVE ‘/dev/VolGroup/lv_root’ [47.44 GiB] inherit
ACTIVE ‘/dev/VolGroup/lv_home’ [46.19 GiB] inherit
ACTIVE ‘/dev/VolGroup/lv_swap’ [5.88 GiB] inherit
3) Disable devices and files for paging and swapping
swapoff -v /dev/vg0/lv_swap
4)Reduce the size of a logical volume
lvm lvreduce /dev/VolGroup/lv_swap -L -1G
5) Set up a Linux swap area
mkswap /dev/VolGroup/lv_swap
6) Enable devices and files for paging and swapping
swapon -va
7) Check swap space and its utilization
cat /proc/swaps # free
8) Scan (all disks) for Logical Volumes
lvscan
Recent Comments