# destroyed my partition table...need help please

## sammy2ooo

Hello everyone

I have just crashed my partition table while playing around with udf packetwriting and dvdram...(I was trying to do a backup...thats morbid, isnt it???)

I have one harddisk (hda) with the following CHS values: CHS 24792,255,63. There are 4 primary partions on that disk. with ext2, swap, xfs and reiserfs filesystems on it. 

I started my computer using knoppix and ran gparted

 *Quote:*   

> #gpart /dev/hda
> 
> Begin scan...
> 
> End scan.
> ...

 

I dont like this results... so i fired up gpart a second time using different parametres and got:

 *Quote:*   

> #gpart -v -E -C 24792,255,63 /dev/hda
> 
> dev(/dev/hda) mss(512) chs(24792,255,63)(LBA) #s(398283480) size(194474mb)
> 
> * Warning: strange partition table magic 0x0000.
> ...

 

At the moment it is still scanning. Partition 4 must be my reiserfs part. Part 3 swap and Par2 ext2. So the biggest and most important partition is part1 because it is holding my data on xfs. Strangely enough it doesnt recognize the partition... 

So what do you guys think about this. Please tell me that there is a way to fix my pTable....

ANY HELP IS GREATLY APPRECIATED

----------

## Rad

Hmm was your data partition the first one, not the last (on the drive)? 'cause the second results suggest partition2 already starts at 63...

Of course, that may just indicate that the results you got from gpart are wrong...

----------

## Jaglover

From Knoppix, testdisk.

----------

## sammy2ooo

 *Rad wrote:*   

> Hmm was your data partition the first one, not the last (on the drive)? 'cause the second results suggest partition2 already starts at 63...

 

yes, that was my first thought too, at the moment i am trying to reconstruct the part table by hand... i will soon post my result... i will run testdisk after gpart has finished... thanks for your help guys i really appreciate it.

----------

## sammy2ooo

is there a way to dump the part table in  hex format?

----------

## sammy2ooo

 *Quote:*   

> 
> 
> prim part (2) 80 01 01 00 83 FE 3F 01 3F 00 00 00 43 7D 00 00
> 
> 80 		bootable
> ...

 

This values are taken from gpart. Can this be used to reconstruct my xfs partition???

----------

## Jaglover

Generally, if something like this happens you restore from backup ... No backup? Then you take an image of damaged disk with dd before you do anything else so you can try different methods. After image is built you run testdisk because this is the specialized tool for restoring partition tables and lost partitions.

----------

## sammy2ooo

this values MUST be wrong, because the part layout was totaly different:

1. part ext2 boot

2. part swap

3. part xfs root

4. part reiserfs portage

a second run with gpart reported the same zero values... at the moment i am trying the -f switch...this will take some time

But isnt there a way to calculate the correct parttable with the information i got at the moment?

----------

## sammy2ooo

Okay, I got my data back... but its strange, very strange... because i didnt change a bit on my harddisk using testdisk or gpart and its working again...

All I did was connecting a second harddisk, and out of nothing knoppix found my partition table... so this leads me to the conclusion that there must be some problem with the mainboard, because all this trouble started while playing around with my dvd-ram player and packet writing... so any hints on this???

----------

## Jaglover

CMOS corruption, not that unusual at all.

----------

## sammy2ooo

so you think that my mainboard is broken, too? Do you think a BIOS upgrade could fix anyting?

If I copy large files it sometimes happens that I am no more able to type anything on console, first I thought that there must be something wrong with my kernel... but know it becomse a huger picture...

----------

## Jaglover

Your hardware setup is kept in CMOS, if it gets corrupted then you zero it, see your motherboard manual how to do it, usually there is a jumper for that. BIOS upgrade may empty the CMOS for you, too.

----------

