Opensuse and Widows 10 installed on first hard disk, grub2 in efi boots both systemas.
I add a second hard drive, install other opensuse, with grub in linux partition and other windows in it.
Grub2 is not capable of booting them. It recognizes them, adds them to the boot menu, but when booting I always have an error.
When booting windows the error is this
and if trying to boot linux, this
As far as I have found it is a problem of the OS thinking that they are in the first drive when booting, and to solve the problem I have found in a lot o places to add this line with drivemap in grub configuration (/etc/grub.d/38_custom)
#!/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 "Windows second disk" {
insmod part_gpt
insmod fat
drivemap -s hd0 hd1
search --no-floppy --fs-uuid --set=root 647D-D3A4
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
and for the linux grub installed in part5 of the second disk something like this (/etc/grub.d/39_custom)
#!/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 "Second Disk grub" {
insmod part_gpt
set root='hd2,gpt5'
drivemap -s hd1 hd2
chainloader (hd2)+1
}
I can generate and install grub2 configuration in efi
localhost:~ # grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found theme: /boot/grub2/themes/openSUSE/theme.txt
Found linux image: /boot/vmlinuz-6.4.0-150600.23.22-default
Found initrd image: /boot/initrd-6.4.0-150600.23.22-default
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
localhost:~ # shim-install --config-file=/boot/grub2/grub.cfg
copying /usr/share/efi/x86_64/grub.efi to /boot/efi/EFI/opensuse/grub.efi
Installing for x86_64-efi platform.
Installation finished. No error reported.
BootCurrent: 0008
Timeout: 2 seconds
BootOrder: 0006,0005,0004,0000,0001,0002,0003,0007
Boot0000* EFI VMware Virtual NVME Namespace (NSID 1)
Boot0001* EFI VMware Virtual SATA CDROM Drive (1.0)
Boot0002* EFI Network
Boot0003* EFI Internal Shell (Unsupported option)
Boot0004* Windows Boot Manager
Boot0005* Windows Boot Manager
Boot0006* opensuse
Boot0007* EFI VMware Virtual NVME Namespace (NSID 2)
BootCurrent: 0008
Timeout: 2 seconds
BootOrder: 0008,0006,0005,0004,0000,0001,0002,0003,0007
Boot0000* EFI VMware Virtual NVME Namespace (NSID 1)
Boot0001* EFI VMware Virtual SATA CDROM Drive (1.0)
Boot0002* EFI Network
Boot0003* EFI Internal Shell (Unsupported option)
Boot0004* Windows Boot Manager
Boot0005* Windows Boot Manager
Boot0006* opensuse
Boot0007* EFI VMware Virtual NVME Namespace (NSID 2)
Boot0008* opensuse-secureboot
localhost:~ #
But when booting I get a error from grub2
But this is in gnu-grub 2.12 manual
Is drivemap removed from opensuse grub2?