From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 20 17:30:16 2005 Return-Path: X-Original-To: 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 082BE16A41F for ; Wed, 20 Jul 2005 17:30:16 +0000 (GMT) (envelope-from frank@exit.com) Received: from tinker.exit.com (tinker.exit.com [206.223.0.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A74143D48 for ; Wed, 20 Jul 2005 17:30:15 +0000 (GMT) (envelope-from frank@exit.com) Received: from realtime.exit.com (realtime [206.223.0.5]) by tinker.exit.com (8.13.3/8.13.3) with ESMTP id j6KHUSLv020157 for ; Wed, 20 Jul 2005 10:30:28 -0700 (PDT) (envelope-from frank@exit.com) Received: from realtime.exit.com (localhost [127.0.0.1]) by realtime.exit.com (8.13.3/8.13.3) with ESMTP id j6KHUE2j001096 for ; Wed, 20 Jul 2005 10:30:14 -0700 (PDT) (envelope-from frank@exit.com) Received: (from frank@localhost) by realtime.exit.com (8.13.3/8.12.9/Submit) id j6KHUCWh001095 for hackers@freebsd.org; Wed, 20 Jul 2005 10:30:12 -0700 (PDT) (envelope-from frank@exit.com) X-Authentication-Warning: realtime.exit.com: frank set sender to frank@exit.com using -f From: Frank Mayhar To: hackers@freebsd.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Exit Consulting Date: Wed, 20 Jul 2005 10:30:11 -0700 Message-Id: <1121880611.929.12.camel@realtime.exit.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 FreeBSD GNOME Team Port X-Virus-Scanned: ClamAV version 0.86.1, clamav-milter version 0.86 on tinker.exit.com X-Virus-Status: Clean Cc: Subject: UFS2 recovery tool? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: frank@exit.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2005 17:30:16 -0000 Due to a series of circumstances involving a RAID controller and an unclear user interface and an unfortunate use of "fsck -y", I managed to hammer a couple of very large file systems. (Fortunately I had a very recent copy of /home backed up elsewhere, or I wouldn't be sending this email.) While I could live without the data on those file systems if I absolutely had to, I know much of the data is recoverable with the right tools. In fact I found a whole intact subtree using fsdb. Unfortunately the root directory was wiped. While I can recover the inode with fsdb, it doesn't allow me to allocate a new (free) block for the directory contents. What I need is either a way to set up the root directory so I can link the subtrees that I find to it, or, alternatively, something like ffsrecov that will just pull the subtree off the dead filesystem directly, writing it to a _live_ filesystem. Unfortunately, ffsrecov hasn't yet been updated to support UFS2. If I have to, I'll write the code myself, but I'm hoping here that someone else has done so already. (At the moment it's hard for me to find the time for such relatively complex development that isn't directly work-related.) So, has anyone done this? If someone even has code lying around that understands UFS2 and can create directories and allocate blocks, even if it's not suitable for inclusion in ports, that would be wonderful. Drop me email with a pointer to said code. Alternatively, if you have (detailed, low-level) advice as to how to write the code, feel free to chime in. (Please, though, don't tell me to look at fsck_ffs, fsdb and sys/ffs/*; that I know already and it will be where I start if I end up writing this all myself.) So here's hoping... -- Frank Mayhar frank@exit.com http://www.exit.com/ Exit Consulting http://www.gpsclock.com/ http://www.exit.com/blog/frank/