Disk overwrite speed: cat vs dd vs shred

Tagged:  

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

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is to verify that you are a human.