From 6f98289af0735d0cf9033a82f852f69a9fbfcca2 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 18 May 2025 18:39:15 +0200 Subject: [PATCH] dont null whole disk --- install.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 85725e9..ca410f5 100644 --- a/install.sh +++ b/install.sh @@ -86,10 +86,14 @@ echo "Installing required packages..." apt-get update apt-get install -y cryptsetup btrfs-progs mdadm -# Wipe disks -echo "Wiping disks..." -dd if=/dev/zero of=/dev/sda bs=1M count=100 -dd if=/dev/zero of=/dev/sdb bs=1M count=100 +# Clear boot sectors and partition tables +echo "Clearing boot sectors and partition tables..." +# Clear MBR/GPT and first few sectors +dd if=/dev/zero of=/dev/sda bs=512 count=2048 +dd if=/dev/zero of=/dev/sdb bs=512 count=2048 +# Clear end of disk (where backup GPT might be) +dd if=/dev/zero of=/dev/sda bs=512 seek=$(($(blockdev --getsz /dev/sda) - 2048)) count=2048 +dd if=/dev/zero of=/dev/sdb bs=512 seek=$(($(blockdev --getsz /dev/sdb) - 2048)) count=2048 sync # Create partitions