Re: uncompress a partial gzip-file?



peter pilsl wrote:
> Is there any way to recover the data that is in backup.tgz.b and
> backup.tgz.c?

No. Not unless the gzip file is specially prepared to support this
(which gzip itself does not and cannot do). You can use zlib to create
the gzip file and to insert sync markers that allow decompression from
selected points. zlib can be used to search for such markers and start
decompressing there.

Alternatively, you can split the tar file and then gzip the pieces
separately. For the latter approach the easiest implementation would
be to split the tar file into, say, 8 megabyte chunks, gzip each of
those, and then copy as many as you can onto the DVD before moving on
to the next. There will be essentially no compression penalty for the
chunking. Note that gunzip will decompress concatenated gzip files, so
you can reconstruct the original tar file by simply concatenating all
the gzip files (in the right order!) and issuing a single gunzip
command.

In either case, you need to also figure out how to start reading a tar
file in the middle. You might be better off with a custom archive
format that provides a directory to the contents on each DVD (which may
start and end with a partial file or consist entirely of a partial
file).

If you want to be really sophisticated, you could use a Reed-Solomon
code to recover all of the data from a lost DVD using the other DVDs.

mark

.