diff options
Diffstat (limited to 'remove-vm')
-rwxr-xr-x | remove-vm | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -25,11 +25,16 @@ remove_vm() run_virsh undefine "$name" fi + # Remove the LV, if it exists. lvpath="/dev/$vg/$name" if [ -e "$lvpath" ] then sudo lvremove --force "$lvpath" + else + # In case the LV was kpartx'd, undo that + sudo kpartx -dsv "$lvpath" + sudo lvremove --force "$lvpath" fi # Remove the host from /etc/hosts, if there. |