From owner-freebsd-stable@FreeBSD.ORG Thu Feb 7 08:30:52 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91DB016A41B for ; Thu, 7 Feb 2008 08:30:52 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0B62E13C44B for ; Thu, 7 Feb 2008 08:30:51 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so961548nfb.33 for ; Thu, 07 Feb 2008 00:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=rHBp4lyK1h+h1GbbhmMs6aHFyJQHJLjGl1vmRxzoUyQ=; b=mSpbKmV2xB5O5CLFO2OLTG9wwT4zBvgXQxpH8o0WwgmEWKkcopNbA1QI2pXm25ru9uXX68OHEpUzbQnNzT+n0lTrBQGfICuK2gIDkB9WITJQ9a/Ay11JPSQXn1UgYZzIGJhoEGNFToj0k7mw42YWKhxUuijis7TtPCmDH2MnGrg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KaE1AOd+zOnoOSkzZqi29RRTI2tA83lMWYoR2SIXKU8WMz+TMh0ATtwvBy0TFz4zPXB3hyMRsgoZ9bSONlg8oJexOJn0AzlaAgVFTmEFHWt13kc4U4NPrpM9Dri+XOAAroRzGMeSxQAj+kxZGsudsWkOA2xd7OlAUVOsoshw+UM= Received: by 10.78.176.20 with SMTP id y20mr5815921hue.36.1202373050368; Thu, 07 Feb 2008 00:30:50 -0800 (PST) Received: by 10.78.173.4 with HTTP; Thu, 7 Feb 2008 00:30:45 -0800 (PST) Message-ID: <7ad7ddd90802070030h3b42296et60d1e12f9d93d65f@mail.gmail.com> Date: Thu, 7 Feb 2008 09:30:45 +0100 From: "Ulrich Spoerlein" To: "Torfinn Ingolfsen" In-Reply-To: <20080207010502.3f96fd3f.torfinn.ingolfsen@broadpark.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7ad7ddd90802061204p35d0368ekbb54149287618f6a@mail.gmail.com> <20080207010502.3f96fd3f.torfinn.ingolfsen@broadpark.no> Cc: freebsd-stable@freebsd.org Subject: Re: Reconstruct disklabel for UFS and GELI volumes X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2008 08:30:52 -0000 On Feb 7, 2008 1:05 AM, Torfinn Ingolfsen wrote: > Ulrich Spoerlein wrote: > > There were three labels > Actually, it is one label per slice, unless you are doing something > unusual? s/labels/partitions/ , that's what I meant. > > - ad0s4a: UFS, exact size unknown. Is it possible to infer this from > > the UFS partition size? I can mount this already, as I simply wrote an > > 'a' label of maximum size to the disklabel > > - ad0s4b: GELI encrypted swap > > - ad0s4d: GELI encrypted ZVOL > > FWIW, I have had success with scan_ffs[1] as documented in this short > article[2]. It will recover lost labels, or at least try to. > If you are downloading binary packages from somewhere, be sure to > double check that you get the one that fits your platform (i386 / amd64 > or whatever) and version. > Take it slowly, and double check all steps before comitting anything. I already made some progress. The GEOM classes place a label into the last sector (GEOM::GELI) in my case, so I could use this string to scan the whole slice overnight. Sadly, the geli swap partition has no such signature, only the geli ad0s4d partition has one. However, using geli dump I can get the original partition size. I now only have to adjust the offset/length in the bsdlabel and figure out the original size for ad0s4a (which I guess was 512MB). I should have this back running quickly, once I get home to the machine. Thanks for all the suggestions so far. Since I can't install any packages (I'm using the 6.2 fixit cd), how can I calculate the file system size from the ffsinfo output? Uli