You can use mkfile to create a /dev/zero like file.
Create a one gig "empty" file.
mkfile -n 1g bigfile
Note that "-n" prevents the blocks allocation of the file, only the size is
recorded and reading this file will make the kernel to give you nulls.
So your test will be:
dd if=bigfile bs=1024k of=tstfile count=1024
Post by Cameron Kay
# dd if=/dev/zero bs=1024k of=tstfile count=1024
UNIX is so powerful!
BTW is it possible to do the same on NT? ;-)
mkfile - create a file
mkfile [ -nv ] size[b|k|m|g] filename ...
mkfile creates one or more files that are suitable for use
as NFS-mounted swap areas. The sticky bit is set, and the
file is padded with zeroes by default. The default size
unit is bytes, but the following suffixes may be used to
multiply by the given factor: b (512), k (1024), m
(1048576), and g (1073741824).
-n Create an empty filename. The size is noted, but
disk blocks aren't allocated until data is written
-v Verbose. Report the names and sizes of created
If a client's swap file is removed and recreated, it must
be re-exported before the client will be able to access
it. This action may only be done when the client is not
chmod(2), stat(2), exportfs(8), sticky(8)
// Fabien Roy
// Senior Manager, MIS
// MediaRing Inc.
// 99 West Tasman Drive
// Suite 280
// San Jose, CA 95134
// Tel: (408) 383-9222 #109
// Fax: (408) 383-9223