| Buddha Buck ( |
dd can do it too.
The "seek=N" argument to dd makes it do a seek of N (obs) blocks before writing. In this case, that creates a holey file pretty quick. (I created a 1G file in 12s without the seek, and 0.004s with the seek.)
blaisepascal@circumflex:~$ dd of=testfile if=/dev/zero bs=1k count=1 seek=1G
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.000105784 s, 9.7 MB/s
blaisepascal@circumflex:~$ ls -Flags testfile
16 -rw-r--r-- 1 blaisepascal 1099511628800 2009-06-25 00:52 testfile
blaisepascal@circumflex:~$ du testfile
16 testfile
The "seek=N" argument to dd makes it do a seek of N (obs) blocks before writing. In this case, that creates a holey file pretty quick. (I created a 1G file in 12s without the seek, and 0.004s with the seek.)