From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 14 11:23:01 2004 Return-Path: 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 AE6B416A4CE for ; Wed, 14 Jan 2004 11:23:01 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83DF743D46 for ; Wed, 14 Jan 2004 11:22:50 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i0EJKtUd050786; Wed, 14 Jan 2004 14:20:55 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i0EJKt9K050783; Wed, 14 Jan 2004 14:20:55 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Wed, 14 Jan 2004 14:20:55 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: David Gilbert In-Reply-To: <16389.25821.502399.872877@canoe.dclg.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Filesystem marker. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2004 19:23:01 -0000 On Wed, 14 Jan 2004, David Gilbert wrote: > Is there a set of bytes at some offset in a block that is common to any > instance of a BSD ufs filesystem? I ask because recently my home > machine erased it's fdisk block _and_ the bsdlabel with it. It > certainly didn't have time to erase the whole disk, but I'm having > trouble guessing where the partitions are. > > /usr/ports/sysutils/gpart will look for partitions on a disk ... but it > only knows to look for bsd disklabels ... not bsd filesystems. Ideally, > I'd like to make a bsd filesystem module for gpart with some pointers > from the group. I ported the OpenBSD version of their scan_ffs to FreeBSD. However, it only speaks UFS1: http://www.watson.org/~robert/freebsd/scan_ffs_freebsd4/ It might also require tweaking to even build on -CURRENT, as I haven't lost any file systems recently enough to have needed to test. One of the nice things about this tool is that it can generate output that can then be fed into disklabel to write the disklabel you need back to disk. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research