[lug] SW Raid question

Hugh Brown hugh at math.byu.edu
Wed Jul 25 19:14:41 MDT 2007


Hugh Brown wrote:
> 
> On Tue, 24 Jul 2007 dio2002 at indra.com wrote:
> 
>>> So I learned a bit more.  device (hd0) /dev/sdb really seems to mean,
>>> "while in this grub session anytime I say hd0 write it to /dev/sdb
>>> instead of whatever you thought hd0 was before"  So, you both were right.
>>> -----------------------------------
>> yeah.. nice.  i really appreciate you walking through those tests.  it's
>> good to have some verification to what i thought was correct.  now i can
>> feel more comfortable about it moving forward.
>>
>>> Conclusions:  If you set up sw raid outside of the installer, make sure
>>> grub bits get installed to the mbr of all drives used.  If you do set up
>>> your machine with sw raid at install time, the drive will have the right
>>> grub bits.  If a disk fails, as part of adding it back in, make sure you
>>> put the grub bits back.
>> one addition to that.. after install, grub WILL install the PRIMARY
>> install disk correctly.  but i believe you MUST still manually grub the
>> secondary mirror.  install does not do that from what i understand.
>>
>>> I have no idea what is going on at those three offsets.
>> me either.. and i'm not sure i want to know ;-)
>>
>> thanks for the tests
> 
> 
> I think there is more at work than this.  On both disks  the boot
> sector
> was all zeroes where the usual grub bits should have been.  It also booted
> from the secondary mirror after an install (w/o having done the grub>
> setup (hd1)).
> 
> Maybe more testing.
> 
> Hugh
> 


If the horse is dead, let me know, I'll stop beating it.  I booted the 
VM up again just now with both disks attached and got dropped to a grub> 
prompt.

It turns out that /dev/sda got trashed (apparently I didn't add it back 
correctly) and shows up as a brand new disk.  This would seem to 
reproduce the case where the first disk in a mirror fails and is 
replaced with a new disk.  The info about device (hd0) /dev/sdb does 
seem to be internet lore rather than the way everything works.

When booting with a completely new disk, nothing is found.  So to repair 
things, I'd have to boot with rescue media.

If only the partition table is gone but the mbr is intact, you can do 
something similar to this to be able to boot (and then repair /dev/sda)

grub> find /grub/menu.lst
(hd1,0)
grub> cat (hd1,0)/grub/menu.lst
#does what you'd expect, use the output
# to do the next steps

grub> root (hd1,0)
grub> kernel /vmlinuz-2.6.9-42.EL ro root=/dev/VolGroup00/LogVol01
grub> initrd /initrd-2.6.9-42.EL.img
grub> boot


Hugh



More information about the LUG mailing list