Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Apr 2001 21:52:13 -0500
From:      "Scot W. Hetzel" <hetzels@westbend.net>
To:        <freebsd-questions@freebsd.org>
Subject:   Re: Restore Partition table
Message-ID:  <01cc01c0cad7$3c5d49e0$11f66ad8@westbend.net>
References:  <987884078.3ae1ea2ed7c17@webmail.neomedia.it>

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01cc01c0cad7$3c5d49e0$11f66ad8>