[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-ddrescue] Interpreting logfile of restore to get list of corrup
From: |
Ariel |
Subject: |
Re: [Bug-ddrescue] Interpreting logfile of restore to get list of corrupted files |
Date: |
Tue, 26 Sep 2006 15:58:00 -0400 (EDT) |
On Tue, 26 Sep 2006, Chris Witham wrote:
I have a hard drive that was failing, and I was referred[1] to
ddrescue. It appears to have done a great job, but it reported over
1600 errors. I am trying to find a way to turn the 5kB logfile from
the restore into a listing of affected files so I know what I need to
replace.
http://smartmontools.sourceforge.net/BadBlockHowTo.txt
Skip the part about the LBA and partition. Start at the line beginning
Second Step.
I don't have, or know about, a script to do this.
But:
debug2fs is semi-scriptable using -f, both icheck and ncheck are very
slow, so it's faster to give the entire list of numbers in a single line
for each command, then parse the output. (So it does just a single pass
over the fs.)
Like: icheck 155 667 333 etc
Then parse the output and:
ncheck <number> <number2> etc
Keep in mind ncheck can return more then one file name per inode, so
don't use a hash on the inode to store the result.
A few other notes:
ddrescue can use a different block size then 512 (using -b). So I suggest
you normalize the log file from block to bytes, then convert back to
blocks this time using the fs block size. i.e. (int)(d*b/B) (instead of
the equation given there, which includes the LBA).
Where d is the ddrescue block number, b is the hardware block size used
with -b, and B is the filesystem block size.
Also, do not test your code on the bad hard disk, since it's possible that
the more you use it, the more damage can happen. Make a tiny throwaway fs
to play with.
-Ariel
PS. If you write a script be sure to email it, maybe Antonio will include
it in the release package.