April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

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>