From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 4 11:01:14 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 27A4516A477 for ; Sun, 4 Jun 2006 11:01:14 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FCE143D55 for ; Sun, 4 Jun 2006 11:01:12 +0000 (GMT) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.13.4/8.13.3) with ESMTP id k54B1AYO064264; Sun, 4 Jun 2006 15:01:10 +0400 (MSD) (envelope-from maxim@macomnet.ru) Date: Sun, 4 Jun 2006 15:01:10 +0400 (MSD) From: Maxim Konovalov To: Matt Emmerton In-Reply-To: <20060523000227.M81386@mp2.macomnet.net> Message-ID: <20060604145844.Q63310@mp2.macomnet.net> References: <002a01c5db7c$6817e030$1200a8c0@gsicomp.on.ca> <20060523000227.M81386@mp2.macomnet.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-hackers@freebsd.org Subject: Re: RFC: porting NetBSD fsdb enhancements to FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jun 2006 11:01:14 -0000 On Tue, 23 May 2006, 00:19+0400, Maxim Konovalov wrote: > Hi Matt, > > On Fri, 28 Oct 2005, 00:59-0400, Matt Emmerton wrote: > > > Recently I've had to do some low-level surgery on some disks that > > have gone bad in order to recover some of the data. This has > > required me to zero out blocks on disk, patch up the affected > > files, and pull the data off the disks. > > > > I was toying around the with fsdb tool, but couldn't figure out a > > way to map blocks to inodes (although the 'blocks' command does > > the mapping in the other direction quite nicely.) > > > > Poking around I found that someone has added this functionality > > (via a "findblk" command) to NetBSD's fsdb (back in 2003!), which > > I have grafted onto a 4.x box here with relative ease. > > > > NetBSD Mailing List Posting: > > http://groups.google.com/group/mailing.netbsd.tech.userlevel/browse_thread/thread/18acceb04cf5aadb/2a891d67edf9279%232a891d67edf9279?sa=X&oi=groupsr&start=0&num=3) > > NetBSD CVS: > > http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/fsdb/fsdb.c.diff?r1=1.24&r2=1.25&f=h > > > > Is this something that folks would like to see on FreeBSD? I've > > got RELENG_5_4 and RELENG_6_0 boxes here in my office so I can > > whip up the patches and do some testing in short order. > > I think it is a useful functionality. Here is a patch based on NetBSD > code for HEAD, should work for RELENG_5 and RELENG_6 also. [ patch skipped ] For the record: I committed this code to HEAD. Here is another cookie for fsdb(8): show and set inode birth time. http://people.freebsd.org/~maxim/diff/fsdb-btime.diff -- Maxim Konovalov