diff --git a/disk-deactivate/disk-deactivate.jq b/disk-deactivate/disk-deactivate.jq index 2523ff1..a55d559 100644 --- a/disk-deactivate/disk-deactivate.jq +++ b/disk-deactivate/disk-deactivate.jq @@ -26,6 +26,9 @@ def remove: def deactivate: if .type == "disk" then [ + # If this disk is a member of raid, stop that raid + "mdadm --stop $(lsblk \(.path) -l -p -o type,name | awk 'match($1,\"raid.*\") {print $2}')", + # Remove all file-systems and other magic strings "wipefs --all -f \(.path)", # Remove the MBR bootstrap code "dd if=/dev/zero of=\(.path) bs=440 count=1"