GRUB2 not detecting Ubuntu

I have Ubuntu 12.04.1 LTS and OpenSUSE 12.2. I was using GRUB2 v 2.00 as my default bootloader. In Ubuntu, there were some updates and my GRUB switched to 1.99 (the Ubuntu GRUB). So, in OpenSUSE I reinstalled GRUB using

grub2-install /dev/sda

.

Now, in the boot screen, GRUB displays only OpenSUSE and not Ubuntu.

grub2-mkconfig -o /boot/grub2/grub.cfg

gives this output:

Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.4.11-2.16-default
Found initrd image: /boot/initrd-3.4.11-2.16-default
  No volume groups found
done

Please help me restore Ubuntu, keeping GRUB 2 v 2.00.
[RIGHT]Thanx…[/RIGHT]

os-prober is using syslog to log messages during execution. Please paste relevant part of /var/log/messages created during grub2-mkconfig execution.

I ran mkconfig command again after mounting the Ubuntu partition and it solved my problem, most probably. Anyway, thanx…

Doing so, you just overwrote Ubuntu’s Grub, which is installed in MBR by default.

Well, you can not have both in MBR. You have to decide which one you want to see at boot. Then you would install this one in MBR and the other one in its root partition. The command is grub2-install under openSUSE and grub-install under Ubuntu. To install the boot loader to a partition boot sector, you have to use the option --force. Example (just an example!):

# sudo /usr/sbin/grub-install --force /dev/sda5 

Once you have installed the boot loader, you can refresh the menu with update-grub under Ubuntu oder grub2-mkconfig - as you already know - under openSUSE.

Alternately, you can also use updategrub from my repo, which works on both systems (to use it on Ubuntu, make sure that you copy the script updateGrub2 and not “updategrub”, which is just a symlink).

I would expect os-prober to work also for partitions that are not mounted (it mounts them as needed). Anyway, if you care enough and can reproduce it, bug report would be helpful.

I actually have a bug report about it. It mostly affected Ubuntu 11.10 - seemed better with 12.04 - and more rarely other systems. For some reason I couldn’t explain, os-prober would fail to mount Ubuntu’s partition read only (it always mounts partitions read only). They are different workarounds:

  • mounting Ubuntu’s partition (os-prober will detect it after this, even if you unmount it, because the next time it will succeed mounting it)
  • reboot/shutdown Ubuntu (so that the file systems will get mounted/unmounted), then boot openSUSE and try os-prober
  • I also tried to hack os-prober in different ways with more or less success on this issue.

https://bugzilla.novell.com/show_bug.cgi?id=767272

Yes, mounting Ubuntu’s partition did solve my problem. But, I did not have to mount Ubuntu while installing GRUB2 a month back. Might be some update is causing the problem. Thanx…

I get the same with Fedora, have to mount Fedora / for os-prober to pick it up

I occasionnaly did with Fedora too. If you mount and unmount Fedora, than run os-prober again it might work, meaning that os-prober will be able to mount it next time. It looks like some foreign system’s root partition - whether Fedora or Ubuntu, or openSUSE the other way around - was not cleanly umounted as that system was shut down, but from the os-prober point of view only (because fsck shows no error otherwise). It’s very tricky and believe me, I have spent a lot of time trying to solve or get around this problem in the past year or two.

If you still have this issue, please add a comment to my bug report. I have been feeling quite lonely there, and Michael already suggested to close the bug report, also the problem is not solved AFAIK.

I get the same problem

on my pc I had

windoxs xp
opensuse 12.2
xubuntu 12.04

and 2 month ago I installed , Kubuntu 12.10 grub in the root not in the mbr reserved for suse 12.2

I reboot , with grub customizer i modified the menu and it had lines for kubuntu
I reboot , and finished and updated kubuntu

after 1 or 2 weeks , aftrer updating I repeated with opensuse grub-customizer and I lost the line with Kbuntu

strange but real after some week I Repeated Grubcustomizer and found Kubuntu 12.10

I make a lot of experiences whitout good results

yesterday I read this forum

and

In opensuse as root (superuser , with dolphin I mounted sda7 where wee find root of kubuntu )

and repeat os-prober and grub-customizer

and good result

This morning

new update of kubuntu ( important)
reboot return on kubuntu , rebbot and return to suse

before anything os-prober dont find kubuntu
afert mounting sda7 (kubuntu) os-prober andgruncustomizer find kunbuntu !!!

excuse me for my bad english ( I am french)

I return

[QUOTE=5933pierre;2533705

before anything os-prober dont find kubuntu
afert mounting sda7 (kubuntu) os-prober andgruncustomizer find kunbuntu !!!

excuse me for my bad english ( I am french)

I return[/QUOTE]

So, you have fixed your problem, right? If so, congratulations. If not, specify your problem.

Thanx…

Sorry to resurrect but I too have this problem. I have
Windows 7
OpenSuse 12.3
OpenSuse 13.1 (testing)
Ubuntu studio installed.

OpenSuse 12.3 provides GRUB2 and is main O/S so if I update kernel on other Linux I need to reconfigure GRUB from that O/S.

If Ubuntu is not mounted then it gets missed from GRUB2. If I mount it, in any form then it’s spotted and added as expected.

At some point I’ll upgrade the 12.3 to 13.1 and 13.1 will be “free” to install later OpenSuse for testing.

(Now to fix the Windows MBR on the first disk so that if GRUB breaks on the second I can reboot to Windows, or if patching Window with all it’s many reboots I change boot order to ease that task.)