From owner-freebsd-questions@FreeBSD.ORG Fri Sep 2 20:46:35 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6122B106564A for ; Fri, 2 Sep 2011 20:46:35 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 1CB8E8FC08 for ; Fri, 2 Sep 2011 20:46:34 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QzadF-0006PQ-Ke for freebsd-questions@freebsd.org; Fri, 02 Sep 2011 22:46:34 +0200 Received: from static-78-8-147-77.ssp.dialog.net.pl ([78.8.147.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Sep 2011 22:46:33 +0200 Received: from mwisnicki+freebsd by static-78-8-147-77.ssp.dialog.net.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Sep 2011 22:46:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Marcin Wisnicki Date: Fri, 2 Sep 2011 20:46:22 +0000 (UTC) Lines: 21 Message-ID: References: <201108311826.p7VIQRCY068730@mail.r-bonomi.com> <4e5f24c3.agV2UHzbjHEXght8%perryh@pluto.rain.com> <87vctc6hvp.fsf@oak.localnet> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: static-78-8-147-77.ssp.dialog.net.pl User-Agent: Pan/0.134 (Wait for Me; Unknown) Subject: Re: Is there way to get filename for specific LBA? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 20:46:35 -0000 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