1

I am getting an error from a tar.gz file that was created with winace when opening it with tar vxzf package.tar.gz in Linux:

tar: A lone zero block at 60140

2 Answers 2

4

Sounds like you lost one of the sectors of your hard drive that that tarball was sitting on, so that block of the file is all zeroes. You may want to download it again, or restore from a backup or something.

For a second opinion about the file, try ungzipping it with gunzip, then untar it with tar xvf ....

You may also want to read the SMART counters on that hard drive and see if it's reporting any pending, remapped, or reallocated bad sectors. If you find any, get everything off the hard drive that you can (or if you have recent enough backups, test your backups somewhere to make sure you can restore everything from them), and then erase the hard drive with the option selected to actually write zeroes or random data to every sector of the drive. That's the only way to force a hard drive to remap any bad sectors. But once a hard drive is starting to have sectors fail, it's probably time to replace the drive.

0

This is probably an incorrectly constructet .tgz file.

The lone zero block means just that. The tar file consists of header blocks and file content interleaved (the header determines how many file content blocks there will be). The file is then terminated by two or more zero blocks.

Now if there is only one zero block and the file either ends after that or there are non-zero blocks following that GNU tar will write this diagnostics and terminate (as if the file properly ended there).

If you had lost sectors of your hard drive that would probably result in gzip showing error as well (and tar reacting on that), for example:

gzip: stdin: unexpected end of file 
tar: A lone zero block at 1754
tar: Child returned status 1
tar: Error is not recoverable: exiting now

similarily if the download was prematurely terminated gzip would emit errors as well. Without these errors you it's improbable that the .tgz got hurt somehow (gzip is quite likely to detect bit errors in the zip stream and give errors for that).

Given that the zip stream is consistent one would conclude that the .tar stream that was packed was faulty (which only happens when packing the archive).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .