[TriLUG] Lost Partition Table!
Sat, 8 Sep 2001 20:34:20 -0400 (EDT)
On Sat, 8 Sep 2001, Sinner from the Prairy wrote:
> I have recently lost the partition table on my primary disk. My fault. It
> has ext2, ReiserFS and LinuxSwap partitions. There are primary and logical
> partitions on the disk. Now I'm running from a second disk.
> No, I have no copy of the partition table (I had it, but I changed the
> aprtitions because I was geting read errors -bad sectors? - so I moved data
> around, emptied partiitiosn, created new partitions... and the partition
> table was lost in the process.
> I've tried gparted and rescuept . So far, no luck. Any other utility around?
many years ago, a company in calgary running sco unix asked if i could
solve the same problem and, sure enough, there was a simple fix.
i wrote a short (<1 page) C program that opened the device file for
the hard drive, and read 1K blocks, looking for a pattern that
appeared to be unique to the beginning of the sco unix superblock.
compiled the program, linked it statically, copied it to a sco
unix boot disk, took it to the client, booted from the disk,
ran the program and, to the astonishment of everyone there (including
me), it nailed every filesystem on the disk at exactly the right
offset. it was a simple matter to use fdisk to rebuild the table.
i've never tried this under linux, and it's undoubtedly more
complicated since you're trying to locate ext2 and reiserfs
filesystems, as well as swap. maybe i'll take some time and
see if i can re-create the program from memory to work with
linux. it's really as simple as it sounds.