DD for wiping and writing disks

Within Linux the DD is a standard tool to write and wipe disks.

We can use it to perform DOD style disk wipes, or simply load an ISO to an SD card.

To further complicate the recovering process we will write over the entire drive with random data.

dd if=/dev/urandom of=/dev/hda

We can also write a script to do a DDOS style 7 time wipe with random data.

sudo vi wipeIt.sh

for n in `seq 7`; do dd if=/dev/urandom of=/dev/sda bs=8b conv=notrunc; done

Then run the following to make it executable.
chmod a+x wipeIt

Run the script.
sh wipeIt`

Source: https://www.marksanborn.net/howto/wiping-a-hard-drive-with-dd/

We can also add PV in order to monitor longer transfers

sudo dd if=/dev/sdb | pv -s 2G | dd of=DriveCopy1.dd bs=4096

Source: https://askubuntu.com/questions/215505/how-do-you-monitor-the-progress-of-dd

Leave a Reply

Your email address will not be published. Required fields are marked *