grub2 error detecting Fedora"initrd"

Bug #420900 reported by vmc
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
os-prober (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

update-grub found Fedora partition ok:
Found linux image: /boot/vmlinuz-2.6.31-8-generic
Found initrd image: /boot/initrd.img-2.6.31-8-generic
Found Microsoft Windows XP Professional on /dev/sda1
Found Fedora release 11 (Leonidas) on /dev/sda10
Found Fedora release 11 (Leonidas) on /dev/sda8
Found Ubuntu 9.04 (9.04) on /dev/sda9
done

It just failed to add the "initrd" part:
...
menuentry "Fedora release 11 (Leonidas) (on /dev/sda8)" {
 insmod ext2
 set root=(hd0,8)
 search --no-floppy --fs-uuid --set 5dbd9c5c-b1de-489a-a3da-6c3d7fe3ddd3
 linux /boot/vmlinuz-2.6.29.6-217.2.8.fc11.i686.PAE root=/dev/sda8
}
...

It should have recorded this below the kernel:
 initrd /boot/initrd-2.6.29.6-217.2.8.fc11.i686.PAE.img

Related branches

Revision history for this message
Nicola Ferralis (feranick) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at https://wiki.ubuntu.com/Bugs/FindRightPackage. I have classified this bug as a bug in grub2.

affects: ubuntu → grub2 (Ubuntu)
Revision history for this message
Felix Zielcke (fzielcke) wrote :

This is more a bug in os-prober
/etc/grub.d/30_os-prober gets the initrd from it and then just put it in grub.cfg

affects: grub2 (Ubuntu) → os-prober (Ubuntu)
Revision history for this message
useResa (rdrijsen) wrote :

The same issue happens to me with the detection of CentOS.

The grub.cfg reads:
menuentry "CentOS release 5.3 (Final) (on /dev/sda6)" {
 insmod ext2
 set root=(hd0,6)
 search --no-floppy --fs-uuid --set 4870fcd7-5b5b-4276-97ee-a8134dd68e2a
 linux /boot/vmlinuz-2.6.18-128.7.1.el5 root=/dev/sda6
}

While it should contain the following:
menuentry "CentOS release 5.3 (Final) (on /dev/sda6)" {
 insmod ext2
 set root=(hd0,6)
 search --no-floppy --fs-uuid --set 4870fcd7-5b5b-4276-97ee-a8134dd68e2a
 linux /boot/vmlinuz-2.6.18-128.7.1.el5 root=/dev/hda6
 initrd /boot/initrd-2.6.18-128.7.1.el5.img
}

Additionally (although I am not sure if I should issue a separate bug for this) I have to alter (as shown above) root=/dev/sda6 into root=/dev/hda6 in order for CentOS to boot.

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 420900] Re: grub2 error detecting Fedora"initrd"

I'm not sure if there's much we can do about the hda6 vs. sda6 thing -
this is entirely dependent on the exact configuration of kernel being
booted and it's entirely possible for it to switch back and forth even
within a single release of a single distribution at times. :-(

I'd like to fix the initrd detection, though. What boot loader does
CentOS (or Fedora, as in the original report) use? Could you please
attach its configuration file (probably /boot/grub/menu.lst) in its
entirety?

 status incomplete

Changed in os-prober (Ubuntu):
status: New → Incomplete
Revision history for this message
useResa (rdrijsen) wrote :

Thanks for the feedback on the hda/sda item. Understandable.
And not a too big issue once you know how to fix it ;-)

Before Karmic I used to install CentOS with GRUB (1.5 IIRC) and use the chainloader.
However ... since Karmic I have install the additional distributions that I have (currently Dreamlinux 3.5 and CentOS 5.3) without a boot loader at all and made use of the update-grub command only.
So unfortunately I can not provide you with a /boot/grub/menu.lst file since it is simply not there.

If you really need this file to fix this bug, I could install CentOS in a VM and make use of the menu.lst that is created there. Will that be of any help?

Revision history for this message
pegasus (wit000) wrote :

