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 May 28 02:42:51 UTC 2007


Package: grub-pc
Version: 1.95+20070520-1
Severity: normal
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Further to
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=423022;msg=131>:

/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)
============================================================

- -- Package-specific info:

*********************** BEGIN /proc/mounts
rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec 0 0
none /proc proc rw,nosuid,nodev,noexec 0 0
udev /dev tmpfs rw 0 0
/dev/md0 / ext3 rw,data=ordered 0 0
/dev/md0 /dev/.static/dev ext3 rw,data=ordered 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/device.map
(hd0)	/dev/hda
(hd1)	/dev/hdb
(hd2)	/dev/hde
(hd3)	/dev/hdg
*********************** END /boot/grub/device.map

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automaticaly generated by /usr/sbin/update-grub using templates from /etc/grub.d
# and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set default=0
set timeout=5
set root=(md0)

#font (md0)/usr/share/grub/unifont.pff
#set gfxmode=640x480
#insmod gfxterm
#insmod vbe
#terminal gfxterm
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_hurd ###
### END /etc/grub.d/10_hurd ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, linux 2.6.18-4-k7" {
	linux	(md0)/boot/vmlinuz-2.6.18-4-k7 root=/dev/md0 ro vga=0x318
	initrd	(md0)/boot/initrd.img-2.6.18-4-k7
}
menuentry "Debian GNU/Linux, linux 2.6.18-4-k7 (single-user mode)" {
	linux	(md0)/boot/vmlinuz-2.6.18-4-k7 root=/dev/md0 ro single vga=0x318
	initrd	(md0)/boot/initrd.img-2.6.18-4-k7
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/mbr ###
menuentry "Restart boot sequence" {
	chainloader (hd0)+1
}
### END /etc/grub.d/mbr ###

### BEGIN /etc/grub.d/windows ###
menuentry "Windows XP" {
	chainloader (hd0,1)+1
}
### END /etc/grub.d/windows ###
*********************** END /boot/grub/grub.cfg

- -- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (530, 'testing'), (520, 'unstable'), (510, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-4-k7 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages grub-pc depends on:
ii  libc6                         2.5-9      GNU C Library: Shared libraries
ii  liblzo2-2                     2.02-2     data compression library

grub-pc recommends no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGWkGrshl/216gEHgRAt2aAJ0QhngajZKHRzE4exAz6spiZ+f4FQCfXlB5
oEpwgwmMmuMGy5JUDDpcFz0=
=8V1O
-----END PGP SIGNATURE-----




More information about the Pkg-grub-devel mailing list