[CentOS] Re: grub/raid1 on centos4

Alex Tkachenko tiahino at gmail.com
Fri Apr 8 05:37:29 UTC 2005


On Tue, 05 Apr 2005 13:15:25 -0500, Les Mikesell <lesmikesell at gmail.com> wrote:
> With Centos3, fedora1/2 I have been able to put /boot on a RAID1
> partition and have it boot normally.  Unlike earlier versions that
> used lilo as the default boot loader, these did not make the 2nd drive
> bootable but at least I was fairly confident that if the first drive
> failed I could use the install CD in rescue mode to fix up the 2nd one
> and go on.   However, Centos4 won't boot at all with a similar install
> attempt and running grub-install in rescue mode gives an error about not
> being able to find the bios drives.  Is there a howto somewhere to work
> around this problem?
This is an infamous grub-on-sw-raid problem. I run this script after
installing the OS on the new system (and after grub upgrades, it used
to fix flipping md5sums in Tripwire reports for me):
#!/bin/sh 
# 
# Update MBR on both mirror drives  
# (grub/swraid has problems updating the slave, # as of RHEL3) 
# Should be run after grub rpm updates as well 
# 
# By Alex Tkachenko <alex at ingrian.com> 

ADMINDIR=/root/admin

BOOT_ARRAY=`df /boot | awk '/dev/{print $1}'`

# Select only active disks (skip spares) 
DISKS=`mdadm --query --detail /dev/md0 | awk '/active sync/{print $7}'| sed ' 
s@/dev/@@g 
s/,/ /g 
s/[0-9]//g 
'`

for d in $DISKS
do

        cat <<EOF | /sbin/grub --batch 
device (hd0) /dev/$d 
root (hd0,0) 
setup (hd0) 
quit 
EOF

        # Save updated mbr 
        dd if=/dev/$d of=$ADMINDIR/mbr.$d count=1
done

Take care,
Alex
> 
> -- 
>   Les Mikesell
>    les at futuresource.com
> 
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
> 
>



More information about the CentOS mailing list