openSuSE Grub2 bootloader stolen by Lubuntu Grub1.99 after install - can't get Grub2 back - plz help

Ok,

So I installed Lubuntu next to openSuSE 13.1.
**Lubuntu replaced openSuSE’s bootloader with its own. **
I wouldn’t care, except the menu granularity that existed in Grub2, is gone in Grub1.99 so I’m not able to distinguish between openSuSE’s boot options. I can’t differentiate between kernels or versions (pae, generic, rescue, etc.) to select.
Lubuntu’s Grub 1.99 truncates all but the distro name.

I’ve scoured the forums and found this solution, however , it didn’t work for me (3 or 4 times):
https://forums.opensuse.org/content/128-re-install-grub2-dvd-rescue.html#comments
i followed it to the letter, replacing his root partition(sda3) with mine(sda2). The post is over a year old, and uses openSuSE 12.x, so I’m not sure if it applies to 13.1.
Some of the commands wouldn’t take (mount /proc, mount /sys), and others said it was errors
(grub2-mkconfig (something about /dev not being mounted…)).
Anyway I used YaST to rebuild the bootloader in SuSE, ultimately.

In a nutshell:
sda1 = swap
sda2 =** boot**,root of openSuSE 13.1
sda3 = /home of openSuSE 13.1
sda4 = (extended partition)
sda5 = root,/home, (everything) of Lubuntu 13.10

Now the issue I’m having is that I tried to rebuild Grub2 (thru YaST) every which way to the moon, and I see that the files related to grub2(on sda2) have changed, however, I don’t think that the bootloader for Lubuntu sees it on sda2 first. I don’t think the “control” of the bootloader has gone back to openSuSE. I think Lubuntu has control.

After some digging, I’m speculating that the bootloader for Lubuntu is on sda5.

  • I don’t know how the system determines whether or not to look on sda2 first, or sda5.
    ** sda2 IS the boot partition.**

  • Sure I can rebuild openSuSE’s bootloader on sda2, but
    ** how do I get the “system” to use that one instead of sda5 (if in fact , that’s where it is)**.

I also don’t know if in fact Grub2 on sda2 sees Grub1.99 and is “passing control” to it, or if Grub1.99 “stole” control from Grub2 and doesn’t see it, or essentially … “who’s on first ?” (baseball analogy) - LOL.

So… Whose on first ???

  • To make matters worse Lubuntu doesn’t have a nice GUI app to manipulate Grub1.99, and I don’t have the knowledge of how to get into grub from the command line. openSuSE on the other hand has an app in YaST which I have no problem using.

Any help greatly appreciated.

Brick.