Not sure if this bug has expired. I am having the same problem.

I have ubuntu 9.10 with grub2 installed. I later installed fedora 12 on another partition without boot loader (thus, no menu.lst to attach).
When I run update-grub from ubuntu, the created entry for fedora has no initrd, as below:

menuentry "Fedora release 12 (Constantine) (on /dev/sda10)" {
 insmod ext2
 set root=(hd0,9)
 search --no-floppy --fs-uuid --set 18a8fb38-70c6-4d7e-9c3a-737e98c472a8
 linux /vmlinuz-2.6.31.9-174.fc12.i686.PAE root=/dev/sda10
}

I had to do the custom menu, under 40_custom, in order to be able to boot fedora. Here is my 40_custom:

menuentry "Fedora 12" {
 set root=(hd0,9)
 set gfxpayload=1024x768x16,1024x768
 linux /vmlinuz-2.6.31.9-174.fc12.i686.PAE root=/dev/sda10
 initrd /initramfs-2.6.31.9-174.fc12.i686.PAE.img
}

Revision history for this message
pegasus (wit000) wrote :

I suspect the problem is in /usr/lib/linux-boot-probes/mounted/90fallback

   initrdname=$(echo "$kernfile" | sed "s/vmlinu[zx]/initrd\*/")
   foundinitrd=0
   for initrd in $(eval ls $initrdname 2>/dev/null); do
    if [ -f "$initrd" ] && [ ! -L "$initrd" ]; then
     initrd=$(echo "$initrd" | sed "s!^$mpoint!!")
     result "$partition:$kernbootpart::$kernbasefile:$initrd:root=$mappedpartition"
     exitcode=0
     foundinitrd=1
    fi
   done
   if [ "$foundinitrd" = 0 ]; then
    result "$partition:$kernbootpart::$kernbasefile::root=$mappedpartition"
    exitcode=0
   fi

If I understand correctly, the script only looks for the name initrdxxxx, while fedora calls it initramfsxxx.img. (What is "\*" in the first line for ?)
There may still be something wrong in the next few lines. I have tried changing "initrd\*" to "initramfs", still could not find the file. Yes, I know it is not a good idea to hard code the file name, just trying to locate the problem.

Revision history for this message
pegasus (wit000) wrote :

Ok, I made it work by changing the line :

   initrdname=$(echo "$kernfile" | sed "s/vmlinu[zx]/initrd\*/")

to

   initrdname="$(echo "$kernfile" | sed "s/vmlinu[zx]/init\*/").img"

With this change, the script is now looking for the file name init*[kernel version].img, instead of initrd[kernel version].

It works for now, but still not perfect for generic use. I have to use " .img " instead of " .* " because some kernel version numbers have an extra ".PAE" in them. Using " .* " has caused multiple matches.

I am looking for a way to have the script matching either ".img" or ".gz" without adding any "if", so the script can be for generic use, not specific to fedora.

Colin Watson (cjwatson)
Changed in os-prober (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package os-prober - 1.39

---------------
os-prober (1.39) unstable; urgency=low

  [ Joey Hess ]
  * Fix FreeDOS test to use case-insensative filename lookup
    as was already done for all other DOS/Windows tests. Closes: #582257
    (Thanks, Harald Dunkel)

  [ Colin Watson ]
  * Handle Dracut-generated initramfs names in linux-boot-prober fallback
    test (thanks, Piscium; LP: #420900).
 -- Colin Watson <email address hidden> Mon, 28 Jun 2010 18:09:00 +0100

Changed in os-prober (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Anand Kumria (wildfire) wrote :

StabeUpdateRequest for Ubuntu 10.04 LTS.

IMPACT: As additional distributions switch to generating their initrd using dracut, grub2 will become unable to boot them.

FIXED: The bug has been fixed upstream in os-prober version 1.39 (included in Ubuntu 10.10)

As the bug has been fixed in a newer version of os-prober in a released version of ubuntu, a rebuild of os-prober 1.39 for Ubuntu 10.04 should enable access to dracut-style initramfs.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers