Ever wonder which can fill a disk with random bits the fastest?
| command | time in seconds to overwrite 1000M |
|---|---|
| cat /dev/urandom > /dev/hda1 | 238.56 |
| dd bs=16k if=/dev/urandom of=/dev/hda1 | 240.36 |
| shred -n 1 /dev/hda1 | 240.92 |
As you can see, cat is fastest, though not by much -- on a big disk it might save you a couple of minutes.
I tried several blocksizes with dd, from 1k to 50M, and bs=16k came out to be the fastest.
YMMV
This blog entry explains why cat is faster than dd.
Post new comment