grub2-mkconfig creates broken bootmenu entry

This weekend I did my first Leap test install . On this system there is a OpenSuse-13.2 installed on with / on /dev/system3/root with /boot on /dev/sda3 and another opensuse Tumbleweed ( updated from 13.1 first to opensuse factory and now to Tumbleweed) with / on /dev/system2/root_factory with /boot on /dev/sda6.
Leap was installed on /dev/sdb6 (swap) /dev/sdb7 (/) and /dev/sdb8 (/home).

A grub2-mkconfig on leap creates this grub.cfg : http://paste.opensuse.org/56733857

The output of blkid is


/dev/sda1: LABEL="System-reserviert" UUID="141E785E1E783AB6" TYPE="ntfs" PARTUUID="d2ce93d5-01" 
/dev/sda2: UUID="A0B67AFDB67AD2F0" TYPE="ntfs" PARTUUID="d2ce93d5-02" 
/dev/sda3: UUID="4db35d4c-2c76-4e83-8045-38f868395a11" TYPE="ext4" PTTYPE="dos" PARTUUID="d2ce93d5-03" 
/dev/sda5: UUID="rE9WcO-0i8C-iovj-aKaS-j2n1-pdH6-Mt6DrQ" TYPE="LVM2_member" PARTUUID="d2ce93d5-05" 
/dev/sda6: UUID="6811369a-f7d2-497b-9a46-d2689de9a78e" TYPE="ext4" PARTUUID="d2ce93d5-06" 
/dev/sda7: UUID="1d2a7c44-4c92-4201-acc0-1b6dbfb13c0a" TYPE="ext4" PTTYPE="dos" PARTUUID="d2ce93d5-07" 
/dev/sdb2: UUID="lQdrTi-tUuS-H8xV-Ehdp-sQt7-dcPz-1rG8ER" TYPE="LVM2_member" PARTUUID="00022269-02" 
/dev/sdb5: UUID="dbLoGc-eFg6-2k8b-UuoS-Ch36-YAel-NzwCNC" TYPE="LVM2_member" PARTUUID="00022269-05" 
/dev/sdb8: UUID="1689c866-d91c-4c25-a10c-591514c4be15" TYPE="xfs" PARTUUID="00022269-08" 
/dev/mapper/system3-root: UUID="79f51bc0-5e14-444c-aab5-1f26842c2a95" TYPE="ext4" 
/dev/mapper/system4-vmware: UUID="0cdd4caf-72ac-4a74-a026-47758f5b9fa5" TYPE="ext4" 
/dev/mapper/system2-home2: UUID="7e77f93d-d477-4291-ac7c-c16ef0d45f1e" TYPE="ext4" 
/dev/mapper/system2-root_factory: UUID="4195c3e3-a94e-45f2-bcd1-e750e4fe1013" TYPE="ext4" 
/dev/dm-3: UUID="7e77f93d-d477-4291-ac7c-c16ef0d45f1e" TYPE="ext4" 
/dev/dm-4: UUID="4195c3e3-a94e-45f2-bcd1-e750e4fe1013" TYPE="ext4" 
/dev/dm-1: UUID="79f51bc0-5e14-444c-aab5-1f26842c2a95" TYPE="ext4" 
/dev/dm-2: UUID="0cdd4caf-72ac-4a74-a026-47758f5b9fa5" TYPE="ext4" 
/dev/block/8:23: UUID="4c29662b-b4fe-4fb2-aec8-8b258c678e5e" UUID_SUB="e34a4845-c44c-4cc1-b0b8-cd36c177135b" TYPE="btrfs" PARTUUID="00022269-07" 
/dev/block/254:0: UUID="0d85c968-ba96-478b-99e3-734182891484" TYPE="swap" 
/dev/block/8:21: UUID="dbLoGc-eFg6-2k8b-UuoS-Ch36-YAel-NzwCNC" TYPE="LVM2_member" PARTUUID="00022269-05" 
/dev/block/8:22: UUID="6198f710-59d4-48d7-b746-80bf1526c44e" TYPE="swap" PARTUUID="00022269-06" 
/dev/sdb7: UUID="4c29662b-b4fe-4fb2-aec8-8b258c678e5e" UUID_SUB="e34a4845-c44c-4cc1-b0b8-cd36c177135b" TYPE="btrfs" PARTUUID="00022269-07" 
/dev/dm-0: UUID="0d85c968-ba96-478b-99e3-734182891484" TYPE="swap" 
/dev/sdb6: UUID="6198f710-59d4-48d7-b746-80bf1526c44e" TYPE="swap" PARTUUID="00022269-06" 

This grub.cfg has a broken menu entry:
It assigns a wrong root partition for the 13.2 installation:


menuentry 'openSUSE 13.2 (x86_64) (auf /dev/mapper/system3-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-79f51bc0-5e14-444c-aab5-1f26842c2a95' {
        insmod part_msdos 
        insmod ext2
        set root='hd0,msdos3'
        if  x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 --hint='hd0,msdos3'  4db35d4c-2c76-4e83-8045-38f868395a11
        else
          search --no-floppy --fs-uuid --set=root 4db35d4c-2c76-4e83-8045-38f868395a11
        fi
        linux /vmlinuz root=/dev/system2/root_factory showopts
        initrd /initrd
}
submenu 'Erweiterte Optionen für openSUSE 13.2 (x86_64) (auf /dev/mapper/system3-root)' $menuentry_id_option 'osprober-gnulinux-advanced-79f51bc0-5e14-444c-aab5-1f26842c2a95' {
        menuentry 'Desktop -- openSUSE factory (auf /dev/mapper/system3-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--79f51bc0-5e14-444c-aab5-1f26842c2a95' {
                insmod part_msdos 
                insmod ext2
                set root='hd0,msdos3'
                if  x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 --hint='hd0,msdos3'  4db35d4c-2c76-4e83-8045-38f868395a11
                else
                  search --no-floppy --fs-uuid --set=root 4db35d4c-2c76-4e83-8045-38f868395a11
                fi
                linux /vmlinuz root=/dev/system2/root_factory showopts
                initrd /initrd
        }
        menuentry 'Failsafe -- openSUSE factory (auf /dev/mapper/system3-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--79f51bc0-5e14-444c-aab5-1f26842c2a95' {
                insmod part_msdos 
                insmod ext2
                set root='hd0,msdos3'
                if  x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 --hint='hd0,msdos3'  4db35d4c-2c76-4e83-8045-38f868395a11
                else
                  search --no-floppy --fs-uuid --set=root 4db35d4c-2c76-4e83-8045-38f868395a11
                fi
                linux /vmlinuz root=/dev/system2/root_factory showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x317
                initrd /initrd
        }
}

It should write
linux /vmlinuz root=/dev/mapper/system3-root instead of
linux /vmlinuz root=/dev/system2/root_factory

Any idea whats going wrong there ?

This comes directly from grub.cfg of relevant OS instance. I suspect the entry itself was created by os-prober in 13.2 for TW and should be ignored. Could you upload also grub.cfg from 13.2? Also log from os-prober run on Leap. Something like:

START=$(date +'%F %T'
os-prober
journalctl --since="$START"

Meanwhile I’ve updated kernel on 13.2, which created a new grub.cfg on 13.2. So I also did another run of grub2-mkconfig on Leap and there is still the wrong root assigment.
Full grub.cfg from LEAP : http://paste.opensuse.org/5453613OSprober log from LEAP: http://paste.opensuse.org/11822977
full grub.cfg from 13.2 when I did run grub2-mkconfig on LEAP: http://paste.opensuse.org/28529357

There was also a problem with the default os-prober 16.1 on 13.2 . It couldn’t see the new LEAP installation ( maybe because it was completely on the second harddisk ?) . First I did try to make an entry into /etc/grub.d/40_custom by copying an entry from LEAP grub.cfg. That did not work and so I upgraded to os-prober 17.0 from home:arvidjaar:grub2-next / openSUSE_13.2. That could create a working grub.cfg for all installed systems ( and still contains the leftover non-working entry from this first try)

And on my Tumbleweed installation grub2-mkconfig produces this grub.cfg: http://paste.opensuse.org/16012183

Apparently menu entries for 13.2 do not come from 13.2 grub.cfg.

Do you have /boot/grub/menu.lst on 13.2 by any chance? Another possibility is stale /boot/grub2-efi. Could you show “ls -lR /boot” in 13.2?

One more chance is wrong /boot; does every OS instance have own /boot?

From memory, because I’am not sitting in front of the system now:
There is /boot/grub/menu.lst on that system but no grub2-efi (No EFI-BIOS).
I will retry this with menu.lst moved away this evening.
But the tumbleweed grub2-mkconfig seems to get it right. Is there a configuration change to ignore menu.lst on TW ?

Regarding /boot directories : sda3 is boot-partition for 13.2 ( that’s right in LEAPs grub.cfg) and sda6 is boot partition for tumbleweed ( also right) and LEAP is installed without boot partition on sdb7 ( with btrfs)

Yes, I think I fixed it in Factory (I do not remember what specifically I intended to fix, but check for menu.lst was against /boot/grub/grub.cfg only instead of /boot/grub2/grub.cfg).

If your test without menu.lst is successful, open bug report against Leap (tell number here).

Moving away /boot/grub/menu.lst fixed the problem. Opened https://bugzilla.opensuse.org/show_bug.cgi?id=956337