This commit is contained in:
Marc Beninca 2023-12-28 10:01:15 +01:00
parent c00ceaacaf
commit 874dd04672

View file

@ -186,7 +186,11 @@ function hetzner-rescue-wipe-8-8-0 {
# format esp
dd \
if='/dev/zero' of="${device}3" bs='1M'
mkfs.vfat -F 32 -n "esp-${number}" "${device}3"
mkfs.vfat \
-F 32 \
-S 4096 \
-n "esp-${number}" \
"${device}3"
done
#
number=0
@ -195,20 +199,17 @@ function hetzner-rescue-wipe-8-8-0 {
echo ; echo "#${number}: ${device}2"
# wipe boot
dd status='progress' \
if='/dev/zero' of="${device}2" bs='1G'
if='/dev/zero' of="${device}2" bs='1G' count=1
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[@]} \
mkfs.btrfs --force \
--label 'boot' \
--checksum 'sha256' \
--data 'raid0' \
"${members[@]}"
#
number=0
@ -232,12 +233,6 @@ function hetzner-rescue-wipe-8-8-0 {
--level 0 \
--raid-devices ${#devices[@]} \
"${members[@]}"
# format boot
mkfs.ext4 \
-F \
-L 'boot' \
-U '6234a0eb-29a3-a847-1dbd-5ec4bada5579' \
'/dev/md/boot'
# encrypt
echo "${passphrase}" \
| cryptsetup \