Skip to content

Instantly share code, notes, and snippets.

@andp97
Created April 10, 2021 14:25
Show Gist options
  • Save andp97/211ca13758c02eddb113478bbc6c815f to your computer and use it in GitHub Desktop.
Save andp97/211ca13758c02eddb113478bbc6c815f to your computer and use it in GitHub Desktop.
Extend LVM partition
#!/bin/bash
NEW_PARTITION=$1
LVM_PATH=$2
VG_NAME=$3
pvcreate $NEW_PARTITION && vgextend $VG_NAME $NEW_PARTITION && lvextend --resizefs -l +100%FREE $LVM_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment