+
+ # we do lvm removals just for the disks we are using
+ pv_wipes=()
+ vg_wipes=()
+ declare -A vg_map
+ pv_devs=$(pvs --noheadings -o pvname)
+ for pv_dev in $pv_devs; do
+ for short_dev in ${short_devs[@]}; do
+ if [[ $pv_dev == $short_dev* ]]; then
+ pv_wipes+=($pv_dev)
+ vgs_of_pv=$(pvs --noheadings -o vgname $pv_dev)
+ for vg in $vgs_of_pv; do
+ if [[ ${vg_map[$vg]} ]]; then
+ continue
+ fi
+ vg_map[$vg]=t
+ vg_wipes+=($vg)
+ lvs=$(vgs --noheadings -o lv_path $vg)
+ for lv in $lvs; do
+ wipefs -a $lv
+ done
+ done
+ fi
+ done