Skip to content

Instantly share code, notes, and snippets.

@u2mejc
Last active June 22, 2018 23:04
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 u2mejc/2983e7e0c60c7636120afbdfd69d6bb4 to your computer and use it in GitHub Desktop.
Save u2mejc/2983e7e0c60c7636120afbdfd69d6bb4 to your computer and use it in GitHub Desktop.
How to resize Ubuntu 16.04LTS EBS backed LVM volume live, in two commands!
# Check the usually suspects before you resize
df -h # Show file systems and their current space
lsblk # show block devices and file systems (do this again after resizing the EBS volume)
sudo pvscan # show physical drives
sudo lvscan # show logical volumes
# Now after you have resized the EBS volumes (you can do this in the console or CLI), the two magic commands:
sudo pvresize </dev/DEVICE> # Resize physical volume(s)
sudo lvextend -r -l +100%FREE <LogicalVolume[Path]>
# df -h # Check your work, pat yourself on back, stop Googling 100 step answers to do this!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment