[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: issue with mdadm and mirroring drives



18/01/2012 17:23, Joey L wrote:
> I have a raid 1 mdadm setup.
> I have devices sda and sdb with 2 partitions on each - sda1 and sda2
> on the other drive i have sdb1 and sdb2.
> 
> Partition sda1 is the root partition and sda2 is the swap partition.
> 
> My sda failed yesterday and now i am running in sdb only.
> 
> When i put the drive sda into the system to add it back to the md0 -
> the system keeps booting from it and refuses to boot from the good sdb
> drive.
> 
> What can i do to stop this from happening - I have no other system to
> plug this drive into to zero out the drive.
> 
> Also if I am able to get over this issue - do i have to do other
> procedures to this drive? what are they ??? I think i have to do the
> following:
> 
> mdadm --manage /dev/md0 --remove /dev/sdb1
> 
> mdadm --manage /dev/md0 --fail /dev/sdb1
> 
> sfdisk -d /dev/sda | sfdisk /dev/sdb
> 
> mdadm --manage /dev/md0 --add /dev/sdb1
> 
> 
> I am thinking that I need to do something with grub or do some kind of
> update so the server can boot of the good drive that I have working
> now - but do not know what it is.
> 
> thanks
> mjh
> 
> 

Hi, when you manage to boot with the faulty drive in, just "--fail",
"--remove" and "--zero-superblock", then "--add" it again. Off course if
the drive is damaged or faulty at a low level it may not come up or
won't survive the rebuild...

If you can work around the boot issue, maybe you can physically change
the way the disk "sdb" is plugged-in, and use the slot previously used
by "sda". This can usually be achieved in bios too by changing in the
disk ordering.

As an alternate, you could try booting on a rescue live-cd first, then
start your degraded raid, chroot to the system to get the faulty drive
back in the raid and start the rebuild, even reinstall grub from the
chroot, then reboot in the original system.

Once you are done it's a good idea to reinstall grub on both drives.


Reply to: