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?
You could try your extract with the -i option to ignore zeros:
You could try other versions of tar: gnu tar, star, bsdtar, etc. One of them might handle errors better.
You say your files are all text files, so you should be able to manually edit the file and select each file and copy/paste it to a new file. Look for tar's separator between each file, it looks like a block of ASCII NULLs with the file's metadata (name, permissions, timestamps, etc.) embedded in it.
It's not pretty, but it'll work as a last resort:
Install "photorec" which may be included in the "testdisk" package on your distribution (both can be found here).
Type
"photorec <foo.tar>"
and follow the prompts (choose "None -- non partitioned media" and "other" for the filesytem option). It should be able to recover many of the files, though you'll have to identify and rename them all by hand. At least it beats losing everything. (For reference, I tar'ed up my /etc dir and tried this. Even on an un-damaged tar file, it only got 225 of 337 files, and even some of those were pretty munged up.)An even more brute force approach would be to run
"strings foo.tar > out.txt"
to recover text data from the file, which would then need to be sorted through and put back into separate files by hand.BTW... a google on "recover corrupt tar file" yielded several tools specific to your problem.