Skip to content

Instantly share code, notes, and snippets.

@brookemckim
Created October 19, 2012 16:14
Show Gist options
  • Save brookemckim/3919117 to your computer and use it in GitHub Desktop.
Save brookemckim/3919117 to your computer and use it in GitHub Desktop.
Remove all volume groups
volume_groups=$(vgdisplay | grep "VG Name" | awk '{print $3}')
for g in $volume_groups; do
vgremove --force $g
done
volume_groups=$(vgdisplay | grep 'VG Name' | grep -o '[a-zA-Z0-9]\{1,\}$')
for g in $volume_groups; do
vgremove --force $g
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment