{"id":67,"date":"2022-04-01T11:10:00","date_gmt":"2022-04-01T09:10:00","guid":{"rendered":"https:\/\/blubb.fish\/?p=67"},"modified":"2022-03-25T11:11:13","modified_gmt":"2022-03-25T10:11:13","slug":"extend-lvm-volume","status":"publish","type":"post","link":"https:\/\/blubb.fish\/index.php\/2022\/04\/01\/extend-lvm-volume\/","title":{"rendered":"Extend LVM Volume"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">How to extend an lvm volume<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">check if vg has free space (VFree)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ vgs                                                                                                              \n  VG     #PV #LV #SN Attr   VSize  VFree\n  datavg   1   3   0 wz--n- &lt;1.82t 1.13t<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If enough space is free we can resize the logical volume<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This will extend the volume by 1G<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ lvextend -L+1G \/dev\/mapper\/datavg-testlv                                                                       \n  Size of logical volume datavg\/testlv changed from 1.00 GiB (256 extents) to 2.00 GiB (512 extents).\n  Logical volume datavg\/testlv successfully resized.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will extend the volume to the size of 10G<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ lvextend -L10G \/dev\/mapper\/datavg-testlv                                                                         \n  Size of logical volume datavg\/testlv changed from 2.00 GiB (512 extents) to 10.00 GiB (2560 extents).\n  Logical volume datavg\/testlv successfully resized.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">check new size with lvs<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ lvs                                                                                                              \n  LV     VG     Attr       LSize   Pool Origin                                                 \n  testlv datavg -wi-ao----  10.00g                                                    <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">now the LV is extended. to make the space usable we have to extend the filesystem<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ df -hTP | grep test                                                                                              \n\/dev\/mapper\/datavg-testlv ext4      974M     24K  907M    1% \/mnt\/test                                              \n$ resize2fs -p \/dev\/mapper\/datavg-testlv                                                                           \nresize2fs 1.46.5 (30-Dec-2021)\nDateisystem bei \/dev\/mapper\/datavg-testlv ist auf \/mnt\/test eingeh\u00e4ngt; Online-Gr\u00f6\u00dfen\u00e4nderung ist\nerforderlich\nold_desc_blocks = 1, new_desc_blocks = 2\nDas Dateisystem auf \/dev\/mapper\/datavg-testlv is nun 2621440 (4k) Bl\u00f6cke lang.\n\n$ df -hTP | grep test                                                                                              \n\/dev\/mapper\/datavg-testlv ext4      9.9G    4.5M  9.4G    1% \/mnt\/test<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now we have the 10G as usable space<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to extend an lvm volume check if vg has free space (VFree) If enough space is free we can resize the logical volume This will extend the volume by 1G This will extend the volume to the size of 10G check new size with lvs now the LV is extended. to make the space [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":2,"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":74,"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/posts\/67\/revisions\/74"}],"wp:attachment":[{"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blubb.fish\/index.php\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}