On Mon, 2005-01-10 at 09:44 -0700, Stuart Jansen wrote:
> On Sat, 2005-01-08 at 21:09 -0800, Bryan Murdock wrote:
> > I guess if dd was smart enough to not copy zeros this would speed
> > things up, but I never new it was that smart.  But then, how long does
> > it take to create and delete these large zero filled files?
> 
> They're called sparse files. Good filesystems (read: not FAT, for
> example) have the ability to marks blocks as all zero without actually
> taking up any disk space. Having dd create sparse files during copy
> takes slightly more CPU, however.
> 
> Just for fun, try this:
> $ dd if=/dev/zero of=disk.img bs=1k count=1 seek=1G
> $ ls -lh disk.img

Perhaps I should clarify, so that there's no misconceptions. The sparse
file is th result of the seek, not reading from /dev/zero.

For those playing along at home, you can just as easily:
$ dd if=/dev/random of=disk.img bs=1k count=1 seek=1G

And even though the data is stored sparse on the disk, programs can
still read it:
$ cat disk.img | xxd

-- 
Stuart Jansen       [EMAIL PROTECTED]       aim:StuartMJansen
  http://www.catb.org/jargon/html/T/top-post.html
A: No.
Q: Should I include quotations after my reply?
  see also: http://www.faqs.org/rfcs/rfc1855.html

Attachment: signature.asc
Description: This is a digitally signed message part

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to