Bug#426341: grub-pc: failure to read one device in a RAID-1 array causes boot failure

Sam Morris sam at robots.org.uk
Mon Feb 4 09:47:55 UTC 2008


On Sun, 2008-02-03 at 21:10 +0100, Robert Millan wrote:
> On Mon, May 28, 2007 at 03:42:51AM +0100, Sam Morris wrote:
> > 
> > /boot is on the RAID array (md0), made up of (hd1,2) and (hd3,2). grub
> > cannot read the RAID superblock from the end of (hd3,2) because the
> > end of the partition is past the area addressable by LBA-28, and the controller
> > to which it is attached does not support LBA-48 addressing.
> > 
> > Grub should ignore the failure if it can read at least one member of a
> > raid1 array, and if the array is clean (can grub determine this?).
> > 
> > A partial patch was suggested which solves the issue for now:
> > 
> > Index: disk/raid.c
> > ===================================================================
> > RCS file: /cvsroot/grub/grub2/disk/raid.c,v
> > retrieving revision 1.3
> > diff -u -p -r1.3 raid.c
> > - --- disk/raid.c	17 May 2007 23:23:03 -0000	1.3
> > +++ disk/raid.c	21 May 2007 13:10:25 -0000
> > @@ -344,7 +344,10 @@ grub_raid_scan_device (const char *name)
> >    err = grub_disk_read (disk, sector, 0, GRUB_RAID_SB_BYTES, (char *) &sb);
> >    grub_disk_close (disk);
> >    if (err)
> > - -    return 0;
> > +    {
> > +      grub_errno = GRUB_ERR_NONE;
> > +      return 0;
> > +    }
> >  
> >    /* Look whether there is a RAID superblock. */
> >    if (sb.md_magic != GRUB_RAID_SB_MAGIC)
> 
> Looking at the patch, I can't make much sense of it.  You say RAID probing
> should ignore failiures, and continue with the goal of reading at least one
> member of the array.  That sounds fine, but it looks to me that it is what
> GRUB is already doing!  When you return 0 from grub_raid_scan_device() hook,
> grub_device_iterate will continue running the hook for every remaining
> device.  Only when you return 1 from the hook, the iteration is interrupted.
> 
> So what is wrong exactly?

Is it possible that grub_device_iterate was checking errno after calling
grub_raid_scan_device, and that is what was preventing it from
continuing? Or perhaps what you describe is the current behaviour, which
is different to how grub2 reacted when I first tried to use it. Anyway,
I'll install grub-pc and see what happens when I try to boot from it.

-- 
Sam Morris
http://robots.org.uk/

PGP key id 1024D/5EA01078
3412 EA18 1277 354B 991B  C869 B219 7FDB 5EA0 1078
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20080204/7245e555/attachment.pgp 


More information about the Pkg-grub-devel mailing list