public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Boldi <a1426z@gawab.com>
To: linux-raid@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFH] Partition table recovery
Date: Fri, 20 Jul 2007 14:29:34 +0300	[thread overview]
Message-ID: <200707201429.34419.a1426z@gawab.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0707200858030.31013@fbirervta.pbzchgretzou.qr>

Jan Engelhardt wrote:
> On Jul 20 2007 07:35, Willy Tarreau wrote:
> >On Fri, Jul 20, 2007 at 08:13:03AM +0300, Al Boldi wrote:
> >> As always, a good friend of mine managed to scratch my partion table by
> >> cat'ing /dev/full into /dev/sda.  I was able to push him out of the
> >> way, but at least the first 100MB are gone.  I can probably live
> >> without the first partion, but there are many partitions after that,
> >> which I hope should easily be recoverable.
>
> Go use GPT, it's got a backup copy of the ptable at then end of the disk
> ;-)

Would that be compatible with md?

> >> I tried parted, but it's not working out for me.  Does anybody know of
> >> a simple partition recovery tool, that would just scan the disk for
> >> lost partions?
> >
> >The best one is simply "fdisk", because you can manually enter your
> >cylinders numbers. You have to find by hand the beginning of each
> > partition, and for this, you have to remember what filesystems you used
> > and see how to identify them (using a magic). Then with an hex editor,
> > you scan the disk to find such entries and note the possible sectors on
> > a paper. Then comes fdisk. You create the part, exit and try to mount
> > it. If it fails, fdisk again and try other values.
>
> Pretty easy:
> "XFSB" (offset +0),
> "ReIsErFs2" (offset +0x10034),
> "SWAPSPACE2" (offset +0xff6),
> "FAT32" (offset +0x52h, maybe harder) / "mkdofs" (+0x3)
> ext2/3 is TOUGH. (sequence 0x53ef at +0x438 - quite ambiguous!)

Actually, there is an easier way to do this with cfdisk.  Once you know where 
a partition starts, enter it into cfdisk and set the size to something 
short, then save and restart cfdisk. If the position is correct, then cfdisk 
will identify the fs type.  Now exit again and do an fsck, which will error 
out complaining about a dev-size/fs-size mismatch.  Adjust the cfdisk 
partition accordingly, and cycle through the rest of the partitions.

But, I want something much more automated.  And the partition table backup 
per partition entry isn't really a bad idea.


Thanks!

--
Al


  reply	other threads:[~2007-07-20 11:37 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20  5:13 [RFH] Partion table recovery Al Boldi
2007-07-20  5:20 ` Dave Young
2007-07-20  5:57   ` Dave Young
2007-07-20 11:29   ` [RFH] Partition " Al Boldi
2007-07-20  5:25 ` [RFH] Partion " James Lamanna
2007-07-20  7:00   ` Jan-Benedict Glaw
2007-07-20 11:29   ` [RFH] Partition " Al Boldi
2007-07-20 11:53     ` Anton Altaparmakov
2007-07-20  5:35 ` [RFH] Partion " Willy Tarreau
2007-07-20  5:44   ` Dave Young
2007-07-20  7:03   ` Jan Engelhardt
2007-07-20 11:29     ` Al Boldi [this message]
2007-07-20 11:39       ` [RFH] Partition " Jan-Benedict Glaw
2007-07-20 12:22         ` Al Boldi
2007-07-20 12:29           ` Rene Herman
2007-07-20 16:06           ` Theodore Tso
2007-07-21 17:54             ` Rene Herman
     [not found]               ` <20070722011141.GJ26752@thunk.org>
2007-07-22  4:10                 ` Al Boldi
2007-07-22 16:28                   ` Theodore Tso
2007-07-22 19:05                     ` Al Boldi
2007-07-22 21:23                     ` Indan Zupancic
2007-07-23  8:15                     ` Rene Herman
2007-07-23  8:41                       ` Jan-Benedict Glaw
2007-07-23 10:54                         ` Rene Herman
2007-07-23 12:39                           ` Rene Herman
2007-07-23 13:15                             ` Jan-Benedict Glaw
2007-07-23 13:32                               ` Rene Herman
2007-07-23 20:22                           ` Bill Davidsen
2007-07-23 13:58                       ` Theodore Tso
2007-07-24  4:08                         ` Rene Herman
2007-07-22  9:11                 ` Rene Herman
     [not found]                   ` <20070722163934.GB20174@thunk.org>
     [not found]                     ` <46A45A01.5050709@gmail.com>
2007-07-23 13:48                       ` Theodore Tso
2007-07-24  3:41                         ` Rene Herman
2007-07-20  6:47 ` [RFH] Partion " Jeffrey V. Merkey
2007-07-20 11:29   ` [RFH] Partition " Al Boldi
2007-07-20  7:35 ` [RFH] Partion " Anton Altaparmakov
2007-07-21 19:40   ` Willy Tarreau
2007-07-23 20:08 ` Bill Davidsen
2007-07-24  3:45   ` Rene Herman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200707201429.34419.a1426z@gawab.com \
    --to=a1426z@gawab.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox