grub-install fails on software RAID
Markus Koeberl
markus.koeberl at tugraz.at
Wed Oct 30 13:42:29 CET 2013
On Wednesday 30 October 2013 13:25:59 ol at v-brinkmann.de wrote:
> Thomas Lange <lange at informatik.uni-koeln.de> hat am 29. Oktober 2013 um
22:07 geschrieben:
> > > < GROOT=$(echo $GROOT | sed 's:md/:md:g')
> >
> > I've just read the git log. This minor patch is not needed any more in
> > wheezy. That's why these lines were removed on Sep 8th. I guess you
> > still have them in your script.
>
> Yes, they are still there. But I don't think they do any harm, as the
> result of the call
>
> $ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE
>
> is "(md0)". It's
>
> $ROOTCMD grub-install --no-floppy "(md0)"
>
> that leads to
>
> /usr/sbin/grub-probe: Fehler: no such disk.
> Auto-detection of a filesystem of /dev/md0 failed.
>
> The same error occurs if I replace "(md0)" with "(hd0)" or "(hd1)", the
> only entries in /target/boot/grub/device.map.
>
> > If you use dracut instead of initramfs-tools you have to add rd.auto
> > to the kernel command line, otherwise no RAID devices will be
> > activated by dracut.
>
> I did so, but that didn't improve the situation.
>
> Olav
I have scripts/GRUB_PC/20-raid in my config space with:
# if raid.
if [ $(echo $BOOT_DEVICE | grep "/dev/md" >/dev/null; echo $?) == 0 ]; then
raiddev=${BOOT_DEVICE#/dev/}
#get all member disks
for device in `perl -pe 'if(/^'$raiddev'(.*)/){ if(/raid\d+\s(.*)/){
$var=$1; $var =~ s/\d+\[\d+\]//g; print "$var\n"; } }; $_="";' /proc/mdstat`;
do
#install on all member disks
$ROOTCMD grub-install --no-floppy "/dev/$device"
done
fi
--
Markus Koeberl
Graz University of Technology
Signal Processing and Speech Communication Laboratory
E-mail: markus.koeberl at tugraz.at
More information about the linux-fai
mailing list