grub2 chainload issues

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

grub2 chainload issues

Postby doktor5000 » Jun 12th, '17, 13:43

When trying to boot mga6 from my mga5 grub2, I can't seem to chainload the actual grub2 of mga6. As with the default os-probing, the mga5 grub2 entries for mga6 are missing the options from mga6 /etc/default/grub which causes problems with the graphics driver during boot.

So when trying to chainload the grub2, I'm unsure whether to reference the partition where the other grub2 is installed, or referencing only the / partition where that grub2's config files are located. Or asking the other way around, is grub2 looking for core.img or is it looking for actual grub2 config files like /boot/grub2/grub.cfg ? Attached is an excerpt from bootinfoscript

Code: Select all
[doktor5000@Mageia5]─[13:37:59]─[~] cat RESULTS1.txt
                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 => Windows 7/8/2012 is installed in the MBR of /dev/sda.
 => Windows 7/8/2012 is installed in the MBR of /dev/sdb.
 => Grub2 (v1.99-2.00) is installed in the MBR of /dev/sdc and looks at sector
    1 of the same hard drive for core.img, but core.img can not be found at
    this location.
 => Grub2 (v1.99) is installed in the MBR of /dev/sdd and looks at sector 1 of
    the same hard drive for core.img. core.img is at this location and looks
    in partition 129 for .

sda1: __________________________________________________________________________

    File system:       
    Boot sector type:  -
    Boot sector info:
    Mounting failed:   mount: unknown filesystem type ''

sda2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 7/2008: NTFS
    Boot sector info:  According to the info in the boot sector, sda2 has
                       1565300735 sectors, but according to the info from
                       fdisk, it has 2639042559 sectors.
    Operating System: 
    Boot files:       

sdb1: __________________________________________________________________________

    File system:       
    Boot sector type:  -
    Boot sector info:
    Mounting failed:   mount: unknown filesystem type ''
mount: unknown filesystem type ''

sdb2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 7/2008: NTFS
    Boot sector info:  According to the info in the boot sector, sdb2 has
                       1565301646 sectors, but according to the info from
                       fdisk, it has 2639043470 sectors.
    Operating System: 
    Boot files:       

sdc1: __________________________________________________________________________

    File system:       btrfs
    Boot sector type:  -
    Boot sector info:
    Operating System:  Mageia release 6 (Cauldron) for x86_64
    Boot files:        /boot/grub2/grub.cfg /etc/fstab
                       /boot/grub2/i386-pc/core.img

sdc2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  Unknown
    Boot sector info:

sdc5: __________________________________________________________________________

    File system:       btrfs
    Boot sector type:  -
    Boot sector info:
    Operating System: 
    Boot files:       

sdd1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 7/2008: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System: 
    Boot files:        /bootmgr /Boot/BCD

sdd2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 7/2008: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /Windows/System32/winload.exe

sdd3: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:

sdd5: __________________________________________________________________________

    File system:       btrfs
    Boot sector type:  -
    Boot sector info:
    Operating System:  Mageia release 5 (Official) for x86_64
    Boot files:        /boot/grub2/grub.cfg /etc/fstab
                       /boot/grub2/i386-pc/core.img

sdd6: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:

sdd7: __________________________________________________________________________

    File system:       btrfs
    Boot sector type:  -
    Boot sector info:
    Operating System: 
    Boot files:       

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 2.7 TiB, 3000592982016 bytes, 5860533168 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

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1                   1 4,294,967,295 4,294,967,295  ee GPT


GUID Partition Table detected.

Partition    Start Sector    End Sector  # of Sectors System
/dev/sda1              34       262,177       262,144 Microsoft Reserved Partition (Windows)
/dev/sda2         264,192 2,639,306,751 2,639,042,560 Data partition (Windows/Linux)

Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 2.7 TiB, 3000592982016 bytes, 5860533168 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

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1                   1 4,294,967,295 4,294,967,295  ee GPT


GUID Partition Table detected.

Partition    Start Sector    End Sector  # of Sectors System
/dev/sdb1              34       262,177       262,144 Microsoft Reserved Partition (Windows)
/dev/sdb2         264,192 2,639,307,662 2,639,043,471 Data partition (Windows/Linux)

Drive: sdc _____________________________________________________________________

Disk /dev/sdc: 238.5 GiB, 256060514304 bytes, 500118192 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

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdc1    *          2,048    54,813,779    54,811,732  83 Linux
/dev/sdc2          54,816,741   290,262,419   235,445,679   5 Extended
/dev/sdc5          54,816,768   290,262,419   235,445,652  83 Linux


Drive: sdd _____________________________________________________________________

Disk /dev/sdd: 477 GiB, 512110190592 bytes, 1000215216 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

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdd1    *          2,048       206,847       204,800   7 NTFS / exFAT / HPFS
/dev/sdd2             206,848   409,599,999   409,393,152   7 NTFS / exFAT / HPFS
/dev/sdd3         409,601,997 1,000,206,899   590,604,903   5 Extended
/dev/sdd5         409,602,048   473,531,939    63,929,892  83 Linux
/dev/sdd6         473,534,464   481,709,024     8,174,561  82 Linux swap / Solaris
/dev/sdd7         481,712,128 1,000,206,899   518,494,772  83 Linux


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/sda1                                                         
/dev/sda2        A0CC037CCC034C4A                       ntfs       EXTERN5
/dev/sdb1                                                         
/dev/sdb2        EADE8A4CDE8A10CD                       ntfs       EXTERN6
/dev/sdc1        3e147ea5-32be-433c-9ebe-6556c4d300d8   btrfs     
/dev/sdc5        303cc3c8-c4d2-4086-919b-0700f71b6ca2   btrfs     
/dev/sdd1        E4C06EF3C06ECAFE                       ntfs       System-reserviert
/dev/sdd2        7CDA724CDA7202A6                       ntfs       
/dev/sdd5        799cdaf8-b6af-4299-a6c9-c934027e3bdc   btrfs     
/dev/sdd6        ec70e132-9c53-4851-a7cd-f89ba3c104b4   swap       
/dev/sdd7        a6d498ba-009f-4ee0-8fee-1460f2622dba   btrfs     

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/sda2        /run/media/doktor5000/EXTERN5 fuseblk    (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb2        /run/media/doktor5000/EXTERN6 fuseblk    (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdd1        /media/win_c             fuseblk    (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sdd2        /media/win_d             fuseblk    (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sdd5        /                        btrfs      (rw,noatime,compress=lzo,ssd_spread,discard,space_cache,autodefrag,subvolid=5,subvol=/)
/dev/sdd7        /home                    btrfs      (rw,noatime,compress=lzo,ssd_spread,discard,space_cache,autodefrag,subvolid=5,subvol=/)


========================== sdc1/boot/grub2/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set pager=1

if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod btrfs
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  3e147ea5-32be-433c-9ebe-6556c4d300d8
else
  search --no-floppy --fs-uuid --set=root 3e147ea5-32be-433c-9ebe-6556c4d300d8
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1024x768x32
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=de_DE
  insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod btrfs
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  3e147ea5-32be-433c-9ebe-6556c4d300d8
else
  search --no-floppy --fs-uuid --set=root 3e147ea5-32be-433c-9ebe-6556c4d300d8
fi
insmod gfxmenu
loadfont ($root)/boot/grub2/themes/maggy/MageiaLogo-Bold-16.pf2
loadfont ($root)/boot/grub2/themes/maggy/MageiaLogo-Bold-20.pf2
loadfont ($root)/boot/grub2/themes/maggy/MageiaLogo-Bold-28.pf2
loadfont ($root)/boot/grub2/themes/maggy/MageiaLogo-Regular-20.pf2
insmod png
set theme=($root)/boot/grub2/themes/maggy/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/01_users ###
if [ -f ${prefix}/user.cfg ]; then
  source ${prefix}/user.cfg
  if [ -n "${GRUB2_PASSWORD}" ]; then
    set superusers="root"
    export superusers
    password_pbkdf2 root ${GRUB2_PASSWORD}
  fi
fi
### END /etc/grub.d/01_users ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Mageia' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-simple-3e147ea5-32be-433c-9ebe-6556c4d300d8' {
        savedefault
        set gfxpayload=text
        insmod gzio
        insmod part_msdos
        insmod btrfs
        set root='hd2,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  3e147ea5-32be-433c-9ebe-6556c4d300d8
        else
          search --no-floppy --fs-uuid --set=root 3e147ea5-32be-433c-9ebe-6556c4d300d8
        fi
        linux16 /boot/vmlinuz-4.9.28-desktop-1.mga6 root=UUID=3e147ea5-32be-433c-9ebe-6556c4d300d8 ro   nokmsboot splash quiet noiswmd resume=UUID=ec70e132-9c53-4851-a7cd-f89ba3c104b4 audit=0
        initrd16 /boot/initrd-4.9.28-desktop-1.mga6.img
}
submenu 'Erweiterte Optionen für Mageia' $menuentry_id_option 'gnulinux-advanced-3e147ea5-32be-433c-9ebe-6556c4d300d8' {
        menuentry 'Mageia (4.9.28-desktop-1.mga6) 6' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.9.28-desktop-1.mga6-advanced-3e147ea5-32be-433c-9ebe-6556c4d300d8' {
        savedefault
                set gfxpayload=text
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd2,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  3e147ea5-32be-433c-9ebe-6556c4d300d8
                else
                  search --no-floppy --fs-uuid --set=root 3e147ea5-32be-433c-9ebe-6556c4d300d8
                fi
                linux16 /boot/vmlinuz-4.9.28-desktop-1.mga6 root=UUID=3e147ea5-32be-433c-9ebe-6556c4d300d8 ro   nokmsboot splash quiet noiswmd resume=UUID=ec70e132-9c53-4851-a7cd-f89ba3c104b4 audit=0
                initrd16 /boot/initrd-4.9.28-desktop-1.mga6.img
        }
        menuentry 'Mageia (4.9.28-desktop-1.mga6) 6 (recovery mode)' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.9.28-desktop-1.mga6-recovery-3e147ea5-32be-433c-9ebe-6556c4d300d8' {
                set gfxpayload=text
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd2,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  3e147ea5-32be-433c-9ebe-6556c4d300d8
                else
                  search --no-floppy --fs-uuid --set=root 3e147ea5-32be-433c-9ebe-6556c4d300d8
                fi
                linux16 /boot/vmlinuz-4.9.28-desktop-1.mga6 root=UUID=3e147ea5-32be-433c-9ebe-6556c4d300d8 ro failsafe
                initrd16 /boot/initrd-4.9.28-desktop-1.mga6.img
        }
        menuentry 'Mageia (desktop) 6' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-desktop-advanced-3e147ea5-32be-433c-9ebe-6556c4d300d8' {
        savedefault
                set gfxpayload=text
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd2,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  3e147ea5-32be-433c-9ebe-6556c4d300d8
                else
                  search --no-floppy --fs-uuid --set=root 3e147ea5-32be-433c-9ebe-6556c4d300d8
                fi
                linux16 /boot/vmlinuz-desktop root=UUID=3e147ea5-32be-433c-9ebe-6556c4d300d8 ro   nokmsboot splash quiet noiswmd resume=UUID=ec70e132-9c53-4851-a7cd-f89ba3c104b4 audit=0
                initrd16 /boot/initrd-desktop.img
        }
        menuentry 'Mageia (desktop) 6 (recovery mode)' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-desktop-recovery-3e147ea5-32be-433c-9ebe-6556c4d300d8' {
                set gfxpayload=text
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd2,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  3e147ea5-32be-433c-9ebe-6556c4d300d8
                else
                  search --no-floppy --fs-uuid --set=root 3e147ea5-32be-433c-9ebe-6556c4d300d8
                fi
                linux16 /boot/vmlinuz-desktop root=UUID=3e147ea5-32be-433c-9ebe-6556c4d300d8 ro failsafe
                initrd16 /boot/initrd-desktop.img
        }
}

