From owner-freebsd-questions Sat Apr 21 19:54: 1 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 5A7B637B423 for ; Sat, 21 Apr 2001 19:53:58 -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 f3M2rvR07354 for ; Sat, 21 Apr 2001 21:53:57 -0500 (CDT) (envelope-from hetzels@westbend.net) Message-ID: <01cc01c0cad7$3c5d49e0$11f66ad8@westbend.net> From: "Scot W. Hetzel" To: References: <987884078.3ae1ea2ed7c17@webmail.neomedia.it> Subject: Re: Restore Partition table Date: Sat, 21 Apr 2001 21:52:13 -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 > > I accidentally wiped out the partition table on my system while trying to > > partition a new disk. > > > How can I recover the data from this drive? > 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) Was the drive (daY) setup as "Dangerously Dedicated"? 2. Using sysinstall, fdisk and Label the spare drive (daX) with the same configuration as the drive (daY) you are restoring NOTE: When specifying the mount points for the spare drive (daX) use /, /mnt/usr, & /mnt/var. Then change the / mount point to /mnt ( This is to assign / to daXs1a). 3. Use dd to create a back up MBR for daX & daY: dd if=/dev/daY of=mbr-daY bs=512 count=1 dd if=/dev/daX of=mbr-daX bs=512 count=1 4. Use fdisk on daX to destroy the MBR (as a test) and then restore the MBR: fdisk -I daX dd if=mbr-daX of=/dev/daX bs=512 count=1 5. Check that /, /usr, & /var can be mounted from daX, and then unmount them. 6. Put daX's MBR on the drive to be restored (daY). dd if=mbr-daX of=/dev/daY bs=512 count=1 7. Check that /, /usr, & /var can be mounted from daY, and then unmount them. NOTE: If this doesn't work, then restore daY's MBR and try another way to restore the drive (try sysutils/gpart). Scot To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message