Anton wrote:
Let me spam too :)
the trick is to change buffer size. let's say bs=1024k will be much faster.
And you do have dd for windows.

It is more efficient than count=$bytes bs=1 but not nearly as fast as using count=0 seek=$bytes (i.e. creating a sparse file) as buffer size doesn't effect performance when count=0 (it only acts as a multiplier for the seek on the output file).

You only get a single ftruncate call when using the seek method instead of read, write, read, write, ... in a loop.

It only takes a few milliseconds to create a 1TB file vs many minutes for the other methods.

Although I must say this method's usefulness is limited if you want to know you have the space actually available and allocated to the file (but it is a very good method for testing large file support on your file server / apache server etc).

~mc

On 26/07/07, Michael Clark <[EMAIL PROTECTED]> wrote:
Anand Vaidya wrote:
> Linux Way of doint it:
> dd if=/dev/zero of=filename.txt bs=1 count=$bytes
>
>

Couldn't resists optimising this further using sparse files :)

  dd if=/dev/zero of=filename.txt bs=1 count=0 seek=$bytes

See how fast it is to make a 1TB file this way e.g.:

  time dd if=/dev/zero of=filename.txt bs=1 count=0 seek=1T

~mc

_______________________________________________
Slugnet mailing list
[email protected]
http://www.lugs.org.sg/mailman/listinfo/slugnet



_______________________________________________
Slugnet mailing list
[email protected]
http://www.lugs.org.sg/mailman/listinfo/slugnet

Reply via email to