It is possible for gzip'ed files to become corrupt and the normal means of extracting the archive will fail. This is especially disconcerting when you are trying to restore from a gzip'ed backup.
Fortunately, the Gzip Recovery Toolkit (gzrt) can offer some hope. It may not recover all your files, but if you are facing this dilemma, anything can be a help.
Mageia6 does not provide gzrt, but it was available for Mandriva 2011 and can be downloaded here for the 32-bit version and here for the 64-bit version. No dependencies were needed to install it, but it will complain about having an invalid signature; I chose to ignore that and proceed with the installation. The installed binary is /usr/bin/gzrecover. A man page and documentation is provided. The dependencies that it actually requires (cpio and libzlib) should already be installed on your system by default.
To use, simply launch gzrecover with the corrupt file name as the argument. The output will be a file with the same name with .recovered appended to it.
That should be enough, but if you have a *.tar.gz archive, GNU tar will choke on the corrupt file. To get around this annoyance, you can use cpio to extract the recovered file.
The GZIP Recovery Toolkit homepage provides additional information as well as the following example.
$ ls *.gz
$ my-corrupted-backup.tar.gz
$ gzrecover my-corrupted-backup.tar.gz
$ ls *.recovered
$ my-corrupted-backup.tar.recovered
$ cpio -F my-corrupted-backup.tar.recovered -i -v
And like magic, there are your recovered files.
RESOURCES
GZIP Homepage
GZIP FAQ
GZIP Recovery Toolkit Homepage
CPIO Homepage
Fortunately, the Gzip Recovery Toolkit (gzrt) can offer some hope. It may not recover all your files, but if you are facing this dilemma, anything can be a help.
Mageia6 does not provide gzrt, but it was available for Mandriva 2011 and can be downloaded here for the 32-bit version and here for the 64-bit version. No dependencies were needed to install it, but it will complain about having an invalid signature; I chose to ignore that and proceed with the installation. The installed binary is /usr/bin/gzrecover. A man page and documentation is provided. The dependencies that it actually requires (cpio and libzlib) should already be installed on your system by default.
To use, simply launch gzrecover with the corrupt file name as the argument. The output will be a file with the same name with .recovered appended to it.
That should be enough, but if you have a *.tar.gz archive, GNU tar will choke on the corrupt file. To get around this annoyance, you can use cpio to extract the recovered file.
The GZIP Recovery Toolkit homepage provides additional information as well as the following example.
$ ls *.gz
$ my-corrupted-backup.tar.gz
$ gzrecover my-corrupted-backup.tar.gz
$ ls *.recovered
$ my-corrupted-backup.tar.recovered
$ cpio -F my-corrupted-backup.tar.recovered -i -v
And like magic, there are your recovered files.
RESOURCES
GZIP Homepage
GZIP FAQ
GZIP Recovery Toolkit Homepage
CPIO Homepage
Comments