[Bug 1487365] Comment bridged from LTC Bugzilla

bugproxy bugproxy at us.ibm.com
Tue Sep 8 22:20:48 UTC 2015


------- Comment From mauricfo at br.ibm.com 2015-09-08 22:10 EDT-------
It seems grub2 doesn't support RAID arrays of this sort (which it handles as 'diskfilter'), at least not for writing (which is required by grub-install).

It fails here, in grub-install.c:

if (write_to_disk (ins_dev, imgfile))
grub_util_error ("%s", _("failed to copy Grub to the PReP partition"));

write_to_disk() fails in

err = grub_disk_write (dev->disk, 0, 0,
core_size, core_img);

grub_disk_write() fails in

if ((disk->dev->write) (disk, transform_sector (disk, sector),
n, buf) != GRUB_ERR_NONE)
goto finish;

and disk->dev->write() fails in

return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"diskfilter writes are not supported");

That is also present upstream:
http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/disk/diskfilter.c#n908

That module (diskfilter.c) states in its heading:

/* diskfilter.c - module to read RAID arrays.  */

So, to /read/ RAID arrays.. not /write/.

Here's a gdb session with a unstripped binary that I took from the
package build and put in the installer's /target/usr/sbin/grub-install:

The pkg build path / binary  (not stripped)
# file obj/grub-ieee1275/grub-install
obj/grub-ieee1275/grub-install: ELF 64-bit LSB  executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=1b326c701ee38d75d8e8739062a79046eb5ddfad, not stripped

The gdb session:

# gdb
...
(gdb) file /usr/sbin/grub-install
Reading symbols from /usr/sbin/grub-install...done.
(gdb) b grub_disk_write
Breakpoint 1 at 0x1013660c: file ../../grub-core/lib/disk.c, line 61.
(gdb) run --force /dev/md0p1
Starting program: /usr/sbin/grub-install --force /dev/md0p1
...
Installing for powerpc-ieee1275 platform.
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found

Breakpoint 1, grub_disk_write (disk=0x101e4a30, sector=0, offset=0,
size=96212, buf=0x10d99960) at ../../grub-core/lib/disk.c:61

(gdb) b transform_sector
Breakpoint 2 at 0x10134b00: transform_sector. (2 locations)
(gdb) c
Continuing.

Breakpoint 2, transform_sector (disk=0x101e4a30, sector=34)
at ../../grub-core/lib/../kern/disk_common.c:45
(gdb) s
46      in ../../grub-core/lib/../kern/disk_common.c

(gdb) s
grub_diskfilter_write (disk=0x101e4a30, sector=34, size=187,
buf=0x10d99960 "\177ELF\001\002\001")
at ../../grub-core/disk/diskfilter.c:821

(gdb) s
grub_error (n=GRUB_ERR_NOT_IMPLEMENTED_YET,
fmt=0x10194d10 "diskfilter writes are not supported")
at ../../grub-core/kern/err.c:41

(gdb) fin
Run till exit from #0  grub_error (n=GRUB_ERR_NOT_IMPLEMENTED_YET,
fmt=0x10194d10 "diskfilter writes are not supported")
at ../../grub-core/kern/err.c:41
0x0000000010159ffc in grub_diskfilter_write (disk=0x101e4a30, sector=34,
size=187, buf=0x10d99960 "\177ELF\001\002\001")
at ../../grub-core/disk/diskfilter.c:821

Value returned is $1 = GRUB_ERR_NOT_IMPLEMENTED_YET

(gdb) s
823     in ../../grub-core/disk/diskfilter.c
(gdb) s
grub_disk_write (disk=0x101e4a30, sector=34, offset=0, size=96212,
buf=0x10d99960) at ../../grub-core/lib/disk.c:135
(gdb) s
150     in ../../grub-core/lib/disk.c

(gdb) fin
Run till exit from #0  grub_disk_write (disk=0x101e4a30, sector=34, offset=0,
size=96212, buf=0x10d99960) at ../../grub-core/lib/disk.c:150
0x0000000010004c60 in write_to_disk (dev=0x10355fd0,
fn=0x101e80b0 "/boot/grub/powerpc-ieee1275/core.elf")
at ../../util/grub-install.c:704
Value returned is $2 = GRUB_ERR_NOT_IMPLEMENTED_YET

(gdb) fin
Run till exit from #0  0x0000000010004c60 in write_to_disk (dev=0x10355fd0,
fn=0x101e80b0 "/boot/grub/powerpc-ieee1275/core.elf")
at ../../util/grub-install.c:704
0x0000000010008684 in main (argc=3, argv=0x3ffffffffbd8)
at ../../util/grub-install.c:1824
1824    in ../../util/grub-install.c
Value returned is $3 = GRUB_ERR_NOT_IMPLEMENTED_YET

(gdb) s
1825    in ../../util/grub-install.c
(gdb) s
_ (str=0x10169f70 "failed to copy Grub to the PReP partition")
at ../../include/grub/i18n.h:56

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to debian-installer in Ubuntu.
https://bugs.launchpad.net/bugs/1487365

Title:
  Ubuntu14.04 .3 RAID installation fails on firestone

Status in debian-installer package in Ubuntu:
  New

Bug description:
  Problem Description
  =======================
  Installation goes smoothly, until it reaches grub installation, and fails with fatal error there.
   
  Machine Type = pio-firestone 
   
  ---boot type---
  QEMU direct boot kernel/initrd
   
  ---Kernel cmdline used to launch install---
  kexec -l /root/vmlinux.venkat -i /root/initrd.gz.venkat
  kexec -e

  == Comment: # - Venkat R. B <venkatb3 at in.ibm.com> - 2015-08-14 08:08:41 ==
  I am trying to install Ubuntu14.04 on the firestone machine on a RAID1 array, configured with software raid.
  Installation goes on smoothly till its reaches grub loader and fails. Below I have pasted the error.

               ?? [!!] Install the GRUB boot loader on a hard disk ??
    ????????????                                                    ? ?????????
    ?          ?        Unable to install GRUB in /dev/md0p1        ?         ?
    ?          ? Executing 'grub-install /dev/md0p1' failed.        ?         ?
    ?          ?                                                    ?         ?
    ? Running "? This is a fatal error.                             ?         ?
    ?          ?                                                    ?         ?
    ????????????     <Go Back>                       <Continue>     ? ?????????
               ?                                                    ?
               ??????????????????????????????????????????????????????

  == Comment: # - Mauricio Faria De Oliveira <mauricfo at br.ibm.com> - 2015-08-20 09:31:11 ==
  grub-installer pieces from syslog

  Aug 19 11:07:43 grub-installer: info: Installing grub on '/dev/md0p1'
  Aug 19 11:07:43 grub-installer: info: grub-install does not support --no-floppy
  Aug 19 11:07:43 grub-installer: info: Running chroot /target grub-install  --force "/dev/md0p1"
  Aug 19 11:07:43 grub-installer: Installing for powerpc-ieee1275 platform.
  Aug 19 11:08:01 grub-installer: grub-install: error: failed to copy Grub to the PReP partition.
  Aug 19 11:08:01 grub-installer: error: Running 'grub-install  --force "/dev/md0p1"' failed.

  and the "error:" message 'failed to copy Grub to the PReP partition.'
  is not generated by the grub-installer script itself [1], so probably
  coming down from grub2.

  I'd suggest to either involve our grub2 guy (not sure if available),
  or mirroring to Canonical.


  [1] http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/grub-
  installer/trusty-updates/view/head:/grub-installer

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1487365/+subscriptions



More information about the foundations-bugs mailing list