Skip to content

Instantly share code, notes, and snippets.

@giannoug
Last active August 17, 2021 09:04
Show Gist options
  • Save giannoug/7aba3883107d21715341f12c6889c3ac to your computer and use it in GitHub Desktop.
Save giannoug/7aba3883107d21715341f12c6889c3ac to your computer and use it in GitHub Desktop.
Extend an Ubuntu VMs LVM after you resize its disk
sudo fdisk -l
sudo parted /dev/vda
GNU Parted 3.3
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resizepart
Warning: Not all of the space available to /dev/vda appears to be used, you can fix the GPT to use all of the space (an
extra 67108864 blocks) or continue with the current setting?
Fix/Ignore? Fix
Partition number? 3
End? [34.4GB]? 100%
(parted) quit
Information: You may need to update /etc/fstab.
sudo pvresize /dev/vda3
sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment