{"id":1365,"date":"2021-05-03T10:58:29","date_gmt":"2021-05-03T14:58:29","guid":{"rendered":"https:\/\/io.bainwerx.com\/blog\/?p=1365"},"modified":"2021-05-03T10:58:30","modified_gmt":"2021-05-03T14:58:30","slug":"resizing-an-ubuntu-lvm-host","status":"publish","type":"post","link":"https:\/\/io.bainwerx.com\/blog\/resizing-an-ubuntu-lvm-host\/","title":{"rendered":"Resizing an Ubuntu LVM Host!"},"content":{"rendered":"\n<p>I spent hours trying to find instructions on how to resize my Ubuntu virtual hosts after one of my cluster workers seemingly ran out of space (randomly).  After working out the basics, I was able to resize my drives correctly after assigning them the correct disk size in ProxMox.<\/p>\n\n\n\n<p><strong>root@server:~# fdisk -l<\/strong><\/p>\n\n\n\n<p>\u2026<\/p>\n\n\n\n<p>GPT PMBR size mismatch (104857599 != 209715199) will be corrected by write.<br>The backup GPT table is not on the end of the device. This problem will be corrected by write.<br>Disk \/dev\/sda: 100 GiB, 107374182400 bytes, 209715200 sectors<br>Disk model: QEMU HARDDISK<br>Units: sectors of 1 * 512 = 512 bytes<br>Sector size (logical\/physical): 512 bytes \/ 512 bytes<br>I\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<br>Disklabel type: gpt<br>Disk identifier: 396A0315-7944-49AC-BBFF-7AD2F7747AC9<\/p>\n\n\n\n<p>Device Start End Sectors Size Type<br>\/dev\/sda1 2048 4095 2048 1M BIOS boot<br>\/dev\/sda2 4096 2101247 2097152 1G Linux filesystem<br>\/dev\/sda3 2101248 104857566 102756319 49G Linux filesystem<\/p>\n\n\n\n<p>Disk \/dev\/mapper\/ubuntu&#8211;vg-ubuntu&#8211;lv: 48.102 GiB, 52609155072 bytes, 102752256 sectors<br>Units: sectors of 1 * 512 = 512 bytes<br>Sector size (logical\/physical): 512 bytes \/ 512 bytes<br>I\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<br><strong>root@server:~# parted<\/strong><br>GNU Parted 3.3<br>Using \/dev\/sda<br>Welcome to GNU Parted! Type &#8216;help&#8217; to view a list of commands.<br>(parted) <strong>resizepart<\/strong><br>Warning: Not all of the space available to \/dev\/sda appears to be used, you can fix the GPT to use all of the space (an<br>extra 104857600 blocks) or continue with the current setting?<br>Fix\/Ignore? <strong>Fix<\/strong><br>Partition number? <strong>3<br><\/strong>End? [53.7GB]? <strong>100%<\/strong><br>(parted) <strong>quit<\/strong><br>Information: You may need to update \/etc\/fstab.<\/p>\n\n\n\n<p><strong>root@server:~# pvresize \/dev\/sda3<\/strong><br>Physical volume &#8220;\/dev\/sda3&#8221; changed<br>1 physical volume(s) resized or updated \/ 0 physical volume(s) not resized<\/p>\n\n\n\n<p><strong>root@server:~# lvextend -l +100%FREE \/dev\/mapper\/ubuntu&#8211;vg-ubuntu&#8211;lv<\/strong><br>Size of logical volume ubuntu-vg\/ubuntu-lv changed from &lt;49.00 GiB (12543 extents) to &lt;99.00 GiB (25343 extents).<br>Logical volume ubuntu-vg\/ubuntu-lv successfully resized.<\/p>\n\n\n\n<p><strong>root@server:~# resize2fs \/dev\/mapper\/ubuntu&#8211;vg-ubuntu&#8211;lv<\/strong><br>resize2fs 1.45.5 (07-Jan-2020)<br>Filesystem at \/dev\/mapper\/ubuntu&#8211;vg-ubuntu&#8211;lv is mounted on \/; on-line resizing required<br>old_desc_blocks = 7, new_desc_blocks = 13<br>The filesystem on \/dev\/mapper\/ubuntu&#8211;vg-ubuntu&#8211;lv is now 25951232 (4k) blocks long.<\/p>\n\n\n\n<p><strong>root@server:~# df -h<\/strong><br>Filesystem Size Used Avail Use% Mounted on<br>udev 2.9G 0 2.9G 0% \/dev<br>tmpfs 595M 1.2M 594M 1% \/run<br>\/dev\/mapper\/ubuntu&#8211;vg-ubuntu&#8211;lv 98G 32G 62G 34% \/<br>tmpfs 3.0G 0 3.0G 0% \/dev\/shm<br>tmpfs 5.0M 0 5.0M 0% \/run\/lock<br>tmpfs 3.0G 0 3.0G 0% \/sys\/fs\/cgroup<br>\/dev\/sda2 976M 198M 712M 22% \/boot<br>\/dev\/loop1 56M 56M 0 100% \/snap\/core18\/1932<br>\/dev\/loop2 72M 72M 0 100% \/snap\/lxd\/16099<br>\/dev\/loop0 56M 56M 0 100% \/snap\/core18\/1944<br>\/dev\/loop3 68M 68M 0 100% \/snap\/lxd\/18150<br>\/dev\/loop4 32M 32M 0 100% \/snap\/snapd\/10492<br>\/dev\/loop5 32M 32M 0 100% \/snap\/snapd\/10707<br>tmpfs 595M 0 595M 0% \/run\/user\/1000<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spent hours trying to find instructions on how to resize my Ubuntu virtual hosts after one of my cluster workers seemingly ran out of space (randomly). After working out the basics, I was able to resize my drives correctly after assigning them the correct disk size in ProxMox. root@server:~# fdisk -l \u2026 GPT PMBR &hellip; <a href=\"https:\/\/io.bainwerx.com\/blog\/resizing-an-ubuntu-lvm-host\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Resizing an Ubuntu LVM Host!<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1365","post","type-post","status-publish","format-standard","hentry","category-uncategorized","without-featured-image"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8DcKP-m1","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/posts\/1365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/comments?post=1365"}],"version-history":[{"count":1,"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/posts\/1365\/revisions"}],"predecessor-version":[{"id":1366,"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/posts\/1365\/revisions\/1366"}],"wp:attachment":[{"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/media?parent=1365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/categories?post=1365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/io.bainwerx.com\/blog\/wp-json\/wp\/v2\/tags?post=1365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}