first remove lvm, then mdadm

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
remotes/origin/fix-j
Steven Armstrong 11 years ago
parent c1141453fe
commit 49dfcf4885
  1. 12
      cdist/conf/type/__install_reset_disk/gencode-remote

@ -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

Loading…
Cancel
Save