Wrong grub.cfg

Hi

OpenSuse doing wrong grub.cfg, arranges fedora linux images in reverse order (from oldest to newest)
Command

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


works about 4 miuntes (finished without error). Lines for OpenSuse and Debian creates in a few seconds, but for Fedora in a few minutes.
How can I fix it (order)?

 menuentry 'openSUSE'  --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux
-simple-0a009383-a4c9-4c97-b672-4ed9a5f25f16' { 
        load_video 
        set gfxpayload=keep 
        insmod gzio 
        insmod part_msdos  
        insmod ext2 
        set root='hd0,msdos1' 
        if  x$feature_platform_search_hint = xy ]; then 
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremeta
l=ahci0,msdos1 --hint='hd0,msdos1'  0a009383-a4c9-4c97-b672-4ed9a5f25f16 
        else 
          search --no-floppy --fs-uuid --set=root 0a009383-a4c9-4c97-b672-4ed9a5f25f16 
        fi 
        echo    'Loading Linux 4.1.3-2-desktop ...' 
        linux   /boot/vmlinuz-4.1.3-2-desktop root=UUID=0a009383-a4c9-4c97-b672-4ed9a5f25f16  resume=/dev/disk
/by-uuid/ebae7ed6-d4dc-449f-a8a9-4fe0e2b937eb splash=silent quiet showopts nouveau.modeset=0 
        echo    'Loading initial ramdisk ...' 
        initrd  /boot/initrd-4.1.3-2-desktop 
} 
submenu 'Advanced options for openSUSE' --hotkey=1 $menuentry_id_option 'gnulinux-advanced-0a009383-a4c9-4c97-
b672-4ed9a5f25f16' { 
        menuentry 'openSUSE, with Linux 4.1.3-2-desktop' --hotkey=2 --class opensuse --class gnu-linux --class
 gnu --class os $menuentry_id_option 'gnulinux-4.1.3-2-desktop-advanced-0a009383-a4c9-4c97-b672-4ed9a5f25f16' 
{ 
                load_video 
                set gfxpayload=keep 
                insmod gzio 
                insmod part_msdos  
                insmod ext2 
                set root='hd0,msdos1' 
                if  x$feature_platform_search_hint = xy ]; then 
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-
baremetal=ahci0,msdos1 --hint='hd0,msdos1'  0a009383-a4c9-4c97-b672-4ed9a5f25f16 
                else 
                  search --no-floppy --fs-uuid --set=root 0a009383-a4c9-4c97-b672-4ed9a5f25f16 
                fi 
                echo    'Loading Linux 4.1.3-2-desktop ...' 
                linux   /boot/vmlinuz-4.1.3-2-desktop root=UUID=0a009383-a4c9-4c97-b672-4ed9a5f25f16  resume=/
dev/disk/by-uuid/ebae7ed6-d4dc-449f-a8a9-4fe0e2b937eb splash=silent quiet showopts nouveau.modeset=0 
                echo    'Loading initial ramdisk ...' 
                initrd  /boot/initrd-4.1.3-2-desktop 
        } 
        menuentry 'openSUSE, with Linux 4.1.3-1-desktop'  --class opensuse --class gnu-linux --class gnu --cla
ss os $menuentry_id_option 'gnulinux-4.1.3-1-desktop-advanced-0a009383-a4c9-4c97-b672-4ed9a5f25f16' { 
                load_video 
                set gfxpayload=keep 
                insmod gzio 
                insmod part_msdos  
                insmod ext2 
                set root='hd0,msdos1' 
                if  x$feature_platform_search_hint = xy ]; then 
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-
baremetal=ahci0,msdos1 --hint='hd0,msdos1'  0a009383-a4c9-4c97-b672-4ed9a5f25f16 
                else 
                  search --no-floppy --fs-uuid --set=root 0a009383-a4c9-4c97-b672-4ed9a5f25f16 
                fi 
                echo    'Loading Linux 4.1.3-1-desktop ...' 
                linux   /boot/vmlinuz-4.1.3-1-desktop root=UUID=0a009383-a4c9-4c97-b672-4ed9a5f25f16  resume=/
