Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
broken bytes destroy whole tar archive?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Danstroem
n00b
n00b


Joined: 14 Jun 2004
Posts: 62
Location: Recklinghausen, Germany

PostPosted: Fri Jul 07, 2006 6:49 pm    Post subject: broken bytes destroy whole tar archive? Reply with quote

I recently made a system-backup with:

Code:
tar --wildcards --wildcards-match-slash --exclude 'sys/*' --exclude 'proc/*' --exclude 'mnt/d/Download/*' -cvzO /


Yes I know, this is not perfect. ;) My problem is a different:

I burned the archive to a DVD+RW media and some days later, i tried to restore it: Bad blocks on the media! :evil:
I copied the image with dd_rescue. About 120kB of data from the 4.0GB archive were gone. I was still happy, because I read that corrupted data in tar archives is just ommited, and I loose only some sectors (64kB per sector for gzip compressed tars) of data. But I had to realise, that tar did NOT continue to extract the archive. I got
Code:
tar -xzf archive.tar.gz
gzip: stdin: invalid compressed data--format violated
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now


I read the manpage and tried various options which sounded helping, but I did't get it working. I also tried to copy the image with
Code:
dd_rescue -A archive.tar.gz /mnt/d/archive.tar.gz


which fills the broken sectors with zeros, so that the size of the file stays the same, but tar didn't care.
Do you have an idea how to convince tar from continueing? Any hint greatly appreciated!

Thanks in advance!

-Daniel
_________________
http://www.stormgarde.com
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Fri Jul 07, 2006 6:59 pm    Post subject: Reply with quote

It's not the tar format that is breaking (tar basically just concatenates all the files together like -- aehm -- lump of tar) but gzip.

I'm not sure if that can be fixed, but the gzip home page has a guide. It is truly non-trivial though.

HTH and Good Luck!


PS. That is why using compression of the archive is not a good idea for a backup. Small corruptions can destroy the whole backup. Much better to compress the individual files before archiving.
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum