gzip/gunzip breakage

Duncan Barclay dmlb at dmlb.org
Tue Feb 17 21:59:22 GMT 2004


Following up to my own posting to have the solution archived.

> Hi all,
>
> As part of our backups we tar and gzip directories trees. Today we cause
to,
> erm, "test"*, the backup system and happily went over to the tar.gz and
> started extracting it.
>
> Unfortunately, after about 7GB is extracted, gunzip fails with:
>
> The tree we backed up is:
> # du -sk /mirror0/project/s
> 11841211        /mirror0/project/s
>
> The resulting .tar.gz file is:
> -rw-r--r--  1 root  wheel  4928408330 Feb 17 15:49
> mirror0-project-s-20040217.tar.gz
>
> # gunzip -t mirror0-project-s-20040217.tar.gz
> gunzip: mirror0-project-s-20040217.tar.gz: invalid compressed data--crc
> error
>
> It is gzip that broke or gunzip? Anyway to recover?

Well, hacking gzip to ignore the CRC check seems to have recovered the tar
file ok. It seems that the CRC is only checked at the end of the archive and
the data wasn't corrupted.

Luckily the machine has loads of spare space, so I'm going to generate the
tar files on an empty partitiion and then use spilt to keep them below 2GB
and then compress them.

Duncan





More information about the Ukfreebsd mailing list