Discussion:
corrupted tar.gz archive - I lost my backups :)/:(
_
2012-02-14 01:56:35 UTC
Permalink
Hi,

Before making the move from 7.0 to 8.2, I ran a little script that did a
backup of selected files
and folders.

Trying to recover these files on 8.2, I found that some of the archives -
unfortunately those with
the files that are dear to me - are corrupted.

In other words, I just wanted to ask if there's anyone on here, who knows
of a good repair
utility for corrupted tar.gz archives?

Thanks

pancakeking79
Pegasus Mc Cleaft
2012-02-14 02:30:59 UTC
Permalink
Hi,

It would depend, I think, on how the file is corrupted. Is it the
compressed data that is corrupted or the uncompressed tar stream? You might
want to try the pax(1) utility to see if it is able to push through the
errors (if its in the tar stream).

I was able to recover data from a corrupted cpio file that I created
(I was using huge file lengths and didn't realize that cpio had a file size
limit).

Peg
-----Original Message-----
Sent: 14 February 2012 01:57
Subject: corrupted tar.gz archive - I lost my backups :)/:(
Hi,
Before making the move from 7.0 to 8.2, I ran a little script that did a
backup of selected files and folders.
Trying to recover these files on 8.2, I found that some of the archives
- unfortunately those with the files that are dear to me - are
corrupted.
In other words, I just wanted to ask if there's anyone on here, who
knows of a good repair utility for corrupted tar.gz archives?
Thanks
pancakeking79
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-
APseudoUtopia
2012-02-14 02:11:12 UTC
Permalink
Post by _
Hi,
Before making the move from 7.0 to 8.2, I ran a little script that did a
backup of selected files
and folders.
Trying to recover these files on 8.2, I found that some of the archives -
unfortunately those with
the files that are dear to me - are corrupted.
In other words, I just wanted to ask if there's anyone on here, who knows
of a good repair
utility for corrupted tar.gz archives?
Thanks
pancakeking79
Hrm....What command/script did you run to create the archive? How did
you transfer it over to the new system? What command are you using to
attempt to extract it, and what error is it giving?

You can try:
gunzip < archive.tar.gz > archive.partial.tar
Which may or may not giving you some of the files into the
archive.partial.tar file.

What does gzip --test archive.tar.gz give?
_
2012-02-14 03:38:22 UTC
Permalink
Post by APseudoUtopia
Post by _
Hi,
Before making the move from 7.0 to 8.2, I ran a little script that did a
backup of selected files
and folders.
Trying to recover these files on 8.2, I found that some of the archives -
unfortunately those with
the files that are dear to me - are corrupted.
In other words, I just wanted to ask if there's anyone on here, who knows
of a good repair
utility for corrupted tar.gz archives?
Thanks
pancakeking79
Hrm....What command/script did you run to create the archive? How did
you transfer it over to the new system? What command are you using to
attempt to extract it, and what error is it giving?
gunzip < archive.tar.gz > archive.partial.tar
Which may or may not giving you some of the files into the
archive.partial.tar file.
What does gzip --test archive.tar.gz give?
I don't have the script anymore. It is among the files lost, but it was pretty
much straight forward, making use of:
tar -czf backupfile.tar.gz folders/ of/ my/ choice/.

After creating the backups I just cp(1)ed them to an msdosfs formated
usb stick and got them onto 8.2 this way, so the famous ascii/binary
trap shouldn't be
an issue here.

Here are some of the outputs I get:

# ls
setcd12292011.tar.gz su12292011.tar.gz
sr12292011.tar.gz
# tar -xvf sr12292011.tar.gz
x root/
[snipped]
tar: Error exit delayed from previous errors.
# tar -xvf su12292011.tar.gz
x usr/home/user/
[snipped]
tar: Damaged tar archive
tar: Retrying...
tar: Damaged tar archive
tar: Retrying...
tar: Damaged tar archive
tar: Retrying...
tar: Damaged tar archive
tar: Retrying...
tar: Damaged tar archive
tar: Retrying...
tar: gzip decompression failed
tar: Error exit delayed from previous errors.
# gzip --test sr12292011.tar.gz
gzip: data stream error
gzip: sr12292011.tar.gz: uncompress failed
# gunzip < sr12292011.tar.gz > archive.partial.tar
gunzip: data stream error

It recreates something, but the most important files, which reside in
subfolders of the given tar.gz archives are gone, i.e. the subfolders
are empty.
The gunzip strategy you mentioned yields the same as a regular tar
-xvf file.tar.gz.

Pegasus, I have yet to try the pax(1) approach. I will let you know
about how that went.
Pegasus Mc Cleaft
2012-02-14 03:48:35 UTC
Permalink
-----Original Message-----
<SNIP>
tar: Damaged tar archive
tar: Retrying...
tar: gzip decompression failed
tar: Error exit delayed from previous errors.
# gzip --test sr12292011.tar.gz
gzip: data stream error
gzip: sr12292011.tar.gz: uncompress failed # gunzip < sr12292011.tar.gz
Post by APseudoUtopia
archive.partial.tar
gunzip: data stream error
It recreates something, but the most important files, which reside in
subfolders of the given tar.gz archives are gone, i.e. the subfolders
are empty.
The gunzip strategy you mentioned yields the same as a regular tar -xvf
file.tar.gz.
Pegasus, I have yet to try the pax(1) approach. I will let you know
about how that went.
Hummmmm.. I'm not sure if pax will be able to help in this case. From the
looks of it, somehow the compressed data got corrupted - I don't think pax
will be able to deal with this any better than tar did.

I wonder if there was a change in gzip (like maybe libarchive) between the
two versions of BSD that might be causing the problem. If I were attacking
the problem, I might try booting up off a 7.x bootcd and see if I can gzip
--test the archive from the usb stick.

Peg
Lowell Gilbert
2012-02-14 14:54:50 UTC
Permalink
Post by Pegasus Mc Cleaft
Post by _
It recreates something, but the most important files, which reside in
subfolders of the given tar.gz archives are gone, i.e. the subfolders
are empty.
The gunzip strategy you mentioned yields the same as a regular tar -xvf
file.tar.gz.
Pegasus, I have yet to try the pax(1) approach. I will let you know
about how that went.
Hummmmm.. I'm not sure if pax will be able to help in this case. From the
looks of it, somehow the compressed data got corrupted - I don't think pax
will be able to deal with this any better than tar did.
Probably correct; the right data isn't there, no tool is going to be
able to recover it. Data compression makes this more fragile (i.e., lose
the rest of the archive as opposed to only the files in which the data
corruption occurs.
Post by Pegasus Mc Cleaft
I wonder if there was a change in gzip (like maybe libarchive) between the
two versions of BSD that might be causing the problem. If I were attacking
the problem, I might try booting up off a 7.x bootcd and see if I can gzip
--test the archive from the usb stick.
It's easy enough to try, but it seems awfully unlikely to help; lots of
us have .tar.gz files going back a couple of decades, and if there were
ever new implementations that couldn't understand the old ones, some old
hand would have noticed by now.

Media errors happen, and preparing for them involves noticing them
before you try to use the data, as well as recovering if they go bad.
The user seems to have knowingly only had one copy of the valuable data,
which makes the word "backup" a bit of an unusual usage of the term...

--Lowell
Mike Kelly
2012-02-14 15:08:20 UTC
Permalink
Post by _
I don't have the script anymore. It is among the files lost, but it was pretty
tar -czf backupfile.tar.gz folders/ of/ my/ choice/.
After creating the backups I just cp(1)ed them to an msdosfs formated
usb stick and got them onto 8.2 this way, so the famous ascii/binary
trap shouldn't be
an issue here.
Just a thought... how large were the tar.gz files? Are you maybe hitting
on a file size limit and the .tar.gz files are getting truncated? Not sure
what the limit is for msdosfs.

--
Mike Kelly
Waitman Gobble
2012-02-14 17:44:56 UTC
Permalink
Post by Mike Kelly
Post by _
I don't have the script anymore. It is among the files lost, but it was pretty
tar -czf backupfile.tar.gz folders/ of/ my/ choice/.
After creating the backups I just cp(1)ed them to an msdosfs formated
usb stick and got them onto 8.2 this way, so the famous ascii/binary
trap shouldn't be
an issue here.
Just a thought... how large were the tar.gz files? Are you maybe hitting
on a file size limit and the .tar.gz files are getting truncated? Not sure
what the limit is for msdosfs.
--
Mike Kelly
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "
freebsd-questions-***@freebsd.org"

or perhaps pulled the drive before unmounting... with pending writes. just
a thought.

Waitman Gobble
San Jose California USA
krad
2012-02-14 20:18:38 UTC
Permalink
Just another silly thought try the tar j flag rather than the z flag, as
you might have got your compression algorithms confused. Try the xz one as
well just in case
Post by Mike Kelly
Post by _
I don't have the script anymore. It is among the files lost, but it was pretty
tar -czf backupfile.tar.gz folders/ of/ my/ choice/.
After creating the backups I just cp(1)ed them to an msdosfs formated
usb stick and got them onto 8.2 this way, so the famous ascii/binary
trap shouldn't be
an issue here.
Just a thought... how large were the tar.gz files? Are you maybe hitting
on a file size limit and the .tar.gz files are getting truncated? Not sure
what the limit is for msdosfs.
--
Mike Kelly
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "
Lowell Gilbert
2012-02-14 23:54:00 UTC
Permalink
Post by krad
Just another silly thought try the tar j flag rather than the z flag, as
you might have got your compression algorithms confused. Try the xz one as
well just in case
The system tar (based on libarchive) will figure all of this out for
you, regardless of which flag you give it.

Adam Vande More
2012-02-14 05:57:09 UTC
Permalink
Post by _
Before making the move from 7.0 to 8.2, I ran a little script that did a
backup of selected files
and folders.
I think it's IT tip #2 "You don't have a backup unless it's tested". #1 is
"Make a backup".

You could try archivers/gzrecover

Good luck,
--
Adam Vande More
_
2012-02-14 07:56:00 UTC
Permalink
Post by Adam Vande More
Post by _
Before making the move from 7.0 to 8.2, I ran a little script that did a
backup of selected files
and folders.
I think it's IT tip #2 "You don't have a backup unless it's tested". #1 is
"Make a backup".
If I am not mistaken, I did test my backups and they worked fine.
After all, one of the four files that I have unpacks with no problems
so I don't see where things could have gone wrong.
Post by Adam Vande More
You could try archivers/gzrecover
After gzrecover and cpio, the process stops at the same point where
the tar(1) command stops. It simply doesn't make it beyond the
boundary where the file is corrupted.
Post by Adam Vande More
Good luck,
--
Adam Vande More
Here is what pax(1) gave me:

# pax -rzf su12292011.tar.gz
pax: Invalid header, starting valid header search.
gzip: data stream error
pax: End of archive volume 1 reached

ATTENTION! pax archive volume change required.
Ready for archive volume: 2
Input archive name or "." to quit pax.
Archive name > .
Quitting pax!
#

Nothing new here. It seems like pax simply invokes gzip(1) internally.
C. P. Ghost
2012-02-14 17:58:57 UTC
Permalink
Post by _
Trying to recover these files on 8.2, I found that some of the archives -
unfortunately those with
the files that are dear to me - are corrupted.
Do you have MD5, SHA256 etc... checksums of the
.tar.gz files somewhere? Do they still match, or do
they differ now?

(If they match, you have a software problem with tar
or gzip; try reading the files under Linux (Knoppix?)
just to be sure. If they don't match, either the media
is corrupt (very likely), or something's wrong on the
code path that reads your backup device (a lot less
likely))

-cpghost.
--
Cordula's Web. http://www.cordula.ws/
Loading...