Repair corrupt whisper *.wsp file(s)

Asked by Bill

Is this possible ? If so how ?
Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Michael Leinartas (mleinartas) said :
#1

Generally it's best to delete any corrupt Whisper files. If you *really* need to recover some data or something, it might involve understanding the format (it's not too bad) and some coding. If the files are merely truncated, you might try the steps below. It should also work as long as the file is still contiguous (bytes havent shifted any):

Create a new file with the same retention as the old one.
Run whisper-info.py on the new file and note the offset and points values of each of the archives
For each archive and with offset as OFFSET and points as POINTS:
dd bs=12 if=$OLDFILE of=$NEWFILE skip=$(($OFFSET + 12)) seek=$(($OFFSET + 12)) count=$POINTS

This will skip to the beginning of the archive, skip the archive header (12 bytes), and copy only the data portion of the archive (each point 12 bytes).

If you try it, let us know how it goes

Revision history for this message
Michael Leinartas (mleinartas) said :
#2

Also, here is some detail on the Whisper file format: http://readthedocs.org/docs/graphite/en/latest/whisper.html

Revision history for this message
Bill (bnyec) said :
#3

Thanks for the info. I haven't come across a corrupt file(s) as of yet. Was planning ahead and couldn't find any info on what to do if you needed to recover data from a corrupt file. :) I'll see if i can "force" or simulate file corruption, try to recover, and see what happens.

Revision history for this message
Bill (bnyec) said :
#4

Perhaps, a python script to attempt whisper file repair may be in the future? :) Thou i don't know much of python at all. heh Thanks again.

Revision history for this message
lunzet (lunzet) said :
#5

Have you been able to repair whisper files by now? I do have some corruptions and dont want to loose the historic data. Any help or ideas on this? Would be highly appreciated. :-)
Thanks

Can you help with this problem?

Provide an answer of your own, or ask Bill for more information if necessary.

To post a message you must log in.