From owner-freebsd-questions@FreeBSD.ORG Wed Dec 19 03:40:05 2007 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 EEB4716A417 for ; Wed, 19 Dec 2007 03:40:04 +0000 (UTC) (envelope-from nikola.lecic@anthesphoria.net) Received: from anthesphoria.net (anthesphoria.net [200.46.204.219]) by mx1.freebsd.org (Postfix) with ESMTP id 9D12313C45D for ; Wed, 19 Dec 2007 03:40:04 +0000 (UTC) (envelope-from nikola.lecic@anthesphoria.net) X-Bogosity: No, tests=bogofilter X-DKIM: Sendmail DKIM Filter v2.3.2 anthesphoria.net lBJ3e0TD078753 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=anthesphoria.net; s=phero; t=1198035605; bh=qhJEGK3ckp816VIsFReZeZ7T5MSkEzM2ZfA91wZue 6o=; l=3665; h=X-Bogosity:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:X-Mailer:X-Face:X-Operating-System: Mime-Version:Content-Type:Content-Transfer-Encoding; b=ikHVB2kT0yf /NSUo3qqQwmBPgQxUQplJko1WjTIgM+PcKW/NNbxB+bHDJ73P3kjil1st50PjPQnVYd ip2MkHJWN1rajmDK1nCKIEA4+0t+nG67WBRquNfrG4nMnG06WSMREIMHNDZxUqtttTM NxkOxu8/nBIT1EHCr8yw/2ED4s= Received: from anthesphoria.net (adsl-217-143.eunet.yu [213.198.217.143]) (authenticated bits=0) by anthesphoria.net (8.14.1/8.14.1) with ESMTP id lBJ3e0TD078753 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Dec 2007 04:40:03 +0100 (CET) (envelope-from nikola.lecic@anthesphoria.net) Date: Wed, 19 Dec 2007 04:39:51 +0100 From: Nikola =?UTF-8?B?TGXEjWnEhw==?= To: "Snow Mountains" Message-ID: <20071219043951.58ee4e50@anthesphoria.net> In-Reply-To: <3cf9f8920712181854p1b498d8cve22e5bcdc0ad9fc7@mail.gmail.com> References: <3cf9f8920712132115q341401dbhec96ca1ae3156432@mail.gmail.com> <20071216165127.64661122@anthesphoria.net> <3cf9f8920712181854p1b498d8cve22e5bcdc0ad9fc7@mail.gmail.com> X-Mailer: Claws Mail 3.1.0 (GTK+ 2.12.1; i386-portbld-freebsd6.2) X-Face: pbl6-.[$G'Fi(Ogs2xlXP-V6{3||$Y[LOYs&~GJoikj'cVjcFC[V7du;;0~6nO= [Vi2?uU1Pq~,=Adj@,T:|"`$AF~il]J.Nz#2pU',Y7.{B;m/?{#sO^Dvo$rnmY6] X-Operating-System: FreeBSD 6.2-RELEASE-p8 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD-questions@FreeBSD.org Subject: Re: Lost FreeBSD slices (labels?) after NetBSD install -- please help!! 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: Wed, 19 Dec 2007 03:40:05 -0000 On Wed, 19 Dec 2007 03:54:00 +0100 "Snow Mountains" wrote: =20 [...] > Hello and thanks veeeery much for this response and because you > pointed me to right direction - what to read! It took me some time to > run this and to understand always what I am doing, but it seems to > work! >=20 > testdisk gives me sizes that 100% correspond with _partition_ (:)) > proportions I remember (and some nonsenses about tiny FAT partition > somewhere...). dlfind homepage was incredibly useful for me as newbie > in creating BSD partition labels, and I created bsdlabel file, > carefully calculated offsets, I am happy that former ad1s4a is > mountable so that I can read /etc/fstab! Excellent! Just note that you don't need to calculate offsets; you can use asterisk (*) for all offsets from b: (swap) onward; and you can use * as the size of the last partition, too. > However I have several questions just to be 100% sure. >=20 > a. swap size: by an accident, I have written swapsize (from swapinfo) > of 1024 1kb blocks; it is slightly different from what I get when I > subtract all partition size from total slice's size (as testdisk > reported). What I should trust? Use the value from swapinfo; swap is just that space (unlike sizes that you see in df(1) output: they are not sizes of partitions). The size of slice: you should anyway _first_ run 'bsdlabel-w /dev/ad1s4' -- it will write initial info and the value for c: will be the value you should use. > b. Do I need just bsdlabel -R -e?=20 You probably typoed, either '-R' or '-e' (=3D 'from file' or 'to edit directly'). However, I believe you should use '-B' as well, because bootstrap code was destroyed too, and you won't be able to boot FreeBSD even with recovered partitions. > Is it safe to experiment? Yes, it is. If you write wrong data, it will just not work. Once you get mountable partitions, please fsck(8) them. > c. What to write as fsize, bsize fsize and bsize are 2048 and 16384 if you used all defaults when installed FreeBSD (read newfs(8)).=20 > and bps/cpg? It is completly confusing for me, bps/cpg explanation > from bsdlabel man page is unclear to me, I see that some people use > all zeros and I can not find a clue in various examples... Hmm, yes... Actually, it seems that they can be calculated by comparing data obtained from 'bsdlabel -A /dev/ad1s4...' (look at the top of the output) and from particular 'newfs -N /dev/ad1s4X' (this command doesn't create new file system but just prints all data about how it would be created) -- but after recovery, of course. Read the entire thread that contains this: http://lists.freebsd.org/pipermail/freebsd-questions/2004-January/031603.= html However, I've never been able to find any info in the docs that exactly explains what algorithm newfs(8) uses for this field... Therefore I believe (although I'm not 100% sure) that the only way to get old bps/cpg data is to=20 (1) dump(8) partitions once they work; (2) "bsdlabel -e" bps/cpg of these partitions to zeros; (3) recreate file systems there (this will write new (true) bps/cpg values); (4) restore(8) filesystems. However, if fsck(8) tells you that filesystems are clear once you recover them, I believe you don't have to worry about this. Maybe some filesystem guru can confirm. (According to this reputable source: http://www.onlamp.com/pub/a/bsd/2002/06/27/Big_Scary_Daemons.html last three values are actually ignored...) --=20 Nikola Le=C4=8Di=C4=87 :: =D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0 =D0=9B=D0=B5= =D1=87=D0=B8=D1=9B