### 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_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (auf /dev/sdd1)' --class windows --class os $menuentry_id_option 'osprober-chain-E4C06EF3C06ECAFE' {
        savedefault
        insmod part_msdos
        insmod ntfs
        set root='hd3,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  E4C06EF3C06ECAFE
        else
          search --no-floppy --fs-uuid --set=root E4C06EF3C06ECAFE
        fi
        parttool ${root} hidden-
        chainloader +1
}
menuentry 'Mageia 5 (auf /dev/sdd5)' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
        savedefault
        insmod part_msdos
        insmod btrfs
        set root='hd3,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
        else
          search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
        fi
        linux /boot/vmlinuz-desktop root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro splash quiet nomodeset
        initrd /boot/initrd-desktop.img
}
submenu 'Erweiterte Optionen für Mageia 5 (auf /dev/sdd5)' $menuentry_id_option 'osprober-gnulinux-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
        menuentry 'Mageia (auf /dev/sdd5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-desktop--799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                savedefault
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                linux /boot/vmlinuz-desktop root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro splash quiet nomodeset
                initrd /boot/initrd-desktop.img
        }
        menuentry 'Mageia, mit Linux desktop (auf /dev/sdd5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-desktop--799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                savedefault
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                linux /boot/vmlinuz-desktop root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro splash quiet nomodeset
                initrd /boot/initrd-desktop.img
        }
        menuentry 'Mageia, mit Linux 4.4.13-desktop-1.mga5 (auf /dev/sdd5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.4.13-desktop-1.mga5--799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                savedefault
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                linux /boot/vmlinuz-4.4.13-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro splash quiet nomodeset
                initrd /boot/initrd-4.4.13-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.1.15-desktop-2.mga5 (auf /dev/sdd5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.1.15-desktop-2.mga5--799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                savedefault
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                linux /boot/vmlinuz-4.1.15-desktop-2.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro splash quiet nomodeset
                initrd /boot/initrd-4.1.15-desktop-2.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.1.15-desktop-1.mga5 (auf /dev/sdd5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.1.15-desktop-1.mga5--799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                savedefault
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                linux /boot/vmlinuz-4.1.15-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro splash quiet nomodeset
                initrd /boot/initrd-4.1.15-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.1.13-desktop-2.mga5 (auf /dev/sdd5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.1.13-desktop-2.mga5--799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                savedefault
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                linux /boot/vmlinuz-4.1.13-desktop-2.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro splash quiet nomodeset
                initrd /boot/initrd-4.1.13-desktop-2.mga5.img
        }
        menuentry 'Mageia, mit Linux 3.19.8-desktop-3.mga5 (auf /dev/sdd5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.19.8-desktop-3.mga5--799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                savedefault
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                linux /boot/vmlinuz-3.19.8-desktop-3.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro splash quiet nomodeset
                initrd /boot/initrd-3.19.8-desktop-3.mga5.img
        }
}

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sdc1/etc/fstab: ================================

--------------------------------------------------------------------------------
# Entry for /dev/sdc1 :
UUID=3e147ea5-32be-433c-9ebe-6556c4d300d8 / btrfs noatime 1 1
# Entry for /dev/sdc5 :
UUID=303cc3c8-c4d2-4086-919b-0700f71b6ca2 /home btrfs noatime 1 2
# Entry for /dev/sda2 :
UUID=A0CC037CCC034C4A /media/win_c ntfs-3g defaults,nofail 0 0
# Entry for /dev/sdb2 :
UUID=EADE8A4CDE8A10CD /media/win_c2 ntfs-3g defaults,nofail 0 0
# Entry for /dev/sdd1 :
UUID=E4C06EF3C06ECAFE /media/win_c3 ntfs-3g defaults,nofail 0 0
# Entry for /dev/sdd2 :
UUID=7CDA724CDA7202A6 /media/win_d ntfs-3g defaults,nofail 0 0
none /proc proc defaults 0 0
# Entry for /dev/sdd6 :
UUID=ec70e132-9c53-4851-a7cd-f89ba3c104b4 swap swap defaults 0 0
--------------------------------------------------------------------------------

=================== sdc1: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)


========================== sdd5/boot/grub2/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if loadfont unicode ; then
  set gfxmode=1280x1024x32
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=de_DE
  insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod btrfs
set root='hd3,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
else
  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
