Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
Last edited by ewolf; 07-20-2008 at 11:02 PM.
1st, have you verified that the synchronization worked, that the RAID is re-built & readable? Can you access your data from a live CD?
checking the status with
showed that the sync had completed, with a 'UU' for all RAID partitions. I did boot up with a live cd, and gparted showed that my partitions were all there on both disks. Would I be able to mount RAID partitions as ext3 without messing up the RAID array?
BTW, what command did you use to "copy the partition table of sdb to sda"? Was it something like:
dd if=/dev/sdb of=/dev/sda size=512 count=1
That would have copied the boot loader code as well as the partition table. Better to have used:
I know what you mean, I've definitely made that mistake in the past, but wasn't sure how to how to use dd for just the partition table or just the mbr. :-)
For the partition table, I used
sfdisk –d /dev/sdb | sfdisk /dev/sda
I will try reinstalling grub on both disks tonight when I get home. Although, I have never reinstalled or switched bootloaders before, I have only done new installations. Are there any pitfalls to reinstalling the bootloader I need to be aware of? Will a simple
do the trick?
Thank you very much.
Last edited by ewolf; 07-21-2008 at 09:24 AM.
Reason: had some more questions