From owner-freebsd-questions Tue Apr 24 17:45:22 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.westbend.net (ns1.westbend.net [216.106.246.3]) by hub.freebsd.org (Postfix) with ESMTP id D4A9837B422 for ; Tue, 24 Apr 2001 17:45:17 -0700 (PDT) (envelope-from hetzels@westbend.net) Received: from admin (admin0.westbend.net [216.106.246.17]) by mail.westbend.net (8.11.2/8.11.2) with ESMTP id f3P0jAL21384; Tue, 24 Apr 2001 19:45:10 -0500 (CDT) (envelope-from hetzels@westbend.net) Message-ID: <000801c0cd20$ba7744c0$11f66ad8@westbend.net> From: "Scot W. Hetzel" To: "Salvo Bartolotta" Cc: References: <988141611.3ae5d82b2f4ff@webmail.neomedia.it> Subject: Re: Restore Partition table Date: Tue, 24 Apr 2001 19:41:25 -0500 Organization: West Bend Interent MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG From: "Salvo Bartolotta" > > I figured out a way to recover the drive: > > > 1. You will need the following: > > > 1 spare hard drive (daX) (same model and size as the one your restoring > > (daY)) > > Information on the size of each partition (root, swap, var, usr) that > > was on the drive (daY) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > AFAIK, the "highlighted" information on FreeBSD partitions "root", "swap", "var" "usr" > (or MS-DOS "subpartitions" if you like) lives in the FreeBSD slice^H^H^H^Hdisklabel; > the FreeBSD bootstrap & disklabel live at the beginning of the FreeBSD slice, NOT in > the MBR. > > > ---------------------------------------- > MASTER BOOT RECORD: > Boot Code > (MS-DOS) Partition Table (64 bytes; starting at byte 447) > ---------------------------------------- > > > Is a spare identical HD necessary? > I didn't want to risk further damaging the contents of the drive I needed to recover, and felt that it was safer to test things on a spare identical drive. > How about: > > *) backing up the disk MBR to a file (via dd); > *) editing the partition table of the disk via fdisk iff (=if and only if) you have exact > information on the FreeBSD slice in question. > > If you can by no means recover the MS-DOS partition table information, don't edit the > partition table; just try gpart. Despite the warning in its man pages, gpart seems to do > great guesswork^W^W a great job. > I did give gpart a try on another system to see what it would do, but it was taking hours (2+) to analyze the systems 3GB harddrive. In the mean time, I tried restoring the MBR for the system with the damaged MBR as described in previous message, and had the system back on-line with in a few minutes. > > Am I missing something? > I don't think so, it's just that we need either clearer examples on how to r estore the (MS-DOS) Partition Table, or system administrators that pay attention to what device they are fdisking :-). I was lucky in the way I restored my drive, as it only had one partition (Dangerously Dedicated) on it dedicated to FreeBSD . If the drive would of had 2+ partitions, then I would have needed to use gpart to restore the partitions. Scot To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message