LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   partition table broken ? (https://www.linuxquestions.org/questions/linux-hardware-18/partition-table-broken-601679/)

dmedhora 11-22-2007 09:01 AM

partition table broken ?
 
Hi , Please excuse this repost here,
I managed to overwrite the first 512 bytes of my
/dev/sda ( an ide hard disk connected to my laptop
via a usb adapter having only linux partitions )

I think gpart can't do much for logical partitions
SO I used testdisk which works well except I can't
mount my most important 50 G filesystem anymore.
The partition table shows a bit of an overlap
of the 11th and 12th partition ( I may be wrong )
But here is the output:
analyse disk gave me this output

Linux 0 1 1 20317 15 62 20480480 [/opt]
Linux 20318 0 1 30476 15 63 10240272 [/u01]
Linux 30477 0 1 40635 15 63 10240272 [/usr]
Linux 40636 1 1 44699 15 62 4096448 [/var]
Linux 44700 1 1 54387 15 62 9765440
Linux 54388 1 1 56325 15 62 1953440
Linux 56326 1 1 57294 15 62 976688
Linux Swap 57295 1 1 61169 15 46 3905920
Linux 61170 1 1 80545 15 62 19530944
Linux 80546 1 1 99921 15 62 19530944 (Note this ends at 99921)
Linux 99921 15 63 196802 15 54 97656040 (Note this starts at 99921)
Linux 196803 1 1 238215 15 62 41744240 (These 3 lines are the
Linux 196812 1 1 238224 15 62 41744240 same partition really)
Linux 196877 1 1 238289 15 62 41744240

Now, Why does partition 11 start at the SAME place
where partition 10 ends. How do I fix that?
Is that the reason why the filesystem on 12
is "corrupt?" - I get a bad magic number in
superblock when I try to mount it.

Thanks!

bigrigdriver 11-23-2007 08:00 PM

I've only done something like this to myself once. I hope I never do that again. I was resizing some partitions and ended up with overlaps and a system that wouldn't reboot. I did the resizing, and, instead of rebooting to load the new partition table into the running kernel, I started moving some files. That's when the errors about overlapping partitions came up.

Fortunately, I made backups of the partitions I intended to resize before I bagan. So, I was able to delete the partitions, make new ones, boot a livecd, and restore the backups.

I don't know if this will work, but here is my suggestion.

If the first of these is the 50 gig partition
Quote:

Linux 80546 1 1 99921 15 62 19530944 (Note this ends at 99921)
Linux 99921 15 63 196802 15 54 97656040 (Note this starts at 99921)
then edit the second to move the beginning from 99921 to 99922, then boot a livecd and run fsck on the unmounted partitions.

If the second is the 50gig partition, move the end of the first one from 99921 to 99920. Then boot a livecd and run fsck on the unmounted partitions.

Hopefully, you will be able to boot normally after that.

If that doesn't work, I hope you have backups of the two partitions that you can restore after making the corrections to the partition boundaries.

If gparted doesn't work with logical partitions, try cfdisk.

dmedhora 11-26-2007 06:57 AM

Hi you wrote
If the second is the 50gig partition, move the end of the first one from 99921 to 99920. Then boot a livecd and run fsck on the unmounted partitions.
I tried that but fsck then doesn't work saying bad magic number,
I have the same posting here as well with more details, Please see:
http://www.linuxquestions.org/questi...-table-601637/
Thanks!

J.W. 11-26-2007 05:28 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Please continue here


All times are GMT -5. The time now is 10:32 PM.