bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] wishlist: transparent compression on file- and not archive


From: Christian Hammers
Subject: Re: [Bug-tar] wishlist: transparent compression on file- and not archive level
Date: Mon, 24 Jul 2006 20:26:57 +0200

Hello

On 2006-07-24 Phillip Susi wrote:
> My guess would be that bzip2 and tar are using different block sizes, 
> and when tar attempts to seek to the next block header, it only looks 
> for the magic number on an even block boundary.  IIRC, tar uses a 5120 
> byte block size by default.  Look at the exact block size that bzip2 is 
> using and make sure tar uses a block size that evenly divides into the 
> bzip2 block size.

So..
Alternative 1 "creating a .tar.bz2 that recovers to correct .tar files":
  bzip2 by default and in this case explicitly specified is 900kb (Option
  "-9"). So I created my test tar file with "--blocking-factor=1800" (and 
  with 900, did not make any difference).

  Still, after I run bzip2recover, the first recovered block after the
  corrupted one starts with 158065 junk bytes.

Alternative 2 "recovering a .tar.bz2 and let tar extract what's left":
  That does not work, too, as is unable to skip those 158kb byte of
  junk and then continue to recover the rest of the 250MB of data.

  If, for performance reasons searching beyond the first e.g. 1kb is not
  done there should be a corresponding option.

  To my surprising tar's direct competitor cpio was able to restore the
  broken *tar* file e.g. did exactly what I wanted :-)
  "cpio -F part2.tar -i --no-absolute-filenames --make-directories -v"

Any more ideas what should be the "documented" way of dealing with compressed
tar archives?

bye,

-christian-




> Christian Hammers wrote:
> > 
> > This would be enough, theoretically. In practice though, the experiment
> > failed:
> >  - tar czf test.tar.bz2 /home/ch/doc/pics/    # 1200 files with 160MB
> >  - hexedit test.tar.bz2  # insert 8 zeroes at about 15%
> >  - bzip2recover test.tar.bz2 # 192 rec00XXX.tar.bz files created
> >  - bunzip2 rec*.bz2          
> >  - mv rec00019.tar.bz bad00019.tar.bz
> >  - bunzip2 rec*.bz2                    # uncompress the remaining
> >  - cat rec*.tar > recovered.tar
> >  - tar xvvf recovered.tar
> >       ...
> >      -rw-r--r-- root/ch     1007332 2006-05-29 20:54  \
> >          home/ch/doc/pics/Freunde/Anna (Lousberg) 2.jpg 
> >      tar: Skipping to next header 
> >      tar: Error exit delayed from previous errors
> > 
> > Although only 35 files in 17MB were restored, tar aborts.
> > As told with "string |grep -c home/ch/doc" there should be
> > 1103 files in 166MB in recovered.tar.
> > 
> > So what am I doing wrong here?
> > 
> 


-- 
Christian Hammers             WESTEND GmbH  |  Internet-Business-Provider
Technik                       CISCO Systems Partner - Authorized Reseller
                              Lütticher Straße 10      Tel 0241/701333-11
address@hidden                D-52064 Aachen              Fax 0241/911879




reply via email to

[Prev in Thread] Current Thread [Next in Thread]