Re: [RFH] Partion table recovery




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 ;-)


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!)


I've saved many disks that way, it may sound harder than it really is. It
should not take you more than half an hour to get the first part. Knowing
your approximate partitions size will help too.


Good luck!
Willy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


Jan
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Got two copies of WinXP on my computer.
    ... fdisk, and it does not seem as daunting as it did half an hour ago. ... I read that it should work with a Win95B disk, ... delete all the partitions, it is a quick and easy way to do it. ... the computer with a Windows 98 boot disk and use fdisk to remove all the ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: howmany partitions per disk possible?
    ... Windows's fdisk continually spits out dire warnings, ... disk till you engage the magic "w" function. ... Given my partitions were peculiar anyway (one ... extended containing two logicals, no primaries at all), it ...
    (Ubuntu)
  • Re: Partition program "parted" PROBLEM!
    ... And with "parted" I recreated a disk from the free space. ... Now "fdisk -l" output: ... > and the logical partitions within. ... > sectors as units in fdisk, and remake the logical partitions using the ...
    (comp.os.linux.setup)
  • Re: Partition 1 does not end on cylinder boundary
    ... That's how FDISK displays non-FAT *PRIMARY* partitions. ... dozen or so non-FAT logical partitions that are on the disk. ... FDISK, though, seems to display non-FAT logical partitions. ...
    (comp.os.linux.setup)
  • Re: Bret!! (zbret9!!!) Please read...
    ... Download a boot disk that includes fdisk or make ... Place the floppy disk in your A drive and boot. ... >>was to use the FDISK utility to delete the partitions. ...
    (microsoft.public.windowsxp.general)