RAID1 rebuilt after failure, won't boot OS
Hello,
I recently had a small typo in my 'dd' command's of= parameter, which destroyed the first few kibibytes of data on my software RAID1's first disk, /dev/sda (I'm using mdadm). /dev/sdb, the RAID1's second disk, was unaffected. I figured that I could just manually 'fail' sda to take it out of the array. I would then copy the partition table of sdb to sda, re-add sda to the array, then let sda sync up to sdb. I did this, but after synchronization completed, I tried rebooting from sda (what my system had previously been booting from), but this time the console displayed "Operating System not Installed" or some similar message. I then tried booting from sdb, but that would just hang, with nothing on the console. I had never tried booting from sdb before, so I think it was ver likely that way before my mishap with dd, since I didn't make changes to sdb. Anyways, as far as my logic dictates, this should have worked, with sda booting up flawlessly and everything being back to normal. However, this is obviously not the case. Can anyone think of a step I may have missed? Do I need to reinstall grub on sda? What else could it be? Thanks, Elijah |
1st, have you verified that the synchronization worked, that the RAID is re-built & readable? Can you access your data from a live CD?
If so, then I think you are right -- you need to re-install GRUB. This time put it in the MBR of both drives. BTW, what command did you use to "copy the partition table of sdb to sda"? Was it something like: Code:
dd if=/dev/sdb of=/dev/sda size=512 count=1 Code:
dd if=/dev/sdb of=/dev/sda skip=446 seek=446 size=64 count=1 http://en.wikipedia.org/wiki/Master_boot_record |
Quote:
Code:
cat /proc/mdstat Quote:
For the partition table, I used Code:
sfdisk –d /dev/sdb | sfdisk /dev/sda Code:
grub-install /dev/sdX Thank you very much. |
1) Checking w/ a live CD:
I would think that mounting either disk r/o as ext2/3 couldn't hurt & might give you the verification you need. I was in fact wondering if you could mount & use the array w/ a live CD. 2) Bootloader reinstallation pitfalls: I can't be much help here -- I use the MEPIS System Wizard to re-install GRUB. But if the command you propose would work in a non-RAID environment, it should work here. If you want to dig deeper, post (in a "Code:" block, please) the output of: Code:
fdisk -l 3) Good use of sfisk -d. |
Quote:
mode using an ubuntu livecd. 2) Code:
ubuntu@ubuntu:/mnt3$ sudo fdisk -l /dev/sda partition, sda2 is a swap partition, and sda3 is the root filesystem. I installed grub onto both drives, and am now typing from my RAIDed Debian installation. I tested booting from both drives, and all is well. Thank you very much for your help. |
All times are GMT -5. The time now is 12:42 AM. |