{"id":69,"date":"2012-06-10T13:04:21","date_gmt":"2012-06-10T13:04:21","guid":{"rendered":"http:\/\/rmohan.com\/?p=69"},"modified":"2012-06-10T15:22:28","modified_gmt":"2012-06-10T15:22:28","slug":"reducing-swap-on-an-lvm2-logical-volume","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=69","title":{"rendered":"Reducing Swap on an LVM2 Logical Volume"},"content":{"rendered":"<p><strong> Reducing Swap on an LVM2 Logical Volume<\/strong><br \/>\n1) Check swap space and its utilization<br \/>\n    cat \/proc\/swaps # free<\/p>\n<p>2) Scan (all disks) for Logical Volumes<br \/>\nlvscan<\/p>\n<p>[root@localhost ~]# lvscan<br \/>\n  ACTIVE            &#8216;\/dev\/VolGroup\/lv_root&#8217; [47.44 GiB] inherit<br \/>\n  ACTIVE            &#8216;\/dev\/VolGroup\/lv_home&#8217; [46.19 GiB] inherit<br \/>\n  ACTIVE            &#8216;\/dev\/VolGroup\/lv_swap&#8217; [5.88 GiB] inherit<\/p>\n<p>3) Disable devices and files for paging and swapping<br \/>\n swapoff -v \/dev\/vg0\/lv_swap<\/p>\n<p> 4)Reduce the size of a logical volume<br \/>\n lvm lvreduce \/dev\/VolGroup\/lv_swap -L -1G<\/p>\n<p>5)  Set up a Linux swap area<br \/>\n mkswap \/dev\/VolGroup\/lv_swap<\/p>\n<p>6) Enable devices and files for paging and swapping<\/p>\n<p>swapon -va<\/p>\n<p>7) Check swap space and its utilization<br \/>\ncat \/proc\/swaps # free<br \/>\n8) Scan (all disks) for Logical Volumes<br \/>\nlvscan<\/p>\n","protected":false},"excerpt":{"rendered":"<p> Reducing Swap on an LVM2 Logical Volume 1) Check swap space and its utilization cat \/proc\/swaps # free<\/p>\n<p>2) Scan (all disks) for Logical Volumes lvscan<\/p>\n<p>[root@localhost ~]# lvscan ACTIVE &#8216;\/dev\/VolGroup\/lv_root&#8217; [47.44 GiB] inherit ACTIVE &#8216;\/dev\/VolGroup\/lv_home&#8217; [46.19 GiB] inherit ACTIVE &#8216;\/dev\/VolGroup\/lv_swap&#8217; [5.88 GiB] inherit<\/p>\n<p>3) Disable devices and files for paging and swapping swapoff [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/69"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69"}],"version-history":[{"count":9,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":82,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions\/82"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}