| ... | ... |
@@ -35,7 +35,7 @@ BACKING_FILE_SUFFIX=-backing-file |
| 35 | 35 |
|
| 36 | 36 |
# _clean_lvm_volume_group removes all default LVM volumes |
| 37 | 37 |
# |
| 38 |
-# Usage: clean_lvm_volume_group $vg |
|
| 38 |
+# Usage: _clean_lvm_volume_group $vg |
|
| 39 | 39 |
function _clean_lvm_volume_group {
|
| 40 | 40 |
local vg=$1 |
| 41 | 41 |
|
| ... | ... |
@@ -43,6 +43,16 @@ function _clean_lvm_volume_group {
|
| 43 | 43 |
sudo lvremove -f $vg |
| 44 | 44 |
} |
| 45 | 45 |
|
| 46 |
+# _remove_lvm_volume_group removes the volume group |
|
| 47 |
+# |
|
| 48 |
+# Usage: _remove_lvm_volume_group $vg |
|
| 49 |
+function _remove_lvm_volume_group {
|
|
| 50 |
+ local vg=$1 |
|
| 51 |
+ |
|
| 52 |
+ # Remove the volume group |
|
| 53 |
+ sudo vgremove -f $vg |
|
| 54 |
+} |
|
| 55 |
+ |
|
| 46 | 56 |
# _clean_lvm_backing_file() removes the backing file of the |
| 47 | 57 |
# volume group |
| 48 | 58 |
# |
| ... | ... |
@@ -69,6 +79,7 @@ function clean_lvm_volume_group {
|
| 69 | 69 |
local vg=$1 |
| 70 | 70 |
|
| 71 | 71 |
_clean_lvm_volume_group $vg |
| 72 |
+ _remove_lvm_volume_group $vg |
|
| 72 | 73 |
# if there is no logical volume left, it's safe to attempt a cleanup |
| 73 | 74 |
# of the backing file |
| 74 | 75 |
if [[ -z "$(sudo lvs --noheadings -o lv_name $vg 2>/dev/null)" ]]; then |