Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Aug 2011 23:18:58 -0700
From:      Doug Hardie <bc979@lafn.org>
To:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Is there way to get filename for specific LBA?
Message-ID:  <CDC43953-F142-4F7C-8C56-9F7CEC6653DE@lafn.org>
In-Reply-To: <87vctc6hvp.fsf@oak.localnet>
References:  <201108311826.p7VIQRCY068730@mail.r-bonomi.com> <4e5f24c3.agV2UHzbjHEXght8%perryh@pluto.rain.com> <87vctc6hvp.fsf@oak.localnet>

next in thread | previous in thread | raw e-mail | index | archive | help

On 31 August 2011, at 20:50, Carl Johnson wrote:

> perryh@pluto.rain.com writes:
>=20
>> Robert Bonomi <bonomi@mail.r-bonomi.com> wrote:
>>=20
>>>> Aug 31 05:13:24 da kernel: ad6: WARNING - READ_DMA UDMA ICRC
>>>> error (retrying request) LBA=3D107491647
>>>> ... I looked at bsdlabel a   it's partition f, /home. But what
>>>> is the file name?
>>>=20
>>> There's *no* easy way to find out.  You'll have to grovel through
>>> all the filesystem metadata, and the layers of index blocks for
>>> every file until you find the 'rgiht' one.
>>=20
>> This is what "icheck -B" was for, but icheck(8) no longer exists and
>> that particular bit of functionality does not seem to be provided in
>> fsck(8).
>>=20
>> One current userland utility (other than fsck) which does know
>> how to grovel through the metadata and index blocks is dump(8),
>> but you'd have to hack on it to report which inode was using a
>> particular block.
>=20
> It looks like the best bet would be fsdb, assuming that it is a UFS
> file system.  That does have a 'findblk' command to find a file
> containing a block, but you would need to calculate the block offset =
in
> the filesystem first.  It doesn't look like it would be easy, as was
> said earlier.

I created a utility some years ago that did that for UFS.  I believe it =
works for UFS2 but haven't verified it.  If you want to try it, send me =
a note and I'll ship you the code direct.

-- Doug=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CDC43953-F142-4F7C-8C56-9F7CEC6653DE>