Created
March 5, 2020 04:41
-
-
Save cjlawson02/8d1c3cea9a6124360e107e97320ffa41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
echo "What disk do you want" | |
echo "to wipe? For example - da1 :" | |
read disk | |
echo "OK, in 10 seconds I will destroy all data on $disk!" | |
echo "Press CTRL+C to abort!" | |
sleep 10 | |
diskinfo ${disk} | while read disk sectorsize size sectors other | |
do | |
# Delete MBR and partition table. | |
dd if=/dev/zero of=/dev/${disk} bs=${sectorsize} count=1 | |
# Delete GEOM metadata. | |
dd if=/dev/zero of=/dev/${disk} bs=${sectorsize} oseek=`expr $sectors - 2` count=2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment