Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-08-2005, 09:05 PM   #1
LQ Newbie
Registered: Sep 2005
Posts: 6

Rep: Reputation: 0
Can we verify a corrupted TAR?

Hello, I am an used-to-be Windows user shifting to Red Hat Linux environment. I have a question on TAR verification.

Here is the scenario:
I am in the midst of testing whether I can get TAR to provide me with descriptive information of a corrupted TAR file. The verify(-W) attribute of TAR is not descriptive enough, it can only tell me, e.g.:

[oraprod@oracle02 test]$ tar Wtvf output.tar
>tar: 4 garbage bytes ignored at end of archive
>tar: Error exit delayed from previous errors

But what I would like to know is, for instance:
[1] The content of the TAR, with identification of the corrupted files
[2] More detailed information, if some portion of the TAR has corrupted.

Is that possible?

Old 09-09-2005, 01:22 AM   #2
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 869

Rep: Reputation: 124Reputation: 124
Hi, Tsilok!

Yes, it's possible and pretty easy too. If you have an md5sum file that came with the archive you can type:

md5sum -c (nameofmd5sumfile.md5)
(It should say "OK")


cat (nameofmd5sumfile.md5) && md5sum (nameoftararchive.tar/.tar.gz/.tgz/.tar.bz2)
and compare the results.

Also, you can try:

tar -ztvf (nameoftararchive.tar.gz)
for .tar.gz files and .tgz files

tar -jtvf (nameoftararchive.tar.bz2)
for .tar.bz2 files


tar -tvf (nameoftararchive.tar)
for .tar files

That will list the files in the archive and give you an error message if it can't (pretend to) extract one or more of them.

Hope that helps.


Last edited by DaneM; 09-09-2005 at 01:24 AM.
Old 09-09-2005, 07:55 AM   #3
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,243
Blog Entries: 15

Rep: Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320
Of course you could just do a cat of the tar (or better a more of the tar). The header information can be seen but you'll have to pick it out of the other garbage.
Old 09-09-2005, 08:45 AM   #4
Senior Member
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,834

Rep: Reputation: 47
Perhaps you could also try "TARFIX" program
This package contains tools for processing and recovering damaged tar archive files
Old 09-12-2005, 08:37 PM   #5
LQ Newbie
Registered: Sep 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Dear all,

Thanks for the assistance. I have figured it out.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 10:55 AM
HELP, corrupted tar tape Paul_assheton Linux - General 1 01-20-2004 10:37 AM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 06:30 AM
backup/verify files with tar hokri Linux - General 0 11-27-2001 06:05 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration