openSUSE 13.1 have to restore Grub

This is a bit confusing story. I will try to keep to the main path I am following now, but I guess a bit of background information is needed.

The system is good old BIOS and MSDOS partitioning.
This is (still) a 13.1 system. This is it’s fstab:

/dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E89L2J-part2    /    ext4    acl,user_xattr    1 1  
/dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E89L2J-part5    /home    ext4    acl,user_xattr    1 2 
/dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E89L2J-part1    swap    swap    defaults    0 0 
boven.henm.xs4all.nl:/home/wij                /home/wij nfs    noauto        0 0 
tmpfs                            /tmp    tmpfs    size=25%,uid=root,gid=root,mode=1777 0 0

and fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00006df8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    14684159     7341056   82  Linux swap / Solaris
/dev/sda2   *    14684160    56629247    20972544   83  Linux
/dev/sda3        56629248    98590719    20980736   83  Linux
/dev/sda4        98590720  3907028991  1904219136    f  W95 Ext'd (LBA)
/dev/sda5        98592768   518014975   209711104   83  Linux

Usage:
sda1 as Swap
sda2 is ext4 and mounted as /
sda3 is unused and planned for a new / on installing a new system
sda4 is extended
sda5 is ext4 and mounted as /home
a lot of free space where a new /home for a new installation is planned.

Time to upgrade to 15.1. I installed 15.1 using:
sda1 as Swap
sda3 as ext4 (no Btrfs) for /
a new sda6 of 200GB as ext4 (no zfs) for /home
This basicaly went well (although there was one lib… package which gave an error having an incorrect cheksum, it was skipped). Updated from the Update repos. Now I do have problems getting KDE Plasma to run.(after a few seconds it returns to the login screen). But as I can start at least one other DE, I consider the system as such and the users as configured correct.

The main reason installing on two free partitions is to have the old 13.1 still available for my wife doing what she wants until a full takeover to the new 15.1 can take place.
Grub menu shows four lines: two for 15.1 and two for 13.1, So it detected the other system.

But, booting from 13.1 takes me to a running green ruler (different greens below) instead of the 13.1 Gecko on a branch) and hitting esc show me the text in large VGA characters. After a lot of fast scrolling (I see upping the network, and starting LSB), it abrubtly stops, Black screen. Can do nothing except Ctrl-Alt-Del which restarts the system.

I tried to recover to the 13.1 Grub. Using the 15.1 as rescue system: booted, CTRL-Alt-F1 to the console,

mount /dev/sda2 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --binf /sys /dev/sys
chroot /mnt
mount -a

This indeed brings me to the 13.1 systems with all files (including in /home) available.
Start

yast

brings me the ncurses version. Start the boot module.
From there, I am stuck. I changed several things there and hoped that at the end Grub would be installed overwriting the 15.1 grub, but always I get the 15.1 menu back and the same lousy booting of 13.1

Anybody any suggestions how to recover the 13.1 grub (and forget for the time being the 15.1 installation, that can always be done again).

I would guess that the grub coming with 13.x (/boot/grub…) was overwritten by the new installation of 15.1 (boot device /dev/sda2 ? - as that partition is marked with a * )

If you have network you could try chroot-ing into your 13.x installation, /boot/grub… should be populated, and do a forced re-install all of the grub packages of 13.x with yast or zypper, then run the bootloader setup.

This might fix it.

P.S. BACKUP your data, just in case.

Hm, I would never have thought that the installation would write to a file system it is not using during installation. But you could be right (because of the *). Thanks for the suggestion. I will check my backups.

You could use the 90_persistent section in 15.1 and set it to the 13.1 appropriate partitions. It’s a bit like the old menu.lst. You can even make it the default (although I’m sure you know that).
I find it very handy for picking up odd systems that I try now and again without affecting leap and tumbleweed.

I do not think it has the wrong partitions mentioned soemwhere, because it does boot, though in a strange way. But thanks for the suggestion.

I will first try to restore /boot/grub. I do have a recent backup of it.

I will repert back.

Maybe try using the DVD to repair?
The 13.1 ISO
https://ftp.gwdg.de/pub/opensuse/discontinued/distribution/13.1/iso/

The 13.1 update repo, last packages available, you’ll also have to specify the architecture from this page
https://ftp.gwdg.de/pub/opensuse/discontinued/update/13.1/

I can’t remember the last time I tried to do a multi-boot with one using legacy GRUB while the other uses GRUB2, if there will be an attempt to upgrade/downgrade GRUB or properly chainload the ttwo GRUB. You’ll have to look out for what happens.

TSU

@tsu2
I have the 31.1 DVD here. I never throw such things away as long I have systems using a version.
As told aboe, I used the just installed 15.1 as rescue system, but maybe the 131.1 dvd is a better option (but as soon as you chroot, you use the correct versions of the tools like yast).

BTW I am think that 13.1 already uses grub2, or am I wrong here? In that case I have to check the grub directory and not the grub2 one :(.

@robert_spitzenpfeil (very sharp one ;))
I just restored in /boot/grub2 the files that had today as change date. In fact only grub.cfg was different. But that did not help. Still get the “wrong” Grub menu.

For your information:

