From owner-freebsd-hackers@FreeBSD.ORG Sun Sep 11 10:34:28 2005 Return-Path: X-Original-To: hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A195516A41F for ; Sun, 11 Sep 2005 10:34:28 +0000 (GMT) (envelope-from andreas@klemm.apsfilter.org) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id E709143D45 for ; Sun, 11 Sep 2005 10:34:27 +0000 (GMT) (envelope-from andreas@klemm.apsfilter.org) Received: from srv1.cosmo-project.de (localhost [IPv6:::1]) by srv1.cosmo-project.de (8.12.10/8.12.10) with ESMTP id j8BAYQBS065431 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 11 Sep 2005 12:34:26 +0200 (CEST) (envelope-from andreas@klemm.apsfilter.org) Received: (from uucp@localhost) by srv1.cosmo-project.de (8.12.10/8.12.10/Submit) with UUCP id j8BAYQDD065430 for hackers@FreeBSD.org; Sun, 11 Sep 2005 12:34:26 +0200 (CEST) (envelope-from andreas@klemm.apsfilter.org) Received: from titan.klemm.apsfilter.org (localhost [127.0.0.1]) by klemm.apsfilter.org (8.13.3/8.13.1) with ESMTP id j8BAYAW8009559 for ; Sun, 11 Sep 2005 12:34:10 +0200 (CEST) (envelope-from andreas@titan.klemm.apsfilter.org) Received: (from andreas@localhost) by titan.klemm.apsfilter.org (8.13.3/8.13.1/Submit) id j8BAYARg009558 for hackers@FreeBSD.org; Sun, 11 Sep 2005 12:34:10 +0200 (CEST) (envelope-from andreas) Date: Sun, 11 Sep 2005 12:34:10 +0200 From: Andreas Klemm To: hackers@FreeBSD.org Message-ID: <20050911103410.GA9536@titan.klemm.apsfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 5.4-STABLE X-Disclaimer: A free society is one where it is safe to be unpopular User-Agent: Mutt/1.5.9i X-Mailman-Approved-At: Sun, 11 Sep 2005 11:46:40 +0000 Cc: Subject: need hints to recover lost FreeBSD partition entries in MBR ... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2005 10:34:28 -0000 I unluckily lost the partition table of my 1st disc in a 2 disc system. Tip: avoid gag boot manager and don't do my mistakes ... Having a printout of the df command I was able to re-create all of my fat32 partitions on disc XP boot and 4x FAT32 in an extended part. Now I'm looking for suggestions how to be able to compute the correct values for Slice 3 and 4 which I could not recover so far. It irritates me a bit, that the slices 1+2 already work so well, so theoretically mounting of at least slice 3 should be possible now. Or are there some sanity checks in the kernel that only allows creating the devices in devfs if the size entries in the disklabel and the entry in the partition table of the MBR fit both ?? Maybe I'm only off-by 1 or 2 cylinders in the partition table. Do you know a tool or a method how I can compute/find the start cylinder of FreeBSD partitions ? Perhaps Im already at the right start cylinder and now only have to de-chiffre the entries of the BSD disklabel, which should be in the 1st sector of sector 312581808 ??? This I was able to restore, which works well. Disk name: ad4 FDISK Partition Editor DISK Geometry: 19457 cyls/255 heads/63 sectors = 312576705 sectors (152625MB) Offset Size(ST) End Name PType Desc Subtype Flags 0 63 62 - 12 unused 0 63 24579387 24579449 ad4s1 7 fat 11 24579450 174080340 198659789 ad4s2 4 extended DOS 5 198659790 113922018 312581807 - 12 unused 0 I only had this data available to compute the rest... Filesystem 1k-blocks Used Avail Capacity Mounted on /dev/ad4s3d 8119448 4 7469890 0% /test /dev/ad4s4d 46026106 24134198 18209820 57% /data This resulted in that partitioning, which unluckily doesnt work. Disk name: ad4 FDISK Partition Editor DISK Geometry: 19457 cyls/255 heads/63 sectors = 312576705 sectors (152625MB) Offset Size(ST) End Name PType Desc Subtype Flags 0 63 62 - 12 unused 0 63 24579387 24579449 ad4s1 7 fat 11 24579450 174080340 198659789 ad4s2 4 extended DOS 5 198659790 17077095 215736884 ad4s3 8 freebsd 165 215736885 96839820 312576704 ad4s4 8 freebsd 165 312576705 5103 312581807 - 12 unused 0 In devfs I only see the devices rw-r----- 1 root operator 4, 17 11 Sep 09:56 ad4s3 crw-r----- 1 root operator 4, 27 11 Sep 09:56 ad4s3c crw-r----- 1 root operator 4, 18 11 Sep 09:56 ad4s4 crw-r----- 1 root operator 4, 28 11 Sep 09:56 ad4s4c But not ad4s3d and ad4s4d which would indicate I got the partition table entries for Slice 3+4 right. Andreas /// -- Andreas Klemm - Powered by FreeBSD 5.4 Need a magic printfilter today ? -> http://www.apsfilter.org/