1
0
mirror of https://github.com/tommytran732/Arch-Setup-Script synced 2025-02-20 18:01:33 -05:00

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>
This commit is contained in:
funk-on-code 2022-09-26 07:45:27 +00:00 committed by GitHub
parent 369d516c53
commit 905df159f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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