Circumventing EOF Error to Extract Data from Tarball

You have one time or the other compressed your data into an archive for purposes of storage or portability. I do it myself often for purposes of backup. tar.gz is my most popular tarball for this purpose, because it is more compact and in my own opinion easier to handle in Linux environment.

You will feel like you wanna cry later when you try to extract the tar ball back and it hangs in between and spits up an error message like this:

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

The section that sorted me out is this:

-i, –ignore-zeros
ignore blocks of zeros in archive (normally mean EOF)
I went back to my terminal, switched to root and ran my gzip command with option -i thus:

tar -izxvf /archive/file/path.tar.gz

The terminal spat out some error messages thus:

tar: 1751/1.pdf: Cannot change ownership to uid 33, gid 33: Operation not permitted
1756/1.pdf
tar: 1756/1.pdf: Cannot change ownership to uid 33, gid 33: Operation not permitted
1278/1.pdf
tar: 1278/1.pdf: Cannot change ownership to uid 33, gid 33: Operation not permitted
1753/1.pdf

gzip: stdin: invalid compressed data–crc error
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

Never mind the errors, but i got back my all data back. Exactly what i wanted!

Circumventing EOF Error to Extract Data from Tarball
Scroll to top