Linux – How to extract from this tar file when the file may be corrupt

linuxtar

When attempting to extract all files from a tar file, I get the following error message:

tar: Skipping to next header
tar: Error exit delayed from previous errors

Some of the files extract properly before this error message is printed, and the process results in a garbled file that seems to contain the rest of the archive. All of the files in this archive are text files.

Is there anything I can try to recover the rest of the files?

Best Answer

You could try your extract with the -i option to ignore zeros:

The --ignore-zeros (-i) option causes tar to ignore blocks of zeros in
the archive. Normally a block of zeros indicates the end of the archive,
but when reading a damaged archive, or one which was created by cat-ing
several archives together, this option allows tar to read the entire
archive. This option is not on by default because many versions of tar
write garbage after the zeroed blocks.