fi
insmod gfxmenu
loadfont ($root)/boot/grub2/themes/maggy/MageiaLogo-Bold-16.pf2
loadfont ($root)/boot/grub2/themes/maggy/MageiaLogo-Bold-20.pf2
loadfont ($root)/boot/grub2/themes/maggy/MageiaLogo-Bold-28.pf2
loadfont ($root)/boot/grub2/themes/maggy/MageiaLogo-Regular-20.pf2
insmod png
set theme=($root)/boot/grub2/themes/maggy/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Mageia' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod btrfs
        set root='hd3,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
        else
          search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
        fi
        echo    'Linux desktop wird geladen …'
        linux   /boot/vmlinuz-desktop root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
        echo    'Initiale Ramdisk wird geladen …'
        initrd  /boot/initrd-desktop.img
}
submenu 'Erweiterte Optionen für Mageia' $menuentry_id_option 'gnulinux-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
        menuentry 'Mageia, mit Linux desktop' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-desktop-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux desktop wird geladen …'
                linux   /boot/vmlinuz-desktop root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-desktop.img
        }
        menuentry 'Mageia, mit Linux 4.4.68-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.68-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.68-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.68-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.68-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.65-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.65-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.65-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.65-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.65-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.59-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.59-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.59-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.59-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.59-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.55-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.55-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.55-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.55-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.55-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.50-desktop-2.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.50-desktop-2.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.50-desktop-2.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.50-desktop-2.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.50-desktop-2.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.39-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.39-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.39-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.39-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.39-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.36-desktop-2.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.36-desktop-2.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.36-desktop-2.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.36-desktop-2.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.36-desktop-2.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.32-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.32-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.32-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.32-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.32-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.30-desktop-2.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.30-desktop-2.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.30-desktop-2.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.30-desktop-2.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.30-desktop-2.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.26-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.26-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.26-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.26-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.26-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.16-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.16-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.16-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.16-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.16-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.4.13-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.13-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.4.13-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.4.13-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.4.13-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.1.15-desktop-2.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.1.15-desktop-2.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.1.15-desktop-2.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.1.15-desktop-2.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.1.15-desktop-2.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.1.15-desktop-1.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.1.15-desktop-1.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.1.15-desktop-1.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.1.15-desktop-1.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.1.15-desktop-1.mga5.img
        }
        menuentry 'Mageia, mit Linux 4.1.13-desktop-2.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.1.13-desktop-2.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 4.1.13-desktop-2.mga5 wird geladen …'
                linux   /boot/vmlinuz-4.1.13-desktop-2.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-4.1.13-desktop-2.mga5.img
        }
        menuentry 'Mageia, mit Linux 3.19.8-desktop-3.mga5' --class mageia --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.19.8-desktop-3.mga5-advanced-799cdaf8-b6af-4299-a6c9-c934027e3bdc' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod btrfs
                set root='hd3,msdos5'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  799cdaf8-b6af-4299-a6c9-c934027e3bdc
                else
                  search --no-floppy --fs-uuid --set=root 799cdaf8-b6af-4299-a6c9-c934027e3bdc
                fi
                echo    'Linux 3.19.8-desktop-3.mga5 wird geladen …'
                linux   /boot/vmlinuz-3.19.8-desktop-3.mga5 root=UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc ro  splash quiet nomodeset
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/initrd-3.19.8-desktop-3.mga5.img
        }
}

### 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_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Mageia 6 (auf /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-3e147ea5-32be-433c-9ebe-6556c4d300d8' {
        insmod part_msdos
        insmod btrfs
        set root='hd2,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  3e147ea5-32be-433c-9ebe-6556c4d300d8
        else
          search --no-floppy --fs-uuid --set=root 3e147ea5-32be-433c-9ebe-6556c4d300d8
        fi
        linux /boot/vmlinuz-4.9.28-desktop-1.mga6 root=/dev/sdc1
        initrd /boot/initrd-4.9.28-desktop-1.mga6.img
}
submenu 'Erweiterte Optionen für Mageia 6 (auf /dev/sdc1)' $menuentry_id_option 'osprober-gnulinux-advanced-3e147ea5-32be-433c-9ebe-6556c4d300d8' {
        menuentry 'Mageia 6 (auf /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.9.28-desktop-1.mga6--3e147ea5-32be-433c-9ebe-6556c4d300d8' {
                insmod part_msdos
                insmod btrfs
                set root='hd2,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  3e147ea5-32be-433c-9ebe-6556c4d300d8
                else
                  search --no-floppy --fs-uuid --set=root 3e147ea5-32be-433c-9ebe-6556c4d300d8
                fi
                linux /boot/vmlinuz-4.9.28-desktop-1.mga6 root=/dev/sdc1
                initrd /boot/initrd-4.9.28-desktop-1.mga6.img
        }
}

menuentry 'Windows 7 (loader) (auf /dev/sdd1)' --class windows --class os $menuentry_id_option 'osprober-chain-E4C06EF3C06ECAFE' {
        insmod part_msdos
        insmod ntfs
        set root='hd3,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  E4C06EF3C06ECAFE
        else
          search --no-floppy --fs-uuid --set=root E4C06EF3C06ECAFE
        fi
        parttool ${root} hidden-
        chainloader +1
}

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "mga6_chainload" {
     insmod part_msdos
     insmod btrfs
     insmod chain
     set root='hd2,msdos1'
     chainloader +1
}

menuentry "mga6_chainload_2" {
     insmod part_msdos
     insmod btrfs
     insmod chain
     set root=(hd2,1)
     search --no-floppy --fs-uuid --set 3e147ea5-32be-433c-9ebe-6556c4d300d8
     chainloader +1
}

