Tag Archives: .tar.gz

Circumventing EOF error to extract data from your tarball

Jun 23, 12
bmugambi
, , , , , , ,
No Comments

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

Although i had spent two days, looking for a means to circumvent this error, i made little progress until i stumbled on this page : http://linuxreviews.org/man/tar/ There is a similar page here: http://linux.die.net/man/1/tar

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!