Re: grub-install fails on software RAID

2013-11-15 Diskussionsfäden Thomas Lange
> On Wed, 30 Oct 2013 13:42:29 +0100, Markus Koeberl 
>  said:

> I have scripts/GRUB_PC/20-raid in my config space with:
Thanks Markus,
it's a great idea to parse mdstat for getting the list of disks. I
modified your code and now I use this for installing grub onto all
disks. I just used this for a RAID1 on 4 disks. Works perfectly.
This is what I now added to GRUB_PC/10-setup:


# check if mdadm has been forgotten
if [ -f /proc/mdstat -a ! -d $target/etc/mdadm ]; then
echo WARNING: Found Software RAID, but mdadm was not installed
fi

# Check if RAID is used for the boot device
if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
raiddev=${BOOT_DEVICE#/dev/}
# install grub on all members of RAID
for device in `perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; 
s/\d+\[\d+\]//g; print }' /proc/mdstat`; do
echo Install grub on /dev/$device
$ROOTCMD grub-install --no-floppy "/dev/$device"
done
fi

-- 
regards Thomas


Re: grub-install fails on software RAID

2013-11-15 Diskussionsfäden Thomas Lange
> On Wed, 30 Oct 2013 13:25:59 +0100 (CET), "o...@v-brinkmann.de" 
>  said:

> /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.
Check if you have installed the mdadm package onto your install
client. When I forget this I also get the error message about
"Auto-detection of a filesystem"

I have to use (hd0) or similar when calling grub-install.
-- 
regards Thomas