menuentry "mga6_chainload_3" {
     insmod part_msdos
     insmod btrfs
     search --no-floppy --fs-uuid --set 3e147ea5-32be-433c-9ebe-6556c4d300d8
     configfile /boot/grub2/grub.cfg
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###

### BEGIN /etc/grub.d/93_memtest ###
### END /etc/grub.d/93_memtest ###
--------------------------------------------------------------------------------

=============================== sdd5/etc/fstab: ================================

--------------------------------------------------------------------------------
# Entry for /dev/sda5 :
UUID=799cdaf8-b6af-4299-a6c9-c934027e3bdc / btrfs noatime,discard,ssd,autodefrag,compress=lzo,space_cache,ssd_spread 1 1
# Entry for /dev/sda7 :
UUID=a6d498ba-009f-4ee0-8fee-1460f2622dba /home btrfs noatime,discard,ssd,autodefrag,compress=lzo,space_cache,ssd_spread 1 2
# Entry for /dev/sda1 :
UUID=E4C06EF3C06ECAFE /media/win_c ntfs-3g nofail,defaults,umask=000 0 0
# Entry for /dev/sda2 :
UUID=7CDA724CDA7202A6 /media/win_d ntfs-3g nofail,defaults,umask=000 0 0
none /proc proc defaults 0 0
# Entry for /dev/sda6 :
UUID=ec70e132-9c53-4851-a7cd-f89ba3c104b4 swap swap defaults 0 0
--------------------------------------------------------------------------------

=================== sdd5: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)


======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on sdc2

00000000  c8 78 23 48 3f 57 b7 e1  5c 14 b0 b3 7a ed e3 b7  |.x#H?W..\...z...|
00000010  dc ea 43 46 f7 fe 37 9d  22 ef 9a 48 26 c8 04 87  |..CF..7."..H&...|
00000020  4e 7a e7 3c 08 6d 14 aa  6e c0 6e 21 80 a3 b5 7f  |Nz.<.m..n.n!....|
00000030  f8 32 72 a3 a6 1f 5e 53  b3 d4 a7 10 42 a5 15 ef  |.2r...^S....B...|
00000040  65 b3 8b 58 0d 25 4c c0  ac a8 9b ae 40 0a bb 83  |e..X.%L.....@...|
00000050  4b fc 5a 8d 30 70 88 15  6d 21 ad 07 c7 b3 dd 00  |K.Z.0p..m!......|
00000060  5a d3 2b 5c 6a 9e 73 6c  56 59 48 ee 2f b3 75 9a  |Z.+\j.slVYH./.u.|
00000070  89 97 b9 4c bc f8 13 42  e4 74 9b e8 fc d0 e6 95  |...L...B.t......|
00000080  8e 97 9f af 9d 3b 97 23  7d 90 95 5a 88 a5 d9 98  |.....;.#}..Z....|
00000090  90 c1 a9 c9 e1 21 ec 17  f4 ff 3f 1f 07 c5 14 65  |.....!....?....e|
000000a0  aa 77 e0 d3 97 8c 03 63  6a 3b a6 86 1a 4d c0 da  |.w.....cj;...M..|
000000b0  74 2b c0 df 5d d7 86 11  8c 7b 77 a7 a9 5d c4 ce  |t+..]....{w..]..|
000000c0  ab 0a 3d ca 62 47 0f 82  9a cb 59 6b f6 5d 4a 62  |..=.bG....Yk.]Jb|
000000d0  7b c5 ab 05 82 a8 3a bf  8b 3c 6d 3f 0f 94 63 5c  |{.....:..<m?..c\|
000000e0  80 ec 1d 3c ce 09 c0 32  ea fb 0b a7 35 c4 e2 66  |...<...2....5..f|
000000f0  fa e9 2b d4 45 2e d9 db  c5 18 80 ff 39 21 0c 76  |..+.E.......9!.v|
00000100  1f 01 97 d8 fb a2 9b 5d  74 8a 7a f1 ec 06 36 54  |.......]t.z...6T|
00000110  e2 65 9b ad c8 b3 8a 26  47 62 85 ed 51 44 02 5b  |.e.....&Gb..QD.[|
00000120  b5 d9 91 d7 0f 61 db 32  3a 09 7b 81 5d f5 23 21  |.....a.2:.{.].#!|
00000130  18 eb a2 63 06 e8 77 2b  4c 12 aa 15 14 d4 53 71  |...c..w+L.....Sq|
00000140  14 f7 b7 98 4b e7 35 61  21 65 94 7e 1c 8b 11 9e  |....K.5a!e.~....|
00000150  b7 26 e2 fd a1 92 27 92  f4 c3 f0 04 c3 cf b2 9e  |.&....'.........|
00000160  64 5f 61 fd 1b e7 03 3e  f5 61 43 a1 46 ec ae 6a  |d_a....>.aC.F..j|
00000170  86 88 f9 11 68 85 07 78  13 e1 da 9d 1f b5 af ca  |....h..x........|
00000180  b3 fe c4 64 bd 93 a6 a9  4d 59 db 82 69 bd 7d 2f  |...d....MY..i.}/|
00000190  f2 41 f1 96 da a4 02 75  2e a1 d5 17 a0 93 d7 50  |.A.....u.......P|
000001a0  f6 a7 46 b5 4f 31 12 3f  b1 36 83 fa 86 f4 73 a6  |..F.O1.?.6....s.|
000001b0  56 af bb 14 db 32 79 79  bd d1 74 b0 ae c3 00 fe  |V....2yy..t.....|
000001c0  ff ff 83 fe ff ff 1b 00  00 00 94 9d 08 0e 00 00  |................|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200


=============================== StdErr Messages: ===============================

cat: /tmp/BootInfo-7Hq8TBVM/Tmp_Log: No such file or directory
cat: /tmp/BootInfo-7Hq8TBVM/Tmp_Log: No such file or directory
  No volume groups found

[doktor5000@Mageia5]─[13:38:06]─[~]


sdc contains the mga6 install
sdd contains a win7 and an mga5 install
sda & sdb are NTFS partitions for data storage

This is what I currently have for chainloading in /etc/grub.d/40_custom, only the third entry works as expected, the others only yield "invalid signature" errors ... although functionally they should all be the same ...

Code: Select all
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "mga6_chainload" {
     insmod part_msdos
     insmod btrfs
     insmod chain
     set root='hd2,msdos1'
     chainloader +1
}

menuentry "mga6_chainload_2" {
     insmod part_msdos
     insmod btrfs
     insmod chain
     set root=(hd2,1)
     search --no-floppy --fs-uuid --set 3e147ea5-32be-433c-9ebe-6556c4d300d8
     chainloader +1
}

menuentry "mga6_chainload_3" {
     insmod part_msdos
     insmod btrfs
     search --no-floppy --fs-uuid --set 3e147ea5-32be-433c-9ebe-6556c4d300d8
     configfile /boot/grub2/grub.cfg
}
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18050
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: grub2 chainload issues

Postby gohlip » Jun 12th, '17, 15:51

A quick reply. I'll catch up later on.

[1]
Chainloading to multiple disks is preferably to use drivemap, like this.



Code: Select all
menuentry "Chainloader"    {
    insmod part_msdos
    insmod ext2
    search --no-floppy  --label --set=root xxx
    drivemap -s (hd0) ${root}
    chainloader +1
}



[2]
We can also use multiboot as follows..

Code: Select all
menuentry "Multiboot"  {
               search --set=root --label xxx
               multiboot /boot/grub2/i386-pc/core.img
     }



[3]
As for configfile, your entry looks right, but beware about btrfs which may require /@boot/ (or /@/) instead of just /boot (or /).
Also because Mageia uses linux16 instead of just linux (& initrd16 instead of just initrd) , configfile may not work if booting other OS's, but since it is booting Mageia to Mageia, it may be due to different grub environments (grubenv) which is set just for that OS. But as you point out, it boots nevertheless.


Code: Select all
menuentry "Configfile" {
    insmod part_msdos
    insmod ext2
    search --no-floppy --label --set=root xxx
    configfile /boot/grub2/grub.cfg

}


[4]
I've used label in all the search above, you used (hdx,y) or /dev/sdxy.
Try to always use UUID (or Label) as bios may pick up the wrong device mapping each time it boots. Never reliable.

[5]
You put entries in 40_custom
Preferably to put into custom.cfg.
Create file custom.cfg and then put entries there.
No need to update-grub and changes won't override the entries.
Code: Select all
sudo touch /boot/grub2/custom.cfg


[EDIT]
[6] Best of all, which I prefer, boot directly the kernels (or sym-linked kernels) directly.

Code: Select all
[quote]menuentry 'Mageia   ' {
   insmod part_msdos
   insmod ext2
   set root='hd0,msdos2'
        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   linux   /boot/vmlinuz-desktop root=UUID=xxxxxxxxxxxxxxxxxxxxx ro splash quiet
   initrd   /boot/initrd-desktop.img
}

[/quote]


I'll come back later. Need to rush something.
Cheers.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: grub2 chainload issues

Postby doktor5000 » Jun 12th, '17, 16:41

Thanks for the quick reply, appreciated :D

gohlip wrote:[1]
Chainloading to multiple disks is preferably to use drivemap, like this.
Code: Select all
menuentry "Chainloader"    {
    insmod part_msdos
    insmod ext2
    search --no-floppy  --label --set=root xxx
    drivemap -s (hd0) ${root}
    chainloader +1
}



From what I understand this is only cosmetics, same thing like you would do with a device.map for grub legacy to always pretend that you are starting from hd0 / dev/sda1.
And I don't really like that as it just adds another layer of indirection.

gohlip wrote:[2]
We can also use multiboot as follows..

Code: Select all
menuentry "Multiboot"  {
               search --set=root --label xxx
               multiboot /boot/grub2/i386-pc/core.img
     }



Multiboot is a replacement for chainloading? What's the actual difference from using chainloading?

But as you mention core.img, this brings me to one other question. See the top of bootinfoscript:

============================= Boot Info Summary: ===============================
[...]
=> Grub2 (v1.99-2.00) is installed in the MBR of /dev/sdc and looks at sector
1 of the same hard drive for core.img, but core.img can not be found at
this location.

=> Grub2 (v1.99) is installed in the MBR of /dev/sdd and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
in partition 129 for .

Seems grub2 is installed in the MBR, whereas it should actually be installed in the / partition which is /dev/sdc1.
Would it be sufficient if I boot into mga6, and then run the following to ensure that core.img is at the right place?
Code: Select all
grub-install --force /dev/sdc1



gohlip wrote:[3]
As for configfile, your entry looks right, but beware about btrfs which may require /@boot/ (or /@/) instead of just /boot (or /).
Also because Mageia uses linux16 instead of just linux (& initrd16 instead of just initrd) , configfile may not work if booting other OS's, but since it is booting Mageia to Mageia, it may be due to different grub environments (grubenv) which is set just for that OS. But as you point out, it boots nevertheless.

Hmmm, I don't see linux16 or initrd16 in my grub.cfg. Maybe that is just with grub2-efi ?

