I was migrating from a /dev/hda and /dev/hdb to a /dev/sda /dev/sdb setup and creating a mirror of the drives in th process with mdadm /softeware raid.

md raid appears to be fine. The issue is with the grub installation portion of this....

I accidentally offset my fs by running a grub-install on the /dev/md2 partition which is my boot partition. I was deep into a torublehshooting process and hit combination on accident >.<

OK so when I try to boot the system I get a message stating that my filesystem is offset by a few hundred blocks, etc. I figured this much as I appended the grub stuff up front.

It drops me to a "Repair Filesystem" prompt and tells me to login to repair the filesystem. I log in and i do an fsck on the / partition and it doesn't do anything. just checks and finds a few problems but no fixes.

OK so i do a mount -n -o remount,rw / and then type init 5. system boots up and MD raid is up and running on the /dev/md{0,1,2} and uses /dev/sd{ab} drives

I do a e2fsck -n /dev/md2 and get about 140,000 lines of correction possibilities:

[root nas2 /]# e2fsck -n /dev/md2
e2fsck 1.39 (29-May-2006)
Warning! /dev/md2 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
The filesystem size (according to the superblock) is 5120718 blocks
The physical size of the device is 5120688 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort? no

/ contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Inode 65830, i_blocks is 16, should be 8. Fix? no

Inode 65831, i_blocks is 16, should be 8. Fix? no

Inode 65874, i_blocks is 16, should be 8. Fix? no
....
....
...140,000 more lines, etc
....
....

Directories count wrong for group #155 (0, counted=1).
Fix? no

Free inodes count wrong (5124459, counted=5070420).
Fix? no


/: ********** WARNING: Filesystem still has errors **********

/: 21/5124480 files (5609.5% non-contiguous), 205010/5120718 blocks
[root nas2 /]#



okkkkk so how did I get 5609% errors?

how to do a e2fsck -y /dev/md2 when the md2 only works when the system is booted.


How to recover from this monstrosity?