I have a hard drive that went bad and before I send it for RMA I want to wipe as much as possible from it. I tried using windows utilities and also did dd of /dev/random. The problem is I can't wait for either of those solutions to finish as the reason for the RMA is that it writes at a max speed of 1 MB/Sec. It will take over 140 hours just to do a single pass of the 500GB hard drive.
I have been looking for a utility (or even a bash script on linux) that would pick sectors at random and write random data (or even zeros) to those sectors. I'm hoping that if I run this for 24 hours, that will wipe approximately 80 GB of data. Since it will be randomly chosen, all the bigger files will be impossible to recover and the smaller ones will either be wiped, will be missing chunks, or will possibly be recoverable. This is unfortunately the optimal solution for me at this point.
SOLUTION
Thanks to "evildead" I was able to get a lot of the data on the drive to be randomly filled with junk from /dev/urandom. The bash script, in case someone ever needs it, is below:
#!/bin/bash
while (true); do
randnum=${RANDOM}${RANDOM}
number=$((10#$randnum%976773168))
echo -e $number >> progress.txt
dd if=/dev/urandom of=/dev/sdx1 skip=$number count=1
done
You will need to replace 976773168 with the number of blocks on your drive. I originally tried $RANDOM in bash, but it is only a 16-bit int and therefore is only 32k. As I needed a number that is over 900 Million I combined two $RANDOM values, so for instance if my random numbers are 22,861 and 11,111 I get 2,286,111,111 then fitting it to my block size I get a pretty random value in my range. It doesn't have perfect entropy but then again, what is really random on a computer? ;) The 10# is there in case the first random number is a 0, it forces bash to use base 10, not base 8, which is what it uses if it thinks the number is an octal (leading zero). I also write the random numbers to a file for analysis later to see what the spread was. If you don't need this you can just take out
echo -e $number >> progress.txt
and it will run fine. Also dont forget to replace sdx1 with the actual drive or partition you want to work on. I hope this is helpful for someone, I know it was really helpful for me.