Created
July 2, 2018 19:21
-
-
Save d0n601/11a91796dfd0ca466ccc8b85fde7b911 to your computer and use it in GitHub Desktop.
A really basic bash script to loop dd in order to writes random data to a disk 8 times over.
This file contains hidden or 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/bash | |
#Basic while loop to whipe a harddisk. | |
# Show us the disks. | |
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL | |
# Prompt for disk to kill. | |
echo What disk to you want to kill \(ex: sdb\) | |
read killdisk | |
killdisk="/dev/$killdisk" | |
# This can take a long time for large disks. | |
counter=1 | |
while [ $counter -le 8 ] | |
do | |
sudo dd if=/dev/urandom of="$killdisk" bs=1M # Change to not be sdb | |
((counter++)) | |
done | |
echo All done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment