{"id":1902,"date":"2023-04-23T08:45:49","date_gmt":"2023-04-23T07:45:49","guid":{"rendered":"https:\/\/www.balajibandi.com\/?p=1902"},"modified":"2023-04-23T08:45:49","modified_gmt":"2023-04-23T07:45:49","slug":"ubuntu-20-x-lvm-partition-extension-which-was-missing-part-of-the-default-installation","status":"publish","type":"post","link":"https:\/\/www.balajibandi.com\/?p=1902","title":{"rendered":"Ubuntu 20.X LVM partition extension (which was missing part of the Default installation)"},"content":{"rendered":"\n<p>Today part of my Lab requirement, I have installed Ubuntu 20.0.6 on my Esxi as a VM<\/p>\n\n\n\n<p>and allocated space of 450GB &#8211; But when installation time I have not made close attention to what was installed as part of the installation.<\/p>\n\n\n\n<p>After installation finished, I only saw my root\/partition allocated space only 100GB &#8211; I was surprised where the rest space went.<\/p>\n\n\n\n<p>So I was reading the Ubuntu documentation and found, (i made the mistake of not making evident attention when it was mentioned LVM partition size) as per the below screenshot.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"330\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-1-1024x330.png\" alt=\"\" class=\"wp-image-1903\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-1-1024x330.png 1024w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-1-300x97.png 300w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-1-768x248.png 768w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-1-705x227.png 705w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-1.png 1293w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>So I found what are defaults from google.com <\/p>\n\n\n\n<p>The default settings in the Ubuntu installation, then the storage for your Linux OS is probably using the Logical Volume Manager (LVM). LVM is an abstraction framework that exists between your physical (or virtual) disks and your Linux file system. It is used to group separate block devices (partitions) together into Volume Groups (VGs), and then chop those VGs up into logical block devices, or Logical Volumes (LVs). LV\u2019s are the abstracted block devices upon which your usable file system resides.<\/p>\n\n\n\n<p>Visualization of how LVM works. <\/p>\n\n\n\n<p>Example: we have 5 different disks, each with a single partition mapped to Physical Volumes (PVs), all being grouped into a single Volume Group (VG). The Volume Group is chopped up into two different Logical Volumes (LVs) and each LV is being used for a filesystem.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"333\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-2.png\" alt=\"\" class=\"wp-image-1904\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-2.png 576w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-2-300x173.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/figure>\n\n\n\n<p>Using a similar visualization, the below diagram shows how the Ubuntu installer (using all default options) divided up my 100GB disk.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-3-1024x740.png\" alt=\"\" class=\"wp-image-1905\" width=\"581\" height=\"420\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-3-1024x740.png 1024w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-3-300x217.png 300w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-3-768x555.png 768w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-3-1536x1109.png 1536w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-3-2048x1479.png 2048w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-3-705x509.png 705w\" sizes=\"auto, (max-width: 581px) 100vw, 581px\" \/><\/figure>\n\n\n\n<p>So let&#8217;s use rest of the free space into \/ (root) partition :<\/p>\n\n\n\n<p><strong>df -h<\/strong> will show how much space is used in what partition.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"616\" height=\"212\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-4.png\" alt=\"\" class=\"wp-image-1906\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-4.png 616w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-4-300x103.png 300w\" sizes=\"auto, (max-width: 616px) 100vw, 616px\" \/><figcaption class=\"wp-element-caption\">Find out what is my original space  <strong>vgdisplay<\/strong><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"524\" height=\"345\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-5.png\" alt=\"\" class=\"wp-image-1907\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-5.png 524w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-5-300x198.png 300w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><\/figure>\n\n\n\n<p>check the Logical Volume display :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"569\" height=\"286\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-7.png\" alt=\"\" class=\"wp-image-1909\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-7.png 569w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-7-300x151.png 300w\" sizes=\"auto, (max-width: 569px) 100vw, 569px\" \/><figcaption class=\"wp-element-caption\">Now we will extend maximum use of LVM which can be used free space<\/figcaption><\/figure>\n\n\n\n<p>#<strong>lvextend -l +100%FREE \/dev\/ubuntu-vg\/ubuntu-lv<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"962\" height=\"73\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-8.png\" alt=\"\" class=\"wp-image-1910\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-8.png 962w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-8-300x23.png 300w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-8-768x58.png 768w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-8-705x53.png 705w\" sizes=\"auto, (max-width: 962px) 100vw, 962px\" \/><\/figure>\n\n\n\n<p>Now LVM show correct size :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"551\" height=\"275\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-9.png\" alt=\"\" class=\"wp-image-1911\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-9.png 551w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-9-300x150.png 300w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/figure>\n\n\n\n<p>Now we increased the LVM but df -h show still same size :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"612\" height=\"218\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-10.png\" alt=\"\" class=\"wp-image-1912\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-10.png 612w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-10-300x107.png 300w\" sizes=\"auto, (max-width: 612px) 100vw, 612px\" \/><\/figure>\n\n\n\n<p>now we run to resize the disk space :<\/p>\n\n\n\n<p><strong>#resize2fs \/dev\/mapper\/ubuntu&#8211;vg-ubuntu&#8211;lv<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"329\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-11.png\" alt=\"\" class=\"wp-image-1913\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-11.png 756w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-11-300x131.png 300w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2023\/04\/image-11-705x307.png 705w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><figcaption class=\"wp-element-caption\">Now I have the disk space that I was intending to use.<\/figcaption><\/figure>\n\n\n\n<p>Happy Labbingggggggggggggggggggggggggg!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today part of my Lab requirement, I have installed Ubuntu 20.0.6 on my Esxi as a VM and allocated space of 450GB &#8211; But when installation time I have not made close attention to what was installed as part of the installation. After installation finished, I only saw my root\/partition allocated space only 100GB &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1902","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/1902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1902"}],"version-history":[{"count":1,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/1902\/revisions"}],"predecessor-version":[{"id":1914,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/1902\/revisions\/1914"}],"wp:attachment":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}