Both grub and grub2 are installed on the 13.1 system…
I think grub2 is the one used because the /boot/grub library has only files with a date of Sep 2013 where those in the /boot/grub2 directory have several dates from Dec 2015 (until present).

As best I remember, grub legacy uses “/boot/grub/menu.lst” (or maybe just “/boot/menu.lst” for the boot menu. And grub2 uses “/boot/grub2/grub.cfg”.

Writing a boot flag does not constitute writing to a partition. All it does is change the location of the flag within the partition table if one previously existed, or add one if not.

This could be key to why this problem arose. You may have installed 13.1 originally with generic MBR code, and Grub on 13.1’s sda2 only. Chrooting into 13.1 to update Grub would then repair /dev/sda2 without touching the MBR code that the 15.1 installer wrote, which continues loading Grub from sda3. If during chroot you would write generic code to the MBR, then due to the location of the flag, boot would go immediately to the 13.1 Grub installed on sda2. The other option would be to switch 13.1 to booting from MBR in YaST while in chroot, which would write 13.1’s Grub code to MBR and update grub.cfg on sda2 and whatever is necessary in /etc/grub.d/ and/or /etc/default/grub.

With booting according to the flag (via generic MBR code) and Grub on / configured for both 13.1 and 15.1, switching boot control becomes a simple matter of moving the flag, which could at least in theory be done even booting a DOS floppy, a simple and painless table manipulation process.

I always keep generic code in the MBR, which boots according to the boot flag location (which Grub and Grub2 both ignore), and keep Grub either on / or nowhere at all that any individual OS knows about.

Sorry for being more or less a noob on Grub.

The situation of a few things as it is now:
Boot flag is on sda2.
I use ncurses yast in the chrooted 13.1. Boot module.
There is a main list there where I have Boot from MBR.
There is a more detailed screen behind it (which also shows kernel parameters, boot screen timers, etc.) where I checked both
. Set active flag in Partition table for Boot partition
. Write generic Boot code to MBR.
yast says it writes things and it takes a few secs, thus I assume something is done.
This gives still the grub menu belonging to the 15.1 installtion on boot :).

II think that is correct.

But on this 13.1 system there is no menu.list at all and there is a/boot/grub2/grub.cfg and it now has a date time of today because of my last action with yast this morning. Thus we can be sure that this is all about grub2 and dismiss the idea that 13.1 used legacy grub. This was just a confusing side path :(.

BTW, I inspected that grub.cfg and it contains only menu entries for 13.1. Thus that is the one I would like to see used on boot. It is there, but how can I force the system to use it??

These two are incompatible with each other. Boot from MBR generally means put Grub on MBR, but that would overwrite the generic code. The organization of those options since 13.1 has been improved. You need to choose one or the other. You need the boot flag on sda2 if MBR contains generic code and Grub is on root partition sda2. If booting from MBR with Grub on MBR, everything else should be unchecked.

I changed “Boot from MBR” into “Boot from root partition” leaving other thing as they were explained above. No luck.

@mrmazda.

Let me try to express what I understand from this.

In the MBR there can be so called “generic boot code”, which means that there can also be some specific boot code.

I assume my situaton is that in the MBR there is now 15.1 specific boot code and that there should be generic boot code.

For some reason the writing of this generic boot code (overwriting the 15.1 boot code) does not work.

Am I right that the crucial question is how we can force that?
Doing it with YaST bootloader from the chrooted 13.1 seems to fail.
I assume that in principle doing it from 15.1 must also be possible, after all it is the same MBR and the code is generic in both cases.
(The 15.1 has the problem that KDE does not work, so again ncurses yast must do it).

>:)
I use 15.1 and set Generic boot code to MBR. Now the system says:

Missing Operating System

ERROR: No boot disk has been detected …

Boot from root partition does require a form of chainloading, either from another bootloader, or by having generic code in the MBR and the boot flag on the applicable sda2 partition.

But it does not work!

I tried to recover using the 15.1 installation DVD as a rescue system chroot into the 15.1. Removed the Write Generic Boot code to MBR check. Dit not help, still no operating system found.

But removing the check might only skip writing generic code, But how do I force writing specific code? Apperently ther is now “nothing” in the MBR.

I would do as you see in these two images:
http://fm.no-ip.com/SS/Suse/YaST/131/yastI-BLinst768v.png
http://fm.no-ip.com/SS/Suse/YaST/131/yastI-BLopts768v.png

Be sure to increase or decrease the timeout to ensure YaST2 writes as it should.

Thanks for those clear confirmation on what to do.

It is in fact what I did already in yast ncurses. Except that I changed the splash parameter to be sure something was changed and write enforced.

Nevertheless I tried again. This time with a change of the Timeout parameter. Still no bootable disk found by the BIOS.
Did it chrooting in both systems, one after the other, cheking in both cases (I get thick fingers from typing those mnt --bind, etc)

I find it very strange that yast does not write at least something into the MBR that gives us a Grub.

I think my only option now is reinstalling 15.1. Which I would have done earlier, but it will bring me most probably not any further then the situation at the start of this thread: A bootable 15.1 (no working KDE) and something that looks like booting of 13.1 but that then stucks in a black screen where I only could get out with Ctrl-Alt-Del.