0

I'm currently writing 1s to a file using the following:

tr '\0' '\377' < /dev/zero > /dev/sdb

But this is a really slow method when I want to fill a 500GB disk. Is there a quicker way?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Owen Pauling
  • 203
  • 4
  • 9

1 Answers1

0

It may be faster to create a reasonably-sized file full of one bits, say 1MB, with something like tr '\0' '\377' </dev/zero | dd of=allones bs=1M. Then you could write this repeatedly, e.g. while true; do cat allones; done >/dev/sdb.

Tom Hunt
  • 9,808
  • 4
  • 25
  • 43