RAID1 and grub - again

Darshaka Pathirana dpat at syn-net.org
Thu Jan 28 19:28:39 CET 2010


Hi!

On 01/22/2010 06:59 PM, Waldemar Brodkorb wrote:
> Darshaka Pathirana wrote,
>
>> examples provided by "fai-doc".
>>
>> And I also just tried "GRUB_PC" which failed to install a working boot
>> menu. (I have to admit: I am completely new to grub-pc and never used
>> it before so it may need aditional tweaking.)
>
> Do you have the logfile for the failed grub call?
> May be you could add set -x into scripts/GRUB_PC/10-setup.
> Can you post your /boot/grub/grub.cfg from the failed target system?
>
> Grub2 works fine on RAID1 systems, so may be there need to be
> some finetuning in the grub calls.

Ok. I finally had time to test a bit further and the problem has been that
grub-mkconfig is not available (anymore). Instead there is again a
"update-grub" which has to be called before the menu is created.

Still grub-pc is not installed on the second hard-disk with the given
script. "md0" seems to work neither. Which actually is obvious as md0
is only a combination of sda1 and sdb1. But we need sda and sdb!

So my proposed patch looks like the following (don't forget to wait
until both disks are in sync before pulling out sda ;)):


diff -r 282adc0454ed class/50-host-classes
--- a/class/50-host-classes     Mon Jan 25 12:38:32 2010 +0100
+++ b/class/50-host-classes     Thu Jan 28 18:27:11 2010 +0100
@@ -29,5 +29,5 @@
        echo "FAIBASE DHCPC" ;;
 esac
 
-(ifclass I386 || ifclass AMD64) && echo GRUB 
+(ifclass I386 || ifclass AMD64) && [ ! ifclass GRUB_PC ] && echo GRUB 
 exit 0
diff -r 282adc0454ed scripts/GRUB_PC/10-setup
--- a/scripts/GRUB_PC/10-setup  Mon Jan 25 12:38:32 2010 +0100
+++ b/scripts/GRUB_PC/10-setup  Thu Jan 28 18:27:11 2010 +0100
@@ -3,7 +3,11 @@
 error=0 ; trap "error=$((error|1))" ERR
 
 $ROOTCMD grub-mkdevicemap -n -m /boot/grub/device.map
-$ROOTCMD grub-mkconfig -o /boot/grub/grub.cfg
-$ROOTCMD grub-install --no-floppy "(hd0)"
+$ROOTCMD update-grub 
+
+for device in $(echo $BOOT_DEVICE); do
+       GROOT=$(device2grub $device)
+       $ROOTCMD grub-install --no-floppy "$GROOT"
+done
 
 exit $error

Works for me for RAID and non-RAID configuration. Hope it helps
somebody.

Greetings,
 - Darsha



More information about the linux-fai mailing list