Skip to content

Instantly share code, notes, and snippets.

@mtlynch
Created December 17, 2021 23:24
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 mtlynch/90c09c7bfb92233155ed71283e3f44d9 to your computer and use it in GitHub Desktop.
Save mtlynch/90c09c7bfb92233155ed71283e3f44d9 to your computer and use it in GitHub Desktop.
# Instructions for resizing the LVM volume on a VM
DISK=/dev/sda
VOLUME="${DISK}3"
sudo fdisk "${DISK}
# Press d, accept defaults
# Press n, accept defaults
# Press w, accept defaults
# If fdisk fails, run sudo parted -l
sudo pvresize "${VOLUME} && \
sudo lvextend --extents +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv && \
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv && \
sudo df -h /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment