Re: creating large files for testing

Previous thread: hotplugd(8) ignoring devices attached before boot by MERIGHI Marcus on Thursday, December 9, 2010 - 3:33 am. (1 message)

Next thread: En France ou ailleurs, il faut se faire payer by EUROPE RECOUVREMENT on Thursday, December 9, 2010 - 5:02 am. (1 message)
From: LOhit
Date: Thursday, December 9, 2010 - 5:45 am

Hello Everyone,

I apologize in advance if this question sounds stupid or has been answered
already. I need to create large dummy files for testing. I would like to
know if there is a way to do it using C on OpenBSD.

This is what I want to achieve. I tried looking for "mkfile" command, but I
couldn't find it either.

dd if=/dev/zero of=/testing/file0 bs=512 count=65536


Thanks in advance.
-LOhit

From: Guillaume Dualé
Date: Thursday, December 9, 2010 - 6:12 am

From: LOhit
Date: Thursday, December 9, 2010 - 6:18 am

Thanks Guillaume. So, it was the former :)


From: Janne Johansson
Date: Thursday, December 9, 2010 - 1:26 pm

dd if=/dev/zero of=/testing/file0 seek=1m count=1 bs=1
use seek=1024m for even larger files, and the best of it all, it
only takes a handful of bytes on disk, since it is sparse. Will still
read back zeros all the way if you "use" it later.


-- 
 To our sweethearts and wives.  May they never meet. -- 19th century toast

Previous thread: hotplugd(8) ignoring devices attached before boot by MERIGHI Marcus on Thursday, December 9, 2010 - 3:33 am. (1 message)

Next thread: En France ou ailleurs, il faut se faire payer by EUROPE RECOUVREMENT on Thursday, December 9, 2010 - 5:02 am. (1 message)