Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taldanzig/9702314331c5f1b5ea0b to your computer and use it in GitHub Desktop.
Save taldanzig/9702314331c5f1b5ea0b to your computer and use it in GitHub Desktop.

Adding space to an LVM backed extX or btrfs filesystem

Add some physical or virtual storage (resize a VM image, add a new VM image, add a disk)

Create a new LVM physical volume

lvm pvcreate /dev/sdb # substitute appropriate device name

Figure out the volume group name:

lvm vgdisplay

Add the physical volume to the volume group

lvm vgextend debian8-taldev-vg /dev/sdb

Figure out the name of the logical volume you wish to enlarge

lvm lvdisplay

Resize the logical volume

lvm lvextend -l +100%FREE /dev/debian8-taldev-vg/root

Resize the filesystem

For extX:

resize2fs /dev/debian8-taldev-vg/root

For BtrFS

btrfs filesystem resize max /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment