Quantcast
Channel: Recover corrupt tarball - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

Recover corrupt tarball

$
0
0

I have a corrupt tarball on my hands. My first attempt at recovery went like this:

$ tar --ignore-failed-read --ignore-command-error -xf tarball.tar
tar: Skipping to next header tar: Archive contains ‘180738 0’ where numeric mode_t value expected
tar: Archive contains ‘0.445647 -9.’ where numeric time_t value expected
tar: Archive contains ‘.259273 ’ where numeric uid_t value expected
tar: Archive contains obsolescent base-64 headers
tar: Archive contains ‘-0.94874’ where numeric gid_t value expected
tar: text from a text file is here: implausibly old time stamp 1969-12-31 18:59:59
tar: more text file contents are here: Unknown file type 'p', extracted as normal file
tar: Skipping to next header
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

This didn't extract much from the tarball before erroring out. The exit status is 2 which the tar man page says is a fatal error.

The documentation for "gzip Recovery Toolkit" suggested this:

cpio -F tarball.tar -i -v

This extracted 1.2G of a 1.8G tarball, which is pretty good. It stops with a bunch of garbage entered after the terminal prompt -- it isn't printed to the screen, it's as if I had typed it and didn't hit return yet.

Is there a way to do any better? Is there a way to try and "jump over the bad chunks" of the tarball?

With --ignore-zeros tar seems to be reading through the entire tar file.

tar -R --ignore-failed-read --ignore-command-error --ignore-zeros -xvf tarball.tar
[...]
block 3670356: ** Block of NULs **
block 3670357: ** Block of NULs **
block 3670358: ** Block of NULs **
block 3670359: ** End of File **
tar: Exiting with failure status due to previous errors

There are a lot of Block of NULs errors so it looks like the contents might be irretrievable.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images