dev/disk/by-uuid/ebae7ed6-d4dc-449f-a8a9-4fe0e2b937eb splash=silent quiet showopts nouveau.modeset=0 
                echo    'Loading initial ramdisk ...' 
                initrd  /boot/initrd-4.1.3-1-desktop 
        } 
} 

### END /etc/grub.d/10_linux ### 

### BEGIN /etc/grub.d/20_linux_xen ### 
### END /etc/grub.d/20_linux_xen ### 

### BEGIN /etc/grub.d/20_memtest86+ ### 
### END /etc/grub.d/20_memtest86+ ### 

### BEGIN /etc/grub.d/30_os-prober ### 
menuentry 'Fedora release 22 (Twenty Two) (on /dev/sda2)' --class gnu-linux --class gnu --class os $menuentry_
id_option 'osprober-gnulinux-simple-332c0919-d691-4ad6-8ffa-54c0aec2f00c' { 
        insmod part_msdos  
        insmod ext2 
        set root='hd0,msdos2' 
        if  x$feature_platform_search_hint = xy ]; then 
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremeta
l=ahci0,msdos2 --hint='hd0,msdos2'  332c0919-d691-4ad6-8ffa-54c0aec2f00c 
        else 
          search --no-floppy --fs-uuid --set=root 332c0919-d691-4ad6-8ffa-54c0aec2f00c 
        fi 
        linux /boot/vmlinuz-4.1.3-200.fc22.x86_64 root=/dev/sda2 
        initrd /boot/initramfs-4.1.3-200.fc22.x86_64.img 
} 
submenu 'Advanced options for Fedora release 22 (Twenty Two) (on /dev/sda2)' $menuentry_id_option 'osprober-gn
ulinux-advanced-332c0919-d691-4ad6-8ffa-54c0aec2f00c' { 
        menuentry 'Fedora release 22 (Twenty Two) (on /dev/sda2)' --class gnu-linux --class gnu --class os $me
nuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.1.3-200.fc22.x86_64--332c0919-d691-4ad6-8ffa-54c0aec2f00c
' { 
                insmod part_msdos  
                insmod ext2 
                set root='hd0,msdos2' 
                if  x$feature_platform_search_hint = xy ]; then 
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-
baremetal=ahci0,msdos2 --hint='hd0,msdos2'  332c0919-d691-4ad6-8ffa-54c0aec2f00c 
                else 
                  search --no-floppy --fs-uuid --set=root 332c0919-d691-4ad6-8ffa-54c0aec2f00c 
                fi 
                linux /boot/vmlinuz-4.1.3-200.fc22.x86_64 root=/dev/sda2 
                initrd /boot/initramfs-4.1.3-200.fc22.x86_64.img 
        } 
        menuentry 'Fedora release 22 (Twenty Two) (on /dev/sda2)' --class gnu-linux --class gnu --class os $me
nuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.1.3-201.fc22.x86_64--332c0919-d691-4ad6-8ffa-54c0aec2f00c
' { 
                insmod part_msdos  
                insmod ext2 
                set root='hd0,msdos2' 
                if  x$feature_platform_search_hint = xy ]; then 
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-
baremetal=ahci0,msdos2 --hint='hd0,msdos2'  332c0919-d691-4ad6-8ffa-54c0aec2f00c 
                else 
                  search --no-floppy --fs-uuid --set=root 332c0919-d691-4ad6-8ffa-54c0aec2f00c 
                fi 
                linux /boot/vmlinuz-4.1.3-201.fc22.x86_64 root=/dev/sda2 
                initrd /boot/initramfs-4.1.3-201.fc22.x86_64.img 
        } 
        menuentry 'Fedora release 22 (Twenty Two) (on /dev/sda2)' --class gnu-linux --class gnu --class os $me
nuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.1.3-201.fc22.x86_64+debug--332c0919-d691-4ad6-8ffa-54c0ae
c2f00c' { 
                insmod part_msdos  
                insmod ext2 
                set root='hd0,msdos2' 
                if  x$feature_platform_search_hint = xy ]; then 
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-
baremetal=ahci0,msdos2 --hint='hd0,msdos2'  332c0919-d691-4ad6-8ffa-54c0aec2f00c 
                else 
                  search --no-floppy --fs-uuid --set=root 332c0919-d691-4ad6-8ffa-54c0aec2f00c 
                fi 
                linux /boot/vmlinuz-4.1.3-201.fc22.x86_64+debug root=/dev/sda2 
                initrd /boot/initramfs-4.1.3-201.fc22.x86_64+debug.img 
        } 
} 

menuentry 'Debian GNU/Linux (8.1)...


These menu entries are displayed in exactly the same order as found in grub.cfg or menu.lst in respective OS instance. So to fix you need to change order in their operating systems, where those entries originate.

I don’t understand.
Yesterday I removed all packages with grub in name from Fedora, so grub.cfg in this system will not be updated. I must have grub in each system??

I see that grub.cfg in Fedora look correct.

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora (4.1.3-201.fc22.x86_64) 22 (Twenty Two)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.1.3-201.fc22.x86_64-advanced-332c0919-d691-4ad6-8ffa-54c0aec2f00c' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos2'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  332c0919-d691-4ad6-8ffa-54c0aec2f00c
    else
      search --no-floppy --fs-uuid --set=root 332c0919-d691-4ad6-8ffa-54c0aec2f00c
    fi
    linux16 /boot/vmlinuz-4.1.3-201.fc22.x86_64 root=UUID=332c0919-d691-4ad6-8ffa-54c0aec2f00c ro rhgb quiet 
    initrd16 /boot/initramfs-4.1.3-201.fc22.x86_64.img
}
menuentry 'Fedora (4.1.3-200.fc22.x86_64) 22 (Twenty Two)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.1.3-200.fc22.x86_64-advanced-332c0919-d691-4ad6-8ffa-54c0aec2f00c' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos2'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  332c0919-d691-4ad6-8ffa-54c0aec2f00c
    else
      search --no-floppy --fs-uuid --set=root 332c0919-d691-4ad6-8ffa-54c0aec2f00c
    fi
    linux16 /boot/vmlinuz-4.1.3-200.fc22.x86_64 root=UUID=332c0919-d691-4ad6-8ffa-54c0aec2f00c ro rhgb quiet 
    initrd16 /boot/initramfs-4.1.3-200.fc22.x86_64.img
}
menuentry 'Fedora (4.1.3-201.fc22.x86_64+debug) 22 (Twenty Two)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.1.3-201.fc22.x86_64+debug-advanced-332c0919-d691-4ad6-8ffa-54c0aec2f00c' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos2'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  332c0919-d691-4ad6-8ffa-54c0aec2f00c
    else
      search --no-floppy --fs-uuid --set=root 332c0919-d691-4ad6-8ffa-54c0aec2f00c
    fi
    linux16 /boot/vmlinuz-4.1.3-201.fc22.x86_64+debug root=UUID=332c0919-d691-4ad6-8ffa-54c0aec2f00c ro rhgb quiet 
    initrd16 /boot/initramfs-4.1.3-201.fc22.x86_64+debug.img
}
menuentry 'Fedora (4.1.3-200.fc22.x86_64+debug) 22 (Twenty Two)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.1.3-200.fc22.x86_64+debug-advanced-332c0919-d691-4ad6-8ffa-54c0aec2f00c' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos2'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  332c0919-d691-4ad6-8ffa-54c0aec2f00c
    else
      search --no-floppy --fs-uuid --set=root 332c0919-d691-4ad6-8ffa-54c0aec2f00c
    fi
    linux16 /boot/vmlinuz-4.1.3-200.fc22.x86_64+debug root=UUID=332c0919-d691-4ad6-8ffa-54c0aec2f00c ro rhgb quiet 
    initrd16 /boot/initramfs-4.1.3-200.fc22.x86_64+debug.img
}


