I'm in the process of erasing all of the data on my hard drive after which I am going to be reinstalling Ubuntu on a LVM encrypted volume. In the process, I'm overwriting the entire hard drive with pseudo-random data several times to ensure that nothing is recoverable from before.
I noticed that using
cat /dev/urandom > /dev/sda
is much faster then
dd if=/dev/urandom of=/dev/sda
I even wrote a small script to test this on a 1 GB partition, the output of which is shown below.
Starting cat erase at Sun Dec 14 15:15:07 NST 2008
cat: write error: No space left on device
Finished at Sun Dec 14 15:18:34 NST 2008
Starting dd erase at Sun Dec 14 15:18:34 NST 2008
dd: writing to `/dev/sda1': No space left on device
2104453+0 records in
2104452+0 records out
1077479424 bytes (1.1 GB) copied, 538.686 s, 2.0 MB/s
Finished at Sun Dec 14 15:27:33 NST 2008
It's easy to see that using cat is ~ 3x faster. What is the deal with that? I though the bottleneck here was /dev/urandom. Does using cat to do this introduce other bits that aren't random?