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

Robert Millan rmh at aybabtu.com
Sun Feb 3 20:10:54 UTC 2008


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?

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)





More information about the Pkg-grub-devel mailing list