From 905df159f23024e370d032a65ae003149af855ea Mon Sep 17 00:00:00 2001 From: funk-on-code <113871227+funk-on-code@users.noreply.github.com> Date: Mon, 26 Sep 2022 07:45:27 +0000 Subject: [PATCH] Actually wipe the disk & partitions. - Aligns sgdisk correctly. - Uses blkdiscard (in case we're wiping an nvme). - Moves partprobe. Signed-off-by: funk-on-code <113871227+funk-on-code@users.noreply.github.com> --- install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 27e2066..e09808d 100755 --- a/install.sh +++ b/install.sh @@ -72,8 +72,12 @@ done read -r -p "This will delete the current partition table on $DISK. Do you agree [y/N]? " response response=${response,,} if [[ "$response" =~ ^(yes|y)$ ]]; then - wipefs -af "$DISK" &>/dev/null - sgdisk -Zo "$DISK" &>/dev/null + partprobe -s "$DISK" &>/dev/null + sgdisk --zap-all "$DISK" &>/dev/null + sgdisk --set-alignment=2048 --clear "$DISK" &>/dev/null + blkdiscard -z -f "$DISK"; sync &>/dev/null + wipefs -a -f "$DISK" &>/dev/null + partprobe -s "$DISK" &>/dev/null else echo "Quitting." exit