I wanted to install Windows 8.1 on my sda and openSuSE 13.2 on sdb. I can’t remember all the steps I tried but the final step to get things working correctly was a manual adjustment to the grub.cfg file created by grub2-mkconfig. grub2 documentation is still somewhat sparse but I found articles on http://ordinatechnic.com/general-guides/grub-for-efi-systems
and https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/
System_Administrators_Guide/ch-Working_with_the_GRUB_2_Boot_Loader.html)
helpful, in particular the comment that
Statement 1:doing an EFI boot grub2 will read its grub.cfg from the EFI System Partition (EFI/opensuse/grub.cfg), not from /boot/grub2/grub.cfg.
My system looked likesda - GPT partitioned with protective MBR (for Windows 8.1)
[INDENT=2]sda1 - Windows 8.1 on sda1 Windows 8.1 - GPT partitioning and secure boot
sda2 - theEFI System Partition sda6 - openSuse 13.2
sda6 - openSuSE 13.2
[/INDENT]
sbd - GPT partitioned with hybrid MBR (selected by openSuSE install)
[INDENT=2]sdb1 - openSuSE 13.2
[/INDENT]
I think the old MBR scheme with its ‘extended partition’ is clumsy compared to the much cleaner GPT scheme so I got rid of the hybrid MBR running gdisk expert menu -n option.
With sdb1 as root and having mounted the EFI System Partition on /boot/efi running
grub2-mkconfig -o /boot/efi/EFI/opensuse grub
created a config file with the grub2 menuentry for booting from sdb1 executing linux and initrd commands.
...
menuentry 'openSUSE' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cb726bc4-faee-4de8-b5e5-77b40cbe0ae6' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1 --hint='hd0,gpt1' cb726bc4-faee-4de8-b5e5-77b40cbe0ae6
else
search --no-floppy --fs-uuid --set=root cb726bc4-faee-4de8-b5e5-77b40cbe0ae6
fi
echo 'Loading Linux 3.16.7-21-desktop ...'
linux /boot/vmlinuz-3.16.7-21-desktop root=UUID=cb726bc4-faee-4de8-b5e5-77b40cbe0ae6 quiet resume=/dev/sdb10 splash=silent quiet showopts
echo 'Loading initial ramdisk ...'
initrd /boot/initrd-3.16.7-21-desktop
}
...
menuentry 'openSUSE 13.2 (x86_64) (on /dev/sda6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-eeab051c-993a-4ed3-8230-267a2e94c6d8' {
insmod part_gpt
insmod ext2
set root='hd1,gpt6'
if x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6 --hint='hd1,gpt6' eeab051c-993a-4ed3-8230-267a2e94c6d8
else
search --no-floppy --fs-uuid --set=root eeab051c-993a-4ed3-8230-267a2e94c6d8
fi
linux /boot/vmlinuz-3.16.6-2-desktop root=UUID=eeab051c-993a-4ed3-8230-267a2e94c6d8 ro BOOT_IMAGE=/boot/x86_64/loader/linux ramdisk_size=512000 ramdisk_blocksize=4096 resume=/dev/disk/by-uuid/3c71e2fd-afc5-47df-bc50-0d76e6d26a65 splash=silent quiet showopts
initrd /boot/initrd-3.16.6-2-desktop
}
That didn’t work. Manually editing the commands to linuxefi and initrdefi does work. I have never seen any documentation (yet) about the linuxefi and initrdefi but assume they imply some kind of booting using a GPT partition rather than MBR. If so then:
Statement 2It would seem logical that grub2-mkconfig seeing a root device on a GPT partitioned disk with a protective MBR should the generate linuxefi and inirdefi commands for the grub.cfg file
Could someone comment whether statements 1 and/or 2 are correct.
If 2 is correct, is grub2-mkconfig behaviour a openSuSE or a grub problem?
Finally, what is the difference between .mod and .module as in /usr/lib/grub2/x86_64-efi/ntfs.mod /usr/lib/grub2/x86_64-efi/ntfs.module
Appreciate any comments.
Enno