From owner-freebsd-questions@FreeBSD.ORG Sun Dec 16 15:50:46 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 466CB16A41A for ; Sun, 16 Dec 2007 15:50:46 +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 CD3E013C442 for ; Sun, 16 Dec 2007 15:50:45 +0000 (UTC) (envelope-from nikola.lecic@anthesphoria.net) X-Bogosity: No, tests=bogofilter X-DKIM: Sendmail DKIM Filter v2.3.2 anthesphoria.net lBGFoc3Z098732 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=anthesphoria.net; s=phero; t=1197820246; bh=YRPrW0D7rxaxiWqSs/LsdHBcj9NnxxqGnkmALr++9 Uo=; l=3626; 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=pC7yn8laYTr nCgMf6v6FKa7JYls/3ua8p7oAkQMfWgy5Htvj5GPjQ8nc3ujxR5qpD9bwwMso1J4PR1 MeuI3ovdzuiibtUH4jybyHeOjZUX/2vgHpFbVazpvFURVRRfvgS4541yX/FqsBtulak apsin7LdvTWHDGjFazisMt82Sg= Received: from anthesphoria.net (adsl-202-214.eunet.yu [213.198.202.214]) (authenticated bits=0) by anthesphoria.net (8.14.1/8.14.1) with ESMTP id lBGFoc3Z098732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Dec 2007 16:50:41 +0100 (CET) (envelope-from nikola.lecic@anthesphoria.net) Date: Sun, 16 Dec 2007 16:51:27 +0100 From: Nikola =?UTF-8?B?TGXEjWnEhw==?= To: "Snow Mountains" Message-ID: <20071216165127.64661122@anthesphoria.net> In-Reply-To: <3cf9f8920712132115q341401dbhec96ca1ae3156432@mail.gmail.com> References: <3cf9f8920712132115q341401dbhec96ca1ae3156432@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: Sun, 16 Dec 2007 15:50:46 -0000 Hello, On Fri, 14 Dec 2007 05:15:16 +0000 "Snow Mountains" wrote: =20 > People, I have FreeBSD install on 80G disk that looked like this: >=20 > ad1s1 ~ 2.4G > ad1s2 ~23.0G > ad1s3 ~19.1G > ad1s4 ~38.0G, FreeBSD partition, sliced like this: ^^^^^^^^^ ^^^^^^ (a note: the correct terminology is actually the opposite: these a...e are "partitions", real BSD partitions. What is called "partition" in non-BSD world is a slice here; so: "FreeBSD slice, (BSD-)partitioned/labelled like this...") > ------------------------ > ad1s4a / (507630 1K-blocks) > ad1s4b swap > ad1s4d /var > ad1s4e /tmp > ad1s4f /usr >=20 [...] > However, FreeBSD is now unbootable!!! Then I loaded FreeSBIE (FreeBSD > 6.2 live CD), tried 'boot0cfg -B /dev/ad1' (also with '-d 0x80'), but > no help! Then I realized that ad1s4 slices are lost. This means: >=20 > A) from FreeSBIE, there is only /dev/ad1s4, no a,b,d,e,f. If I do > this: FreeSBIE# mount /dev/ad1s4 /mnt/ufs.4 > this is former / (ad1s4a) and is of its size (~507M). This probably means that you unwillingly changed FreeBSD label of ad1s4 and it's most likely that NetBSD wrote its own instead. However, from the bsdlabel(8) manpage: The various BSDs all use slightly different versions of BSD labels and are not generally compatible. So, NetBSD didn't recognise FreeBSD's labels and understood entire ad1s4 as one partition; however, ad1s4's reality is that it begins with small / (lost ad1s4a) and that is what you see; the rest is just ignored. boot0cfg did nothing because NetBSD obviously deleted ad1s4 FreeBSD's bootstrap code as well. > I can't reach other slices! However, it gives me hope that NetBSD's > slices are also invisible, although working from within itself: > FreeSBIE# mount /dev/ad1s1 /mnt/ufs.1 > gives also small NetBSD's / (its wd0a), not /usr etc. The same reason as above. > [...] > Please help me to recover my FreeBSD system. If I lost my data (ok, I > understand they are buried, not erased), please tell me that gently. > :-( That's why I think that you haven't lost any data. You must however re-create bsdlabel table on ad1s4. Since you didn't mention that you have a backup of bsdlabel (do you? :-)), you must recover it. There are two small utilities designed for this purpose, dlfind and ffsrescue: http://www.42.org/~sec/resources/disklabel.html http://www.leidinger.net/FreeBSD/ffsrescue.tar.gz but they don't recognise UFS2 beginning marks (only UFS1 ones). However, I tested sysutils/testdisk and it recognised UFS2 labels on my healthy slices perfectly, so there is no reason that it can't help you, since it simply analyses slice contents. This utility is not part of FreeSBIE, but I think that you can just download ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.2-release/sysutil= s/testdisk-6.3.tbz Then untar it in ~freesbie and run the binary. Just do this: ./testdisk /dev/ad1s4 and choose "non partitioned" in the second menu. Please note that testdisk will not recognise your swap. Then please try to compare results (given in 512k-blocks) to what you remember about partition sizes. If it gives you reasonable proportions, then re-creating a bsdlabel shouldn't be a big problem. So please take these actions and if the aforementioned assumptions are correct and you obtain some useful info, we shall continue. :-) --=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