LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   ext2 partition screwed up after windows install (https://www.linuxquestions.org/questions/linux-software-2/ext2-partition-screwed-up-after-windows-install-626356/)

stzein 03-07-2008 03:22 AM

ext2 partition screwed up after windows install
 
I just installed windows on a laptop that already had ubuntu running. Here's what I did:
convert ext3 partition to ext2 and resize it so I have 10Gb left for windows. After I did this I tried booting ubuntu, which only worked after a fsck -y on the root partition. At this point I can boot ubuntu and all my files are still present.
Then I boot from windows install cd and install windows in the free space. Windows installs and the computer boots in windows. As expected, grub is nowhere to be found, so I can't boot ubuntu at this point.
Now I boot with an ubuntu livecd, I go into the shell and do sudo grub, where I set "root (hd0,0)". When I try to reboot I get grub, but ubuntu can't mount its root partition, so I boot knoppix again to find the error.

Here's what I found:
Code:

fsck /dev/hda1
...
Group descriptors look bad... trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/hda1
...

Code:

fsck -b 32768 /dev/hda1
same error. I also tried all the other superblocks... all the same error.

Code:

dmesg |tail:
EXT2-fs error (device hda1): ext2_check_descriptors: Inode bitmap for group 384 not in group (block 2147483647)!
EXT2-fs: group descriptors corrupted!

I then made a copy of the partition to an external disk (with dd_rescue), and I tried
Code:

mke2fs -S /dev/hda1
fsck -y /dev/hda1

This made the partition mountable again, but the directory structure is gone. All the files seemed to be present in "lost and found" in numbered directories, but the filenames were all wrong, so it's not very useful.
I then put back the backed up partition and did some more searching around the internet, but without good effect.


Any filesystem experts around who know what might have happened to my partition, and what I can do about it?

Unknown_User 03-07-2008 12:03 PM

I'm not an expert here (so just throwin' up thoughts until the cavalry arrives) but I have had a smiliar experience with an old RH box.

Could the windows installation be somewhat of a coincidence and you have experienced a drive failure? Losing all the super-blocks (which happened to me) is unusual.

I'm sure that you know that using mke2fs will recreate your filestructure and move anything that it can't allocate to the lost and found folders.

Have you tried using Helix to look at your drive? If you have never used it, it is a suite of forensic tools on a bootable Knoppix based disk that has saved me on a myriad of occasions.

Good luck!

CrashedAgain 03-08-2008 09:12 AM

After you converted ext3 to ext2 to resize it, did you convert it back to ext3 again? Ext2 is not a very reliable filesystem...I have had experiences where it could not cope with something as simple as partition 100% full.

Fsck reports it is "trying" backup blocks. You could try them manually...."mke2fs -n /dev/hda1" will report where the backup blocks are located.

jiml8 03-08-2008 11:08 AM

what is the output of fdisk -l ?


All times are GMT -5. The time now is 03:39 AM.