On 2015-08-10 13:26, userez wrote:
> I don’t understand.
> Yesterday I removed all packages with grub in name from Fedora, so
> grub.cfg in this system will not be updated. I must have grub in each
> system??

IMHO, you should have grub or whatever on every installed operating
system. Think: when you do updates in that fedora, and the kernel is
updated, the openSUSE grub will not be told about the kernel update in
fedora, and will be unable to boot it.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

If you want total control of the grub2 order in openSUSE, you can use the ‘90_persistent’ section and make manual changes each time there are changes in the various OSs that you have.
The ‘90_persistent’ is copied as is every time you run mkconfig.
If you take it a stage further and stop all the files in /etc/grub/ from executing (except ‘header’ and ‘90_…’), you’ll have the equivalent of the legacy menu.lst.

Things also depend on how you boot ie MBR or EFI boot. But in either case running the Yast-boot should scan for any other OS if the scan box is checked

And if you run grub2-mkconfig now? Also do you have /boot/grub/menu.lst in Fedora?

Could you explain how order of menu entries in grub.cfg depends on MBR or EFI?

Not the order the method used to set. In EFI all active OS’s have an entry. The order displayed is of no interest to the OS or OS’s

My point is what two OS’s is if one is updated the other knows nothing and you have to force a rescan the easiest way is in yast. You should maintain only one OS as the boot controller don’t mix unless you really understand what you are doing. As a general rule the controlling boot loader tends to put it’s OS first. If you need to change the order you have to overload as has been outlined. The instructions should be more or less right for any OS using grub2

On 2015-08-10 19:16, arvidjaar wrote:
>
> userez;2723312 Wrote:
>>
>> I see that grub.cfg in Fedora look correct.
>>
> And if you run grub2-mkconfig now? Also do you have /boot/grub/menu.lst
> in Fedora?

He removed grub. If the file exists, it will be stale.

U> Yesterday I removed all packages with grub in name from Fedora, so
U> grub.cfg in this system will not be updated.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On 2015-08-10 19:46, gogalthorp wrote:
>
> Not the order the method used to set. In EFI all active OS’s have an
> entry. The order displayed is of no interest to the OS or OS’s
>
> My point is what two OS’s is if one is updated the other knows nothing
> and you have to force a rescan the easiest way is in yast. You should
> maintain only one OS as the boot controller don’t mix unless you really
> understand what you are doing. As a general rule the controlling boot
> loader tends to put it’s OS first. If you need to change the order you
> have to overload as has been outlined. The instructions should be more
> or less right for any OS using grub2

I suppose that with UEFI the best thing is to use the UEFI boot menu to
choose which system to boot, then each system runs its booter of choice:
grub in Linux, whatever in Windows, etc. Each one on its own.

Of course, for completeness, grub can have entries obtained from other
oses…


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Yes, it’s true.
Now I update grub2 in Yast but grub.cfg is still the same.
Maybe tomorrow I try to understand practically all replies (also well translate :slight_smile: )
I still don’t understand why openSUSe grub2 creates grub.cfg with Fedora linux images in the reverse order (this uncomfortable, every time when I want boot Fedora I have to manually select the last entry in grub for Fedora, because I use proprietary Nvidia driver for the newest kernel).
It is meaningless but I wonder why grub2-mkconfig… works a few minutes deu to Fedora, maybe this is somehow related.

I forgot to write. I haven’t /boot/grub in Fedora.
/boot/grub2/grub.cfg exists.

On 2015-08-11 01:16, userez wrote:
>
> arvidjaar;2723373 Wrote:
>> Also do you have /boot/grub/menu.lst in Fedora?
> I forgot to write. I haven’t /boot/grub in Fedora.
> /boot/grub2/grub.cfg exists.

The idea is that grub2 in openSUSE is getting the information from the
grub2 file in Fedora.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))