gohlip wrote:[5]
You put entries in 40_custom
Preferably to put into custom.cfg.
Create file custom.cfg and then put entries there.
No need to update-grub and changes won't override the entries.
Code: Select all
sudo touch /boot/grub2/custom.cfg

From adding or changing entries in 40_custom it always required and update-grub afterwards, you're saying this should not be the case and custom.cfg is parsed directly on each boot?
Thanks, will have a look at that.

gohlip wrote:[6] Best of all, which I prefer, boot directly the kernels (or sym-linked kernels) directly.

This is exactly what I'm trying to avoid, as the master grub2 will not pickup any changed default boot options from the other grub2 as it seems os-prober does not care about /etc/default/grub
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18050
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: grub2 chainload issues

Postby gohlip » Jun 12th, '17, 17:32

[1]
From what I understand this is only cosmetics, same thing like you would do with a device.map for grub legacy to always pretend that you are starting from hd0 / dev/sda1.
And I don't really like that as it just adds another layer of indirection.

No, it is not cosmetics. drivemap is required and makes certain chainload works in multiple devices. That 'layer' is necessary.

[2]
Multiboot is a replacement for chainloading? What's the actual difference from using chainloading?

No, it is not a replacement. core.img (and core.efi) is like the stage 1.5 of grub-legacy.
Grub2 being multiboot compliant (you can boot grub2 OS's off syslinux, grub-legacy, bootctl, refind...) and it is like uhm... putting into gear after the engine has started.
Chainload is starting the engine once more. :D . Sorry, cannot explain better at this time. Just that it is like going to stage 1.5 of grub-legacy from the other boots.

[3]
Hmmm, I don't see linux16 or initrd16 in my grub.cfg. Maybe that is just with grub2-efi ?

Okay, then you won't have any issue with this. But grubenv is different with each OS. Also reminder to watch for /@/ and /@boot/ for all things btrfs.
Not just for configfile, but anything that needs to specify partition/location for btrfs partitions and sub-partitions.
I don't use btrfs now (tested once) for OS partition so just watch out for it.

[5]
Entries in custom.cfg is automatically pulled in by grub.cfg. Look into grub.cfg. There is a 'stanza?' there that pulls in automatically.
And if the entries are wrong, it does nothing to grub operations, unlike putting into 40_custom which needs to be 'accurate' and is also dangerous to amend.

Code: Select all
### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi



[6]
Ah.. this is where I stand strongly.
Being in custom.cfg (or 40_custom) it does not need os-prober to work and Mageia generates sym-links (2, in fact. :o ) that we can always use it to boot all the time without modifying the entry after each kernel update.
And the thing that I like most, it boots directly (without changing gears or starting engine). I also boot windows directly, without chainload, just by using ntldr.


But we still need to find out why your os-prober does not pick up your other Mageia. It could be the disk is not active for some time. Inactive spinning disks do 'sleep' to conserve energy. Click on the partition and then try command 'sudo os-prober' again to see if that picks up. If it does, do update-grub one more time. Hope we find out what's causing this. Let us know if you do, ya.

Good luck, doktor5000 and Cheers.

[edit] - sorry, I missed this.
but core.img can not be found at this location.

Whenever there's an error in partition, like moving, resizing partitions, core.img can be lost or corrupted because it is located at the first sector of the partition (mbr is the first sector of the device).
We can regenerate this by the usuall 'grub-install' command or more 'surgically' (version 2.02 beta3 and later) with "grub-install --no-bootsector".
When this is corrupted, we cannot use multiboot but configfile, chainload, direct boot will all boot okay.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: grub2 chainload issues

Postby doktor5000 » Jun 14th, '17, 20:04

gohlip wrote:But we still need to find out why your os-prober does not pick up your other Mageia. It could be the disk is not active for some time. Inactive spinning disks do 'sleep' to conserve energy. Click on the partition and then try command 'sudo os-prober' again to see if that picks up. If it does, do update-grub one more time. Hope we find out what's causing this. Let us know if you do, ya.

The problem is not about that the mga6 entries are not picked up, they are all generated as expected, and they also work as far as grub is concerned, the boot fails much later on with either missing keyboard, X not starting and no tty available.
The problem with this is those are just the bare linux & initrd entries but the default options from e.g. GRUB_CMDLINE_LINUX_DEFAULT from /etc/default/grub are not being applied and hence due to missing options like nomodeset, noiswmd or such (depending on the hardware used) this causes issues, hence I first want to chainload so I can use the actual entries that are generated within the target system.

Afterwards when the target system itself is running as expected I can still take a look if the parsing of /etc/default/grub by os-prober is working or if it could be workarounded in some other way.

gohlip wrote:[edit] - sorry, I missed this.
but core.img can not be found at this location.

Whenever there's an error in partition, like moving, resizing partitions, core.img can be lost or corrupted because it is located at the first sector of the partition (mbr is the first sector of the device).
We can regenerate this by the usuall 'grub-install' command or more 'surgically' (version 2.02 beta3 and later) with "grub-install --no-bootsector".
When this is corrupted, we cannot use multiboot but configfile, chainload, direct boot will all boot okay.

Did not try multiboot yet. But configfile works, although chainload does not. Direct boot also works as far as grub is concerned.
So seems I need to also check the location of core.img/core.efi on the mga6 root partition.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18050
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: grub2 chainload issues

Postby gohlip » Jun 14th, '17, 23:18

..... and hence due to missing options like nomodeset, noiswmd or such (depending on the hardware used) this causes issues, hence I first want to chainload so I can use the actual entries that are generated within the target system.

My M6 defaults to not using nomodeset or noiswmd. And it boots without.
Though one member (in a earlier topic) reports he needs nomodeset to boot properly.

Configfile, chainload and multiboot uses the same parameters as the OS being booted, not where the original (start) grub came from. They should behave as though it is booting from the OS grub itself.
I just tested all configfile, chainload and multiboot from another grub to boot Magiea 6. All works as it should.

[4]
I've used label in all the search above, you used (hdx,y) or /dev/sdxy.
Try to always use UUID (or Label) as bios may pick up the wrong device mapping each time it boots. Never reliable.


In multiple disks, it is important you should use UUID, not (hdx,y) or /dev/sdxy.

Code: Select all
    search  --fs-uuid --set=root  xxxxxxxxxxxxxxxxxxxxxxxxx
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: grub2 chainload issues

Postby doktor5000 » Jun 14th, '17, 23:51

gohlip wrote:Configfile, chainload and multiboot uses the same parameters as the OS being booted, not where the original (start) grub came from. They should behave as though it is booting from the OS grub itself.
I just tested all configfile, chainload and multiboot from another grub to boot Magiea 6. All works as it should.

Well, when I checked /proc/cmdline in the booted mga6 the important stuff was missing, so grub didn't pick this up, neither with direct boot nor with configfile.

In multiple disks, it is important you should use UUID, not (hdx,y) or /dev/sdxy.

Code: Select all
    search  --fs-uuid --set=root  xxxxxxxxxxxxxxxxxxxxxxxxx

Yep, that's what I ended up using for configfile which is working, although that same stanze didn't work for chainloader +1, so seems really that core.img is missing somehow at the place where grub is looking.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18050
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: grub2 chainload issues

Postby gohlip » Jun 15th, '17, 02:07

Well, when I checked /proc/cmdline in the booted mga6 the important stuff was missing, so grub didn't pick this up, neither with direct boot nor with configfile.

I rechecked, all of parameters in M6 /etc/default were in /proc/cmdline. whether configfile, multiboot or chainload.
I has happened to the best of us, but did you forget to update-grub (grub2-mkconfig -o xxxx) after changing /etc/default/grub?
Perhaps you 'update-grub' (not update-grub2) which applies to grub-legacy (not grub 2) in Mageia?

Re core.img - any grub2-install (not grub-install in Mageia) whether it is to partition (/dev/sdxy) or to mbr (/dev/sdx) will fix corrupted core.img.
And there's no harm in redoing as many times grub2-install or grub2-mkconfig.

Other than that, it would be strange why your grub parameters are not 'transmitted' through configfile, chainload or multiboot.
But cheers, take care.

[Edit] - The originating grub and the target grub (Mageia) must both be of the same boot mode.
Meaning both must be in bios-legacy or both in UEFI.
Command syntax for multiboot and chainload are different in uefi and bios-legacy.
But same in configfile.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: grub2 chainload issues

Postby gohlip » Jun 15th, '17, 03:17

[Edit] - The originating grub and the target grub (Mageia) must both be of the same boot mode.
Meaning both must be in bios-legacy or both in UEFI.
Command syntax for multiboot and chainload are different in uefi and bios-legacy.
But same in configfile.


Aha!, After writing above, it got me checking and found...
sda and sdb are both gpt.
sdc and sdd are both msdos


Which means you're mixing uefi and bios-legacy.
Multiboot and chainload won't work cross platform.
Configfile and direct booting can work (but still not recommended).

Also, a uefi grub cannot boot a bios-legacy windows.
And a bios-legacy grub cannot boot a uefi windows.

My personal suggestions.
o Never mix uefi and bios-legacy
o Never mix gpt and msdos
o When msdos, use bios-legacy
o When gpt, use uefi.

Notes: Following are grub entries for UEFI, Notice the differences with bios-legacy
And are used to boot UEFI target OS's, not bios-legacy OS's

Code: Select all
menuentry "Chainload" {
        insmod chain
        insmod fat
        search --no-floppy --label --set=root GINT
        chainloader /EFI/pop/grubx64.efi
}


menuentry "Multiboot " {
    insmod part_gpt
    insmod ext2
    insmod chain
    search --set=root --label xxx
    chainloader /boot/grub/x86_64-efi/core.efi
}


But configfile is the same

Code: Select all
menuentry "Configfile " {
    insmod part_gpt
    part part_msdos
    insmod ext2
    search --no-floppy --label --set=root xxx
    configfile /boot/grub/grub.cfg
}


A complaint, doktor5000.
You should have mentioned this right from the start instead of 'hiding it in plain sight' in bootinfo script.
The 'gpt' mentions are simple one liners in the long script and is easily missed.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: grub2 chainload issues

Postby doktor5000 » Jun 15th, '17, 19:55

gohlip wrote:Aha!, After writing above, it got me checking and found...
sda and sdb are both gpt.
sdc and sdd are both msdos

Which means you're mixing uefi and bios-legacy.


No I don't. Only because the two 3TB drives use GPT partitioning does not mean that I use UEFI.
Also those two drives are for windows, and are totally irrelevant for the Mageia boot issues.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18050
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: grub2 chainload issues

Postby gohlip » Jun 15th, '17, 22:34

Only because the two 3TB drives use GPT partitioning does not mean that I use UEFI.
Okay. noted. But I still don't know it did not work for you.
I also tested Mageia grub (multiboot,chainload) on other OS grub (I had a single Mageia - M6). It worked.
Cheers.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest

cron