Skip to content

Instantly share code, notes, and snippets.

@alirezazadeh77
Last active January 13, 2023 15:12
Show Gist options
  • Save alirezazadeh77/92690fd1c1fdea748676acf7e2430e5a to your computer and use it in GitHub Desktop.
Save alirezazadeh77/92690fd1c1fdea748676acf7e2430e5a to your computer and use it in GitHub Desktop.
allocate free storage from lvm disks
#!/bin/bash
# example:
# ./resize_lvm_storage.sh ubuntu-vg ubuntu-lv 99
SIZE=$3
LG=$1
LV=$2
vgdisplay $LG
lvextend -L +"$SIZE"G /dev/"$LG"/"$LV"
resize2fs /dev/"$LG"/"$LV"
df -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment