From: john@iastate.edu (John Hascall)
Subject: Re: Sparse files take up more space when copied
Date: 16 Nov 1994 00:08:12 GMT [thread overview]
Message-ID: <3abihc$t0q@news.iastate.edu> (raw)
In-Reply-To: id.5CRE1.UA8@nmti.com
Peter da Silva <peter@nmti.com> wrote:
}Peter Lister <p.lister@cranfield.ac.uk> wrote:
}> I tarred the directory and gzip managed 94% compression on the tar
}> file (yes, that's right, reduced the size by 94%), so these files are
}> obviously pretty sparse. It would seem that I-DEAS can take advantage
}> of some pretty good file compression in the OSF1 filesystem when it
}> writes it's files, but tar,cp,etc don't manage this.
}To be precise... if you seek to a point beyond the end of a file then write,
}blocks between the end of the file and the new seek point will not be
}allocated until they are written to, and will read as blocks of zeros.
}
}A database program will tend to do this, producting what's called a "sparse
}file".
}
}If you write a block of zeros, it will be allocated, so tar and cp and so on
}will populate a sparse file.
}
}The fix is to have a program that seeks (on output) over blocks of zeroes (on
}input) as it writes. It's not a complex program...
Or, just use "dd conv=sparse ..."
John
--
John Hascall ``An ill-chosen word is the fool's messenger.''
Systems Software Engineer, ISU Comp Center + Ames, IA 50011 + 515/294-9551
& Hascall Systems - Unix/C/Internet Consulting, Training, Custom Programming
next prev parent reply other threads:[~1994-11-16 0:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-11-15 15:11 Sparse files take up more space when copied Peter Lister
1994-11-15 16:08 ` Peter da Silva
1994-11-15 16:30 ` Peter da Silva
1994-11-16 0:56 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
1994-11-16 0:08 ` John Hascall [this message]
1994-11-17 20:35 ` Peter da Silva
1994-11-15 19:52 ` Torbj|rn Lindgren
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox