diff --git a/bash/hetzner-rescue.sh b/bash/hetzner-rescue.sh index 619bc91..ee47d11 100644 --- a/bash/hetzner-rescue.sh +++ b/bash/hetzner-rescue.sh @@ -136,6 +136,7 @@ function hetzner-rescue-wipe-12-10-10 { '/dev/sda' '/dev/sdb' ) + local members local number local unit='mib' # @@ -192,6 +193,32 @@ function hetzner-rescue-wipe-12-10-10 { # wipe boot dd if='/dev/zero' of="${device}2" bs='1G' status='progress' done + # + members=() + for device in "${devices[@]}" ; do + members+=("${device}2") + done + mdadm \ + --create '/dev/md/boot' \ + --name 'boot' \ + --uuid '6234a0eb:29a3a847:1dbd5ec4:bada5579' \ + --metadata 1 \ + --level 0 \ + --raid-devices ${#devices[@]} \ + "${members[@]}" + # + members=() + for device in "${devices[@]}" ; do + members+=("${device}1") + done + mdadm \ + --create '/dev/md/crypt' \ + --name 'crypt' \ + --uuid '006234a0:eb29a3a8:471dbd5e:c4bada55' \ + --metadata 1 \ + --level 0 \ + --raid-devices ${#devices[@]} \ + "${members[@]}" } function hetzner-rescue-wipe-12-10-10-extra {