Re: Map a disk LBA to filename?

Dave Chinner
2008-10-27T23:35:36Z

On Mon, Oct 27, 2008 at 02:03:15PM +0100, Michal Soltys wrote:
> Carsten Aulbert wrote:
>>
>> Dave Chinner wrote:
>>> Use xfs_bmap to find the location on disk of the extents in each
>>> file. Recurse over the filesystem until you find the file that owns
>>> the block that went bad.
>>
>> Sounds like a tedious but doable route to take.
>>
>
> Wouldn't something like (under xfs_db) :
>
> getblock -b #block -n
> ncheck -i #inode
>
> where required #inode is reported by getblock
>
> do the thing ?

Blockget - yes it will. It just does the traversal internally to
build the mapping. With large filesystems xfs_db can run out of
memory building the mapping, which is why I've used the
explicit traverse+xfs_bmap method in the past....

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com