first remove lvm, then mdadm

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2014-01-20 12:13:15 +01:00
parent c1141453fe
commit 49dfcf4885

View file

@ -31,6 +31,12 @@ if find /sys/class/block/$disk_name*/holders/ -mindepth 1 | grep -q holders/dm;
fi
fi
if command -v pvremove >/dev/null; then
pvremove --force --force --yes "$disk" || true
else
echo "WARNING: pvremove command not found" >&2
fi
# stop mdadm raids if any
if [ -r /proc/mdstat ]; then
md_name="\$(awk '/$disk_name/ {print \$1}' /proc/mdstat)"
@ -43,12 +49,6 @@ if [ -r /proc/mdstat ]; then
fi
fi
fi
if command -v pvremove >/dev/null; then
pvremove --force --force --yes "$disk" || true
else
echo "WARNING: pvremove command not found" >&2
fi
if command -v mdadm >/dev/null; then
mdadm --zero-superblock --force "$disk" || true
else