LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-08-2005, 10:05 PM   #1
tsilok
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
or
[2] More detailed information, if some portion of the TAR has corrupted.

Is that possible?

Thx,
Charisma
 
Old 09-09-2005, 02:22 AM   #2
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 848

Rep: Reputation: 107Reputation: 107
Hi, Tsilok!

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

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

or

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

Also, you can try:

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

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

or

Code:
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.

--Dane

Last edited by DaneM; 09-09-2005 at 02:24 AM.
 
Old 09-09-2005, 08:55 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
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, 09:45 AM   #4
SlackerLX
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, 09:37 PM   #5
tsilok
LQ Newbie
 
Registered: Sep 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Dear all,

Thanks for the assistance. I have figured it out.
 
  


Reply


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 03:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 11:55 AM
HELP, corrupted tar tape Paul_assheton Linux - General 1 01-20-2004 11:37 AM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 07:30 AM
backup/verify files with tar hokri Linux - General 0 11-27-2001 07:05 AM


All times are GMT -5. The time now is 10:54 AM.

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