dump/restore

Jeff Makey Makey at logicon.arpa
Thu Nov 10 05:58:55 AEST 1988


(Root Boy) Jim Cottrell <rbj at nav.icst.nbs.gov> writes:
>Isn't it about time the kernel created holes via writing as well as
>seeking? I can see possible performance problems with all those
>`looking for zero' scanning loops;

Few files on most UNIX systems need the sparse-file feature.  However,
I once was messing with some custom database files that were very
large and very sparse.  In order to copy one of these database files
and not fill up the file system I had to write my own version of "cp"
which scanned each input block and didn't write it out if it contained
all zeroes.  The one exception was the very last block, which had to
be written out to disk regardless of contents to properly set the file
size.  Copying large sparse files this way is *much* faster than
actually writing every block of zeroes.  Even for normal files the
performance difference between this and the standard "cp" was so
slight that I just put my modified "cp" in my personal "bin" directory
and used it all the time.

                        :: Jeff Makey
                           Makey at LOGICON.ARPA



More information about the Comp.unix.questions mailing list