UNIX : how can I recover a corrupt tar file from a tape?

I've a tape contains a corrupt tar file. I'm using Unix SunOS 5.5.1. So when I run this command :

dd if=/dev/rmt/0 of=/tmp/outputfile.tar

I get this error message :

warning /pci@1f, 0/pci@1/pci@1/sunw, isptwo@4/st@4,0 (sty):       Error for command : read Error Level: Fatal       Requested Block : 11900 Error Block : 11900       Vendor : TANDBERG             Serial Number: =:CREATED081       Sense Key: Media Error       ASC: 0x11 (unrecorded read error), ASCQ: 0x1, FRU: 0x0

Please Help me I really need solution for this problem

It looks more like a corrupt support (media) rather than a bad file... Have you tried cleaning the heads, check the hmmm what is it DAT? or real tape or??? DAT can go faulty if not properly rewound before loading...
I had a case where a sysadmin was desperate and asked me to help him, when I ejected the DAT to look at its state :eek: I noticed the tape was broken :smiley: ...
Poor guy was trying for hours...

Lots of questions to ask about this.

Do you know for certain that it's a tar tape and not cpio or some other proprietary format?

Sometimes tape formats have a header so use a no rewind 'nr' device to prevent rewinding, stopping the tape where it is, and then try again.

Do you know the blocking factor the tape was written in?
If you're trying to read it raw with dd, trying appending each of bs=512, bs=1024, bs=2048 and bs=4096 to the dd command. Perhaps tar was configured to write a different block factor to what dd is defaulted.

DAT's always know internally (without reference to the O/S) if they are reading junk. The DAT mechanism writes enough checksums (created by the drive) to know when the integrity of the data is compromised.

---------- Post updated at 01:57 PM ---------- Previous update was at 11:57 AM ----------

Other thoughts are:-

also try bs=10240 in case it's written with the commonly used block size of 10k

Was the tape written by this DAT drive? Tape transports can go out of alignment (the posts that guide the tape) so you may well find that if you put the tape into the drive that wrote it, it will read with no problem.