From 12d0c39ed3ebac7a5cdb803370c2396cd3a1ecd9 Mon Sep 17 00:00:00 2001 From: Paul Haerle Date: Wed, 10 Jan 2024 09:12:47 +0000 Subject: [PATCH] Don't print an error if there's no raid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörg Thalheim --- disk-deactivate/disk-deactivate.jq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disk-deactivate/disk-deactivate.jq b/disk-deactivate/disk-deactivate.jq index a55d559..16d72b7 100644 --- a/disk-deactivate/disk-deactivate.jq +++ b/disk-deactivate/disk-deactivate.jq @@ -27,7 +27,7 @@ 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}')", + "lsblk \(.path) -l -p -o type,name | awk 'match($1,\"raid.*\") {print $2}' | xargs -r mdadm --stop", # Remove all file-systems and other magic strings "wipefs --all -f \(.path)", # Remove the MBR bootstrap code