November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Reducing Swap on an LVM2 Logical Volume

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

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>