ddrescue has no knowledge of filesystem structure. It just copies the whole drive or partition block-by-block. Once you know which sectors are bad, you can do some caclulation to map the sector address to a filesystem block number and then use the
debugfs icheck and
ncheck requests to find out which inode and filename claim that block. The procedure is outlined in the
Bad block HOWTO, and is fairly tedious if you have more than a few bad blocks. You will probably want to do that on the
ddrescue-ed image so that
debugfs doesn't get hung up on disk retries on the bad sectors.
An alternative to finding all the files with bad blocks is to simply try to read all of them and see which ones fail with I/O errors:
Code:
find / -xdev -type f -exec cat {} \; >/dev/null
You need the "-xdev" to keep
find from digging into /proc, /sys, and the like, so you'll need to run that for each separate filesystem. You will need to do that on the failing disk, not on the image, and it's going to take a while since it will be delayed by retries on the I/O errors.