From owner-freebsd-questions@FreeBSD.ORG Mon Jan 26 09:49:06 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6426F16A4CE for ; Mon, 26 Jan 2004 09:49:06 -0800 (PST) Received: from fuego.fadesa.es (fuego.fadesa.es [195.55.55.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id A20D843D2F for ; Mon, 26 Jan 2004 09:48:51 -0800 (PST) (envelope-from freebsd4@fadesa.es) Received: (from root@localhost) by fuego.fadesa.es (8.9.3p2/8.8.8) id SAA12753 for ; Mon, 26 Jan 2004 18:49:51 +0100 Received: from tierra.fadesa.es(195.55.55.7) by fuego.fadesa.es Mon, 26 Jan 04 18:49:38 +0100 Received: from fadesa.es (filemon.fadesa.es [195.55.55.6] (may be forged)) by tierra.fadesa.es (8.9.3p2/8.8.8) with ESMTP id SAA25582; Mon, 26 Jan 2004 18:48:26 +0100 Sender: fan@fadesa.es Message-ID: <401552EA.E425C019@fadesa.es> Date: Mon, 26 Jan 2004 18:48:26 +0100 From: "=?iso-8859-15?Q?Jos=E9?= M. =?iso-8859-15?Q?Fandi=F1o?=" Organization: Inmobiliaria FADESA X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.24 i686) X-Accept-Language: gl, en, es MIME-Version: 1.0 To: freebsd4@fadesa.es, freebsd-questions@freebsd.org References: <401436B3.E910623B@fadesa.es> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Logged: Logged by tierra.fadesa.es as SAA25582 at Mon Jan 26 18:48:26 2004 Subject: Re: recovering partitions (not slices), is it possible? (Solution) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2004 17:49:06 -0000 Hello again, I was able to recover all deleted partitions :) I found this program http://ls.si.ru/freebsd/find-super-blocks.c it provides me sufficient information for recreating both partitions. =46rom another FreeBSD machine it was as easy as: prue5# ./find-super-blocks /dev/ad2s2 FS_MAGIC at sector 16: / -> 204800 sectors. bsize: 16384 FS_MAGIC at sector 409616: /var -> 196608 sectors. bsize: 16384 with this output we can give the appropriated value to disklabel and redefine the boundary between the root and var partitions. 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 409600 0 4.2BSD 0 0 0 # (Cyl. 0 - 43= 3*) c: 803250 0 unused 0 0 # (Cyl. 0 - 84= 9) e: 393650 409600 4.2BSD 0 0 0 # (Cyl. 433*- 84= 9*) prue5# fsck -f /dev/ad2s2a ** /dev/ad2s2a ** Last Mounted on /mnt ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 2420 files, 22779 used, 77980 free (820 frags, 9645 blocks, 0.8% fragment= ation)=11 prue5# fsck -f /dev/ad2s2e ** /dev/ad2s2e ** Last Mounted on /data2 ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 1188 files, 53963 used, 43548 free (1020 frags, 5316 blocks, 1.0% fragmen= tation) regards. "Jos=E9 M. Fandi=F1o" wrote: > = > Hello, > = > I was trying to install FreeBSD 5.2 in the slice ad0s3 but > accidentally I erased two partitions of my 4.9 system which > were in the ad0s2 slice :( > = > ad0s1 -> Linux boot > ad0s2 -> FreeBSD 4.9 (deleted partitions) > ad0s3 -> FreeBSD 5.2 > ad0s4 -> Extended partition > = > they were the root and var partitions (usr and home were > in different disks). > strings /dev/ad2s2c | grep "/dev/ad0s2.*ufs" > /dev/ad0s2e /var ufs rw,noatime,nosuid = 0 1 > /dev/ad0s2a / ufs rw 1 = 1 > = > As the disk hasn't been reformatted or written over all the > data is still here. > = > I haven't got luck googling, so I would like to ask for > advises. Perhaps searching some type of signature helps > to find the deleted partitions. > = > thanks you. > = > # fdisk ad2 > ******* Working on device /dev/ad2 ******* > parameters extracted from in-core disklabel are: > cylinders=3D8912 heads=3D15 sectors/track=3D63 (945 blks/cyl) > = > Figures below won't work with BIOS for partitions not in cyl 1 > parameters to be used for BIOS calculations are: > cylinders=3D8912 heads=3D15 sectors/track=3D63 (945 blks/cyl) > = > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 131 (0x83),(Linux native) > start 63, size 16002 (7 Meg), flag 80 (active) > beg: cyl 0/ head 1/ sector 1; > end: cyl 16/ head 14/ sector 63 > The data for partition 2 is: > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 16065, size 803250 (392 Meg), flag 0 > beg: cyl 17/ head 0/ sector 1; > end: cyl 866/ head 14/ sector 63 > The data for partition 3 is: > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 819315, size 2634660 (1286 Meg), flag 0 > beg: cyl 867/ head 0/ sector 1; > end: cyl 1023/ head 14/ sector 63 > The data for partition 4 is: > sysid 5 (0x05),(Extended DOS) > start 3453975, size 4964085 (2423 Meg), flag 0 > beg: cyl 1023/ head 14/ sector 63; > end: cyl 1023/ head 14/ sector 63 > = > # disklabel ad2s2 > # /dev/ad2s2: > 8 partitions: > # size offset fstype [fsize bsize bps/cpg] > c: 803250 0 unused 0 0 # "raw" part, d= on't edit > = > -- > -----BEGIN GEEK CODE BLOCK----- > Version: 3.1 > GCS/IT d- s+:+() a- C+++ UBL+++$ P+ L+++ E--- W++ N+ o++ K- w--- > O+ M+ V- PS+ PE+ Y++ PGP+>+++ t+ 5 X+$ R- tv-- b+++ DI D++>+++ > G++ e- h+(++) !r !z > ------END GEEK CODE BLOCK------ > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd= =2Eorg" -- = -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/IT d- s+:+() a- C+++ UBL+++$ P+ L+++ E--- W++ N+ o++ K- w--- O+ M+ V- PS+ PE+ Y++ PGP+>+++ t+ 5 X+$ R- tv-- b+++ DI D++>+++ G++ e- h+(++) !r !z ------END GEEK CODE BLOCK------