0

Possible Duplicate:
Ubuntu does not put Fedora into GRUB menu

I have Windows XP Installed, and i have installed Fedora 15, yesterday. Updated it today to 17, and installed Ubuntu. After installing ubuntu, it messed up the grub. Grub wont find fedora anymore. I have tried booting from the Live CD, and installing Boot-Repair. It find a Raid unit, asks for mdadm. Tried with mdadm, and withoud dmraid. No progress. When i go to my files, in the live cd, the fedora unit shows up. What have i done wrong? haha I think, it's something about this raid unit.

ghaschel
  • 105

1 Answers1

1

Check if the os-prober package is installed in Ubuntu with dpkg -l os-prober.

If it isn't installed, then:

sudo apt-get install os-prober
sudo update-grub

BTW, Ubuntu 12.04 does some horrible things to the grub menu with /etc/default/grub. You might want to edit it to comment out these lines:

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true

and add these in their place:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
GRUB_TIMEOUT=5

This will stop the grub menu from being hidden at boot and will make whatever you choose from the menu be the next default. It also allows grub-set-default and grub-reboot to work (they don't when GRUB_DEFAULT is hard-coded to 0).

Don't forget to run sudo update-grub after editing it, and then sudo grub-set-default 0 to make sure it has a sane default.

Also, if you don't like the submenu that it hides old kernels with, then patch /etc/grub.d/10_linux like this:

--- 10_linux.orig       2012-05-17 07:07:17.000000000 +0000
+++ 10_linux    2012-08-27 03:46:54.803088897 +0000
@@ -254,12 +254,12 @@

   list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`

-  if [ "$list" ] && ! $in_submenu; then
-    echo "submenu \"Previous Linux versions\" {"
-    in_submenu=:
-  fi
 done

-if $in_submenu; then
-  echo "}"
-fi

and, again, run sudo update-grub.

cas
  • 161
  • I already have os-prober instlled. I've made everything you told me, and another thing i read in a forum. I've added this:
    #!/bin/sh
    cat << \EOF
    menuentry "Fedora" {
        set root=(hd0,3)
        chainloader +1
    }
    EOF
    
    

    to /etc/grub.d/17_fedora and now, it shows up on grub. My fedora partition is on /dev/sda3, as lmv2 file system.

    –  Sep 15 '12 at 00:13
  • All i get in the grub menu, is error: invalid signature I have read somewhere, that Grub don`t allow you to add fedora to its menus, because of the Raid partition, and what must be done, is linking Grub with the fedora default's grub. Can someone please help me? :P –  Sep 15 '12 at 00:14
  • grub's disk and partition numbering is zero-based, so (hd0,3) refers to /dev/sda4, not /dev/sda3. Try (hd0,2) instead. – cas Sep 15 '12 at 00:19
  • Nope, it still shows: error: invalid signature –  Sep 15 '12 at 00:27
  • before restarting, i updated grub –  Sep 15 '12 at 00:28
  • Is the grub boot loader installed on /dev/sda3? try file -s /dev/sda3 - if the output mentions a filesystem rather than a grub or an x86 boot sector then it isn't installed. If grub isnt installed on /dev/sda3, you have two choices: 1. chroot into your fedora partition from a rescue CD and run grub-install /dev/sda3, or 2. edit your /etc/grub.d/17_fedora to specify the exact filenames (relative to /dev/sda3 as root dir) of the kernel and initrd. I would have thought that os-prober would do that - you don't have GRUB_DISABLE_OS_PROBER=true in your /etc/default/grub, do you? – cas Sep 15 '12 at 00:55
  • I just found this: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685159 - known bug in recent versions os-prober. A workaround to get os-prober to recognise fedora is to mount the fedora partition in ubuntu first, and then run update-grub. e.g. (as root) mkdir /fedora ; mount /dev/sda3 /fedora. since your fedora partition is lvm2, it'll be a little more complicated than that - i.e. install lvm2 on ubuntu and configured it. – cas Sep 15 '12 at 01:27
  • I figured it out yesterday. Installed lmv2, (i wasn't able to mount without it). After mounting, i updated grub again, and it worked. Thank you. – ghaschel Sep 15 '12 at 14:13