{"id":1644,"date":"2022-02-24T15:53:54","date_gmt":"2022-02-24T20:53:54","guid":{"rendered":"https:\/\/enterpriseadmins.org\/blog\/?p=1644"},"modified":"2022-02-24T15:53:54","modified_gmt":"2022-02-24T20:53:54","slug":"photon-os-4-0-grow-filesystem-using-logical-volume-management-lvm","status":"publish","type":"post","link":"https:\/\/enterpriseadmins.org\/blog\/virtualization\/photon-os-4-0-grow-filesystem-using-logical-volume-management-lvm\/","title":{"rendered":"Photon OS 4.0 Grow Filesystem using Logical Volume Management (LVM)"},"content":{"rendered":"\n<p>I recently needed to grow the file system on a Linux VM.  I remembered writing a post on this before, so I headed here:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-enterprise-admins-org wp-block-embed-enterprise-admins-org\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"kCZYkvhuYO\"><a href=\"https:\/\/enterpriseadmins.org\/blog\/virtualization\/photon-os-3-0-grow-filesystem\/\">Photon OS 3.0 Grow Filesystem<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Photon OS 3.0 Grow Filesystem&#8221; &#8212; Enterprise Admins.org\" src=\"https:\/\/enterpriseadmins.org\/blog\/virtualization\/photon-os-3-0-grow-filesystem\/embed\/#?secret=IWptRaXcKy#?secret=kCZYkvhuYO\" data-secret=\"kCZYkvhuYO\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Unfortunately this previous post assumed a non-LVM disk setup.<\/p>\n\n\n\n<p>I needed to increase the size of the <code>\/data<\/code> mountpoint using the filesystem <code>\/dev\/mapper\/data_vg-data<\/code> and the earlier instructions did not work.  My VM had three disks. To figure out which one I needed to grow, I used the Linux <code>lsblk<\/code> command. This showed three disks, <code>sda<\/code>, <code>sdb<\/code>, and <code>sdc<\/code>. The <code>\/data<\/code> mountpoint went to <code>sdb<\/code>, which was 60GB in size. Looking at the VM, Hard Disk 2 was the only one that was 60 GB.  I increased it to the necessary size in the vCenter UI.<\/p>\n\n\n\n<p>Back in the VM I needed to resize the filesystem to match the new disk size.  To do this I first ran <code>pvresize \/dev\/sdb<\/code> which returned the message that 1 physical volume(s) resized or updated.  <\/p>\n\n\n\n<p>I then ran <code>lvdisplay<\/code> looking for the &#8216;data&#8217; volume group, specifically the <code>LV Path<\/code> property, which in this case was <code>\/dev\/data_vg\/data<\/code>.  <\/p>\n\n\n\n<p>From here I ran <code>lvextend -l +100%FREE \/dev\/data_vg\/data<\/code> which returned a message that the size of logical volume had changed to the new size of the disk.  <\/p>\n\n\n\n<p>Finally I ran <code>resize2fs \/dev\/data_vg\/data<\/code> which confirmed that the filesystem was resized on-line.  <\/p>\n\n\n\n<p>The command <code>df -h<\/code> now shows the expected size for the mount.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently needed to grow the file system on a Linux VM. I remembered writing a post on this before, so I headed here: Unfortunately this previous post assumed a non-LVM disk setup. I needed to increase the size of &hellip; <a href=\"https:\/\/enterpriseadmins.org\/blog\/virtualization\/photon-os-4-0-grow-filesystem-using-logical-volume-management-lvm\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9,4],"tags":[],"class_list":["post-1644","post","type-post","status-publish","format-standard","hentry","category-lab-infrastructure","category-virtualization"],"_links":{"self":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/1644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/comments?post=1644"}],"version-history":[{"count":1,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/1644\/revisions"}],"predecessor-version":[{"id":1646,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/1644\/revisions\/1646"}],"wp:attachment":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/media?parent=1644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/categories?post=1644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/tags?post=1644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}