Merge "Wipe all LVs during kickstart"

This commit is contained in:
Zuul 2023-09-27 16:27:51 +00:00 committed by Gerrit Code Review
commit f6ab5912b3
2 changed files with 18 additions and 0 deletions

View File

@ -1297,6 +1297,15 @@ if [ ${#vgs[@]} -eq 0 ] ; then
ilog "No volume groups found"
else
for vg in ${vgs[@]} ; do
lvs=( $(exec_no_fds "$STOR_DEV_FDS" "lvs --select vg_uuid=${vg} --noheadings -o lv_name 2>/dev/null") )
vg_name=$(exec_no_fds "$STOR_DEV_FDS" "vgdisplay -C --noheadings --select vg_uuid=${vg} -o vg_name 2>/dev/null" | xargs)
ilog "Wipe any previous signatures from ${vg_name} volume group"
for lv in ${lvs[@]} ; do
ilog "Wipe any previous signatures from ${lv} logical volume"
exec_no_fds "$STOR_DEV_FDS" "wipefs -a /dev/${vg_name}/${lv} 2>/dev/null" 5 0.5 || wlog "Failed to wipe signatures from ${lv}"
done
ilog "Disable volume group ${vg}"
exec_no_fds "$STOR_DEV_FDS" "vgchange -an --select vg_uuid=${vg} 2>/dev/null" 5 0.5
[ $? -ne 0 ] && report_failure_with_msg "Failed to disable ${vg}."

View File

@ -1228,6 +1228,15 @@ if [ ${#vgs[@]} -eq 0 ] ; then
ilog "No volume groups found"
else
for vg in ${vgs[@]}; do
lvs=( $(exec_no_fds "$STOR_DEV_FDS" "lvs --select vg_uuid=${vg} --noheadings -o lv_name 2>/dev/null") )
vg_name=$(exec_no_fds "$STOR_DEV_FDS" "vgdisplay -C --noheadings --select vg_uuid=${vg} -o vg_name 2>/dev/null" | xargs)
ilog "Wipe any previous signatures from ${vg_name} volume group"
for lv in ${lvs[@]} ; do
ilog "Wipe any previous signatures from ${lv} logical volume"
exec_no_fds "$STOR_DEV_FDS" "wipefs -a /dev/${vg_name}/${lv} 2>/dev/null" 5 0.5 || wlog "Failed to wipe signatures from ${lv}"
done
ilog "Disable volume group ${vg}"
exec_no_fds "$STOR_DEV_FDS" "vgchange -an --select vg_uuid=${vg} 2>/dev/null" 5 0.5
[ $? -ne 0 ] && report_failure_with_msg "Failed to disable ${vg}."