dont null whole disk

This commit is contained in:
Dominik Moritz Roth 2025-05-18 18:39:15 +02:00
parent fd4e92e49b
commit 6f98289af0

View File

@ -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