Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Sep 2011 20:46:22 +0000 (UTC)
From:      Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Is there way to get filename for specific LBA?
Message-ID:  <j3rfau$e1e$1@dough.gmane.org>
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 Wed, 31 Aug 2011 20:50:18 -0700, Carl Johnson wrote:

> 
> 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 have a ruby script for this that wraps various commands.

You pipe an error log to it and it finds files:

  blocks2file.rb < /var/log/messages

Currently, it looks only for geom errors (with byte offsets) but that can 
be easily adjusted.
It helped me find the source of my problems in the past but I haven't 
worked on it since.

Here it is: https://github.com/mwisnicki/freebsd-block2file




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?j3rfau$e1e$1>