From 378e0e530f7bd0bda618d28ffc0f79c837ac63aa Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 12 Nov 2024 20:22:58 +0100 Subject: [PATCH] wipes --- bash/rescue-hetzner.sh | 12 ++++-------- bash/rescue-ovh.sh | 8 ++++---- bash/rescue.sh | 3 +-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/bash/rescue-hetzner.sh b/bash/rescue-hetzner.sh index 3ca0f3b..6386621 100644 --- a/bash/rescue-hetzner.sh +++ b/bash/rescue-hetzner.sh @@ -37,8 +37,7 @@ rescue_wipe_0_init_hetzner_8_8() { echo echo "#${number}: ${device}4" # wipe bios - dd \ - if="/dev/zero" of="${device}4" + fs_wipe "${device}4" done # number=0 @@ -47,8 +46,7 @@ rescue_wipe_0_init_hetzner_8_8() { echo echo "#${number}: ${device}3" # format esp - dd \ - if="/dev/zero" of="${device}3" bs="1M" + fs_wipe "${device}3" "1M" fs_make_fat "${device}3" "esp-${number}" "0000000${number}" # mount esp mkdir --parents "/media/esp/${number}" @@ -61,8 +59,7 @@ rescue_wipe_0_init_hetzner_8_8() { echo echo "#${number}: ${device}2" # wipe boot - dd status="progress" \ - if="/dev/zero" of="${device}2" bs="1G" count=1 + fs_wipe "${device}2" "1G" 1 done # members=() @@ -95,8 +92,7 @@ rescue_wipe_0_init_hetzner_8_8() { echo echo "#${number}: ${device}1" # wipe crypt head - dd status="progress" \ - if="/dev/zero" of="${device}1" bs="1G" count=1 + fs_wipe "${device}1" "1G" 1 done # members=() diff --git a/bash/rescue-ovh.sh b/bash/rescue-ovh.sh index 63c5192..0683acf 100644 --- a/bash/rescue-ovh.sh +++ b/bash/rescue-ovh.sh @@ -18,16 +18,16 @@ rescue_wipe_0_init_ovh_vle2() { mkpart bios 1 2 \ set 4 bios_grub on # bios / wipe - dd if="/dev/zero" of="${device}4" + fs_wipe "${device}4" # esp / wipe - dd if="/dev/zero" of="${device}3" bs="1M" + fs_wipe "${device}3" "1M" # esp / format fs_make_fat "${device}3" "esp" "00000001" # esp / mount mkdir --parents "/media/esp" mount "${device}3" "/media/esp" # boot / wipe - dd status="progress" if="/dev/zero" of="${device}2" bs="1G" count=1 + fs_wipe "${device}2" "1G" 1 # boot / format mkfs.btrfs --force \ --checksum "sha256" \ @@ -39,7 +39,7 @@ rescue_wipe_0_init_ovh_vle2() { mount --options "autodefrag,compress-force=zstd" \ "${device}2" "/media/boot" # crypt / wipe - dd status="progress" if="/dev/zero" of="${device}1" bs="1G" count=1 + fs_wipe "${device}1" "1G" 1 # crypt / encrypt echo "${passphrase}" | cryptsetup \ diff --git a/bash/rescue.sh b/bash/rescue.sh index 58076e6..47f6ca7 100644 --- a/bash/rescue.sh +++ b/bash/rescue.sh @@ -103,8 +103,7 @@ source \"/etc/bash/main.sh\" ; rescue_configure \"${hostname}\"" } rescue_wipe_1_zero() { - dd status="progress" \ - if="/dev/zero" of="/dev/mapper/crypt" bs="512M" + fs_wipe "/dev/mapper/crypt" "512M" } rescue_wipe_3_close() {