From owner-freebsd-questions@FreeBSD.ORG Sun Jan 20 10:20:15 2008 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 2969B16A418 for ; Sun, 20 Jan 2008 10:20:15 +0000 (UTC) (envelope-from michael.grunewald@laposte.net) Received: from smtp5-g19.free.fr (smtp5-g19.free.fr [212.27.42.35]) by mx1.freebsd.org (Postfix) with ESMTP id C93E813C45A for ; Sun, 20 Jan 2008 10:20:14 +0000 (UTC) (envelope-from michael.grunewald@laposte.net) Received: from smtp5-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp5-g19.free.fr (Postfix) with ESMTP id 598213F614F; Sun, 20 Jan 2008 11:20:13 +0100 (CET) Received: from Llea.celt.neu (ron34-3-82-236-236-194.fbx.proxad.net [82.236.236.194]) by smtp5-g19.free.fr (Postfix) with ESMTP id F3CD53F6191; Sun, 20 Jan 2008 11:20:12 +0100 (CET) Received: from Llea.celt.neu (localhost [127.0.0.1]) by Llea.celt.neu (8.14.1/8.13.8) with ESMTP id m0K9K24m046007; Sun, 20 Jan 2008 10:20:03 +0100 (CET) (envelope-from michael.grunewald@laposte.net) Received: (from michael@localhost) by Llea.celt.neu (8.14.1/8.13.8/Submit) id m0K9K2gm046006; Sun, 20 Jan 2008 10:20:02 +0100 (CET) (envelope-from michael.grunewald@laposte.net) X-Authentication-Warning: Llea.celt.neu: michael set sender to michael.grunewald@laposte.net using -f To: "Kelly Jones" References: <26face530801191541i60740ba3g5dd5ba24dbaadf39@mail.gmail.com> From: michael.grunewald@laposte.net (=?iso-8859-15?Q?Micha=EBl_Gr=FCnewald?=) Date: Sun, 20 Jan 2008 10:20:01 +0100 In-Reply-To: <26face530801191541i60740ba3g5dd5ba24dbaadf39@mail.gmail.com> (Kelly Jones's message of "Sat\, 19 Jan 2008 16\:41\:26 -0700") Message-ID: <86abn0j1ku.fsf@Llea.celt.neu> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: Recovering data from a newfs filesystem 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: Sun, 20 Jan 2008 10:20:15 -0000 "Kelly Jones" writes: > Months ago, I got a new USB drive for my Mac OS X, did "newfs > /dev/disk1" on it, and it's been working fine. > > I then foolishly did "disklabel -create /dev/disk1", which broke > it. How can I recover my data? I've tried fsck w/ alternate > superblocks to no avail. Create a disk image with dd(1), connect the image to a md device with mdconfig(8) and run a disk image analysis tool on it, like testdisk (available from the ports). If testdisk manages to recover disk structure and you're happy with it, you can use the corrected image back to the USB drive with dd(1). Creating the disk image is optional, but since you'll allow testdisk to modifiy the data it works on, it's bet to do a copy. You may want to test integrity of the image with sha256(1) and/or md5(1), before running disk analysis software on it. Notes: 1/I do not know if mdconfig(8) is available for OS-X, although something is likely to provide the same functionality; 2/On Mac OS-X you may use PKGSRC (see NetBSD website) or Fink to install disk analysis software. --=20 Best wishes, Micha=EBl