… I forgot to add:

  • I thought that by merely rebuilding Grub2 though YaST, that it would put Grub2 “back in charge”. (Does it do an automatic grubx-update ?

I might be mistaken making this assumption, because clearly it doesn’t seem to, unless I missed a step , or screwed something up, but I did do it a few times.

  • How does one dictate to the system which bootloader they want to use?

Lastly,
I have no aversion to the command line, and am comfortable using it (DOS, Windows Shell) , as long as I know what I’m doing, which in Linux, I don’t… yet… - lol.

If the ubuntu boots from the MBR, then that has priority over everything. You would need to restore the original MBR content (but not the partition table part).

If ubuntu boots from elsewhere, then it is just a matter of flipping the active bits.

Maybe provide the output of


# fdisk -l /dev/sda

and please use code tags for that.

ok, here it is:
I did these from within openSuSE 13.1

fdisk -l

linux-oucb:~ # fdisk -l

Disk /dev/sda: 30.8 GB, 30750031872 bytes, 60058656 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00e100e1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     3067903     1532928   82  Linux swap / Solaris
/dev/sda2   *     3067904    26234879    11583488   83  Linux
/dev/sda3        26234880    43274239     8519680   83  Linux
/dev/sda4        43274240    60057599     8391680    5  Extended
/dev/sda5        43276288    60057599     8390656   83  Linux
linux-oucb:~ # 


Thanks.
brick.

***** I made a mistake in my original posting.
I installed the LXLE distro (based on Lubuntu 12.04 LTS, and LXDE), not Lubuntu 13.10**

So it looks as if the ubuntu grub is installed in the MBR. And it appears that you can still get into opensuse one way or another.

You can try this as root:


# cd /boot
# ls -l backup_mbr   ### make sure the file exists.
# dd if=/dev/sda of=MBR-ubuntu count=1   ### save current MBR
# dd if=backup_mbr bs=440 count=1 of=/dev/sda   ### restore MBR from backup

The part from “### on” is just a comment. You don’t need to put that on the commands.

The idea is to restore the MBR (boot code portion) to what it was at the time that opensuse was installed.

I’m not sure if this will cause problem for ubuntu. I assume that you can still boot it using the opensuse grub menu.

NOTE: Please (anybody), check for typos. And brickheap might want to wait to see if anyone posts corrections before trying. The first three lines are safety checks and saving of the current MBR just in case.

Thanks for your suggestion.
I went back and tried that method I found below, with some omissions, and it eventually worked.
The only thing I can think of, is that he was using openSuSE 12.x and I’m using 13.1. There could also be differences between the two rescue systems. I tried this several times. I just never tried the last step in light of all the warnings, until my last attempt.

***** Below, I’ll insert my comments in** red. I also substituted sda2 (my boot) for sda3 below.

URL: https://forums.opensuse.org/content/128-re-install-grub2-dvd-rescue.html

Re-install Grub2 from DVD Rescue
by caf4926](https://forums.opensuse.org/members/caf4926.html)
Published on 11-Sep-2012 23:50
[RIGHT]
[/RIGHT]
Boot the Rescue from the DVD. This should be the same Arch as the installation: ie; 32 bit or 64 bit…

Once the DVD rescue gets to ‘login’, type: **root
from there I run **fdisk -l to confirm my HD partitition order.
We need to mount root (for me that’s sda3)

Now mount / (sda3) with:

**mount /dev/sda3 /mnt****

**To mount the other devices
Next do:

**mount --bind /dev /mnt/dev****

*Then chroot:

**chroot /mnt****

The command above is where my prompt changed to*: Rescue:/> (not as indicated below)

**

****mount /proc
*********(response)********* mount: /proc : mount failed : No such file or directory
****
******mount /sys
*************(response)************* mount: /sys : mount failed : No such file or directory
******

******Your prompt changes to: Rescue:/>
Here type:

**grub2-mkconfig -o /boot/grub2/grub.cfg
*(response)********* /usr/bin/grub2-mkconfig : line 130 : /proc/self/mountinfo: No such file or directory
****grub2-install /dev/sda****

*******************(This command above worked and rebuilt GRUB2 for me).


****You can see it all here:https://dl.dropbox.com/u/10573557/Gr…ect/rescue.jpg

**‘exit’

reboot

**If you use LVM please check this post:https://forums.opensuse.org/vbcms-comments/478290-article-re-install-grub2-dvd-rescue-3.html#post2519005

N.B: This method should also work from a live cd
This should be the same Arch as the installation: ie; 32 bit or 64 bit…USE LIVE CD TO RESCUE
**********************
Tags: dvd, grub2, reinstall, rescue

Even if my Lubuntu had gotten lost after trying this, I could go back into YaST and the Boot Configuration program, to automagically find other operating systems and populate GRUB2 with those entries.
Thanks,
Brick.

Seasons greetings and happy holidays!

Ok,
I restored the GRUB2 bootloader of openSuSE 13.1(in the above post on this thread), and all was running fine for a few days until I ran an update on LXLE (Lubutu 12.04 LTS).
Apparently, it downloaded a new kernel revision (not a major update, but something like 3.2.34 to 3.2.58).

After I rebooted from the update, LXLE took back the boot loader again ! :mad:
(Prior to the update, I was able to boot to either distro with no probs.)

I don’t think the install for LXLE is as sophisticated as openSuSE, since the installer doesn’t provide any options for manipulating the bootloader during the install. Actually, there are no options.

*** What can I do to/with openSuSE’s bootloader to prevent LXLE from stealing it again?
(I’d really like to disable LXLE’s ability to manipulate the bootloader, but that’s Lubuntu, and probably not addressed in this forum… although I think that’s probably basic to all Linux distros).

Any ideas?