RAID1 - fixing a corrupted file system
hi, i've been happily running RAID1 for years on my system.
i have two IDE hard disks each with 4 partitions:
i'm running ubuntu 8.10 and noticed that trackerd was stuck indexing the last directory (approximately 5678/5678). i restarted indexing and it got stuck again. hmmm - now i'm interested. my email client is evolution and that was starting to complain about the database and i lost an email or two. now i'm worried.
a reboot won't harm, i thought. wrong:
same fsck error as above on both. and the -b 8193 option has no effect.
i tried mdadm --zero-superblock /dev/sda3 and rebuilt the array, but all that came back after a disk sync was the corrupted file system error.
my understanding isn't great, but i think the RAID is fine, and it's the file system that's broken. if i could fix /dev/sda3 i'll happily zero sdb3 (dd -if=/dev/zero -of=/dev/sdb3) and then re-assemble the RAID, but i just can't seem to fix sda3.
any suggestions, and am i even going about this the right way?
thanks in advance
oh - here's what dmesg had to say...
first, recover the original borked disk image from another disk back onto the partition that i'd hosed with various attempts at doing stuff i didn't really understand:
$ ddrescue /mnt/home.img /dev/sda3
i'm now back to the point where i my original fsck will have barfed. the superblock that was corrupted lives on the disk in various places, so let's see where...
root@ubuntu:~# mke2fs -n /dev/sda3
mke2fs 1.41.3 (12-Oct-2008)
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
5431296 inodes, 21703815 blocks
1085190 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
663 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000
i then ran through each one in turn looking to see how broken they were (i hit ctrl-C rather than actually do anything):
574 e2fsck -b 32768 /dev/sda3
575 e2fsck -b 98304 /dev/sda3
576 e2fsck -b 163840 /dev/sda3
577 e2fsck -b 229376 /dev/sda3
578 e2fsck -b 294912 /dev/sda3
579 e2fsck -b 819200 /dev/sda3
580 e2fsck -b 884736 /dev/sda3
581 e2fsck -b 1605632 /dev/sda3
582 e2fsck -b 20480000 /dev/sda3
583 e2fsck -b 11239424 /dev/sda3
584 e2fsck -b 7962624 /dev/sda3
585 e2fsck -b 4096000 /dev/sda3
586 e2fsck -b 2654208 /dev/sda3
e2fsck complained more about the contents of some than others. in the end i chose the highest and let it run with -y:
$ e2fsck -b 20480000 -y /dev/sda3
when that finished, i rebuilt the raid (degraded with just the one disk for now), mounted it and i can now see all my files
590 mdadm --assemble /dev/md2 /dev/sda3 --run
591 mount /dev/md2 /home
592 ls -l /home
593 cd /home/pb
Hello, you are still there?
I have almost the same problem but I am a complete noob on linux.
Please can you help me with detailed instructions?
> I have almost the same problem but I am a complete noob on linux.
you're certain you want to restore the superblock from the file system's own backups - it looks as though that's all i did.
all the details are there - i think you just have to work through them.
OK; I would like to leave intact the disks if something goes wrong.
Can you suggest a way to make a full and complete image of a disk?
Working on the image it should be easier.
|All times are GMT -5. The time now is 03:58 AM.|