[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Please tell me this is curable...



On Mon, 24 Jan 2000, Patrick wrote:
> Thanks.  The big q is what's the recovery procedure?

Fixing by hand or writing a tool do to so. But hunt the net first, someone
might have done it already.

Let's supose your file got corrupted by a ASCII upload from UNIX -> NT.

First, you must guarantee that you're downloading the file back to UNIX in
BINARY mode so as not to make matters worse. Then you use some clues to get
the bytes right again. Sometimes it can be automated, but most of the time
not. And you WILL have to write the code to do so.

If you uploaded stuff from Unix to M$dog-like systems (NT, Win9x...) in
ASCII mode, AFAIK the corruption is that every 0A0D pair in the input stream
(the corrupted file) *might* be either 0A0D or 0A only.

You could write code that uses heuristics to read in the tar file, use the
offsets, file size, headers and CRC (if there is one) from the tar file
itself (as long as it does not contain a 0A0D in there... :-( ) to extract
the corrupted chunk which should be one file, then apply all possible
transformations (reduced by the heuristicts. E.g.: if you have the original
file size, you know how many bytes were corrupted, and that reduces the set
of possible valid 'fixes') and use the CRC to verify if the 'fixed' file is
correct.

Text files are trivial to fix. They're not even too badly screwed up, just
tar can't find them because the offsets in the tar headers are wrong. A
program to repair this kind of damage probably exists already.

If your data is very important and this type of data recovery is a bit above
your current time/knowledge constrains, you'll find someone who can do that
for you, but it may not come cheap.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh 


Reply to: