Tech Support > Operating Systems > Zenix > Tar & Un Tar File problems
Tar & Un Tar File problems
Posted by Srinath M.K on May 12th, 2004


Hi all,

I am doing Tar for a set of files using the command :

tar cf - sri* | compress > x.tar

When i try to untar using the following command:

tar xvf x.tar

It is giving me error:
tar: tape blocksize error


NOTE: I tried to tar another set of files and it is giving me this
error when i untar :
tar xvf x.tar

It is giving me error:
tar: directory checksum error


I tried to search in other messages.. but did not find any useful
solution.

I am working on sun solaris.

Any help greatly appriciated.

Thanks and Regards,
Srinath M. K

Posted by slrn on May 12th, 2004


On 12 May 2004 06:01:51 -0700, Srinath M.K <mksrinath@indiatimes.com> wrote:
You did a compress here.

You have to uncompress it first or pipe it through uncompress.
ie. zcat <filename.tar.Z> | tar xvf or uncompress ...| tar xvf

--
slrn is a command line newsreader.
please reply, to the newsgroup(s).


Posted by Marcin Dobrucki on May 12th, 2004



Srinath M.K wrote:

Where did you copy this from? Don't run commands if you don't
understand what they do.

If you are running "tar" via compress, the result will be a
compressed file that obviously tar can't understand.

$ tar cf - sri* | compress > x.tar
$ file x.tar
x.tar: compressed data block compressed 16 bits
$

Don't name the compressed file .tar, it should be .tar.Z to indicate
the compression. To get out of this, use "uncompress".

/Marcin

Posted by Arpad I Toth on May 12th, 2004


Srinath M.K wrote:
u have to "uncompress" first then use the tar...
i.e
zcat <your_file> | tar xvf -

but I would say use gzip instead of compress...

RP

Posted by Bill Marcum on May 12th, 2004


["Followup-To:" header set to comp.unix.admin.]
On 12 May 2004 06:01:51 -0700, Srinath M.K
<mksrinath@indiatimes.com> wrote:
tar czf x.tar.gz sri*
tar xzvf x.tar.gz


--
Now KEN and BARBIE are PERMANENTLY ADDICTED to MIND-ALTERING DRUGS ...


Similar Posts