<div dir="ltr">Another post-script I run checks the status of the MD sync. If the drive isn't synced the boot sectors may not be on all member disks. I have a LAST script that waits for arrays to sync before rebooting (good idea regardless).<div>
<br></div><div>If you have multiple arrays you can loop this. I actually just have it copied a few times for the array names we create.</div><div><br></div><div>LAST/10-mdsync:</div><div><br></div><div><div>if [ -b /dev/md/0 ]; then</div>
<div>while [[ `mdadm --detail /dev/md/0 |grep -i rebuild |wc -l` -ne 0 ]]</div><div>do</div><div> echo "sleeping 30s for resync"</div><div> sleep 30</div><div>done</div><div> echo "Synced, continuing"</div>
<div>else</div><div> echo "No RAID, continuing"</div><div>fi</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 30, 2013 at 7:42 AM, Markus Koeberl <span dir="ltr"><<a href="mailto:markus.koeberl@tugraz.at" target="_blank">markus.koeberl@tugraz.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wednesday 30 October 2013 13:25:59 <a href="mailto:ol@v-brinkmann.de">ol@v-brinkmann.de</a> wrote:<br>
> Thomas Lange <<a href="mailto:lange@informatik.uni-koeln.de">lange@informatik.uni-koeln.de</a>> hat am 29. Oktober 2013 um<br>
22:07 geschrieben:<br>
> > > < GROOT=$(echo $GROOT | sed 's:md/:md:g')<br>
> ><br>
> > I've just read the git log. This minor patch is not needed any more in<br>
> > wheezy. That's why these lines were removed on Sep 8th. I guess you<br>
> > still have them in your script.<br>
><br>
> Yes, they are still there. But I don't think they do any harm, as the<br>
> result of the call<br>
><br>
> $ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE<br>
><br>
> is "(md0)". It's<br>
><br>
> $ROOTCMD grub-install --no-floppy "(md0)"<br>
><br>
> that leads to<br>
><br>
> /usr/sbin/grub-probe: Fehler: no such disk.<br>
> Auto-detection of a filesystem of /dev/md0 failed.<br>
><br>
> The same error occurs if I replace "(md0)" with "(hd0)" or "(hd1)", the<br>
> only entries in /target/boot/grub/device.map.<br>
><br>
> > If you use dracut instead of initramfs-tools you have to add rd.auto<br>
> > to the kernel command line, otherwise no RAID devices will be<br>
> > activated by dracut.<br>
><br>
> I did so, but that didn't improve the situation.<br>
><br>
> Olav<br>
<br>
</div></div>I have scripts/GRUB_PC/20-raid in my config space with:<br>
<br>
# if raid.<br>
if [ $(echo $BOOT_DEVICE | grep "/dev/md" >/dev/null; echo $?) == 0 ]; then<br>
raiddev=${BOOT_DEVICE#/dev/}<br>
#get all member disks<br>
for device in `perl -pe 'if(/^'$raiddev'(.*)/){ if(/raid\d+\s(.*)/){<br>
$var=$1; $var =~ s/\d+\[\d+\]//g; print "$var\n"; } }; $_="";' /proc/mdstat`;<br>
do<br>
#install on all member disks<br>
$ROOTCMD grub-install --no-floppy "/dev/$device"<br>
done<br>
fi<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Markus Koeberl<br>
Graz University of Technology<br>
Signal Processing and Speech Communication Laboratory<br>
E-mail: <a href="mailto:markus.koeberl@tugraz.at">markus.koeberl@tugraz.at</a><br>
</font></span></blockquote></div><br></div>