Skip to content

Instantly share code, notes, and snippets.

@cleanunicorn
Last active November 12, 2024 14:33
Show Gist options
  • Save cleanunicorn/41e087fe6108e91827503ef68a8c677f to your computer and use it in GitHub Desktop.
Save cleanunicorn/41e087fe6108e91827503ef68a8c677f to your computer and use it in GitHub Desktop.
How to extend an LVM partition to use the available disk space.

Tell LVM to resize to the physical partition size.

$ sudo pvresize /dev/sda3

Find the actual path of the LVM logical volume. The LV Path is the value needed.

$ sudo lvdisplay

Tell LVM to extend the logical volume to the new partition size.

$ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

Finally resize the filesystem

$ sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment