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]
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.
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 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.
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.)