Really big mistake -- I need some help

Kirk Bauer (kirk@kaybee.org)
Mon, 14 Jul 1997 03:18:04 -0400 (EDT)


Okay, I managed to write over the first 300-500K of /dev/hda.

Most of this is no big deal -- /dev/hda1 was a non-important
partition, so I don't care about that. I can rerun 'lilo'
to recreate the boot sector. My big problem is the partition
tables. Right now, 'fdisk' thinks there aren't any partitions.

I still have not rebooted. I am trying to find a way to
recreate the partition tables that are on the hard disk so
that everything will be okay again. I can still do a
'df' and it will tell me how much space was on /dev/hda{1,3,5,6,7,9}.
If I take the "Total" column from 'df' and multiply it by
1.0329, that will tell me how many blocks should be displayed
in the 'fdisk' program.

My problem is -- notice that partitions 2 and 8 are not listed
above. The reason is --these are both swap partitions. How
can I find out how big each partition table is?

Better yet -- I have a feeling that the kernel itself has
enough information in internal memory to rebuild the partition
table -- because *every* partition (except, of course, 4) is
mounted right now (the mount was done back when I *did* have
a partition table).

So -- how can I find out how big each of my 2 swaps are

*OR*

How do I pull enough information out from the kernel to
rebuild my partition table?

My plan is -- once I get the partitions in exactly the same places
and exactly the same size, everything will work okay (except for
/dev/hda1). I hope I won't have to run mke2fs and I hope that
fdisk won't mess anything up. Of course, I will also have to
run 'lilo' to fix the boot sector...

Any help on this would be *GREATLY* appreciated as I have to leave
for Europe on Thursday and I will be gone for 2 months and this
system needs to be stable for the entire time!

thanks,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Kirk Bauer -- Georgia Tech -- kirk@kaybee.org <== Finger for PGP
http://www.kaybee.org/~kirk/html ResNet RTA