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:
parent
369d516c53
commit
905df159f2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user