Cannot boot Windows: "invalid efi path"

I have a desktop computer, on one disk of which Windows 7 is installed. Opensuse is on another disk. The computer uses UEFI.

I could boot both OSes with opensuse 13.2, but with Leap I get a message “invalid efi path”

The file /etc/grub.d/40_custom contains

menuentry 'Windows 7' --class windows --class os $menuentry_id_option 'osprober-chain-6ECA89E0CA89A545' {
        insmod part_msdos 
        insmod part_gpt
        insmod ntfs
        insmod fat

        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 --hint='hd3,msdos1'  6ECA89E0CA89A545
        else
          search --no-floppy --fs-uuid --set=root 6ECA89E0CA89A545
        fi
        
        echo
        echo $root
        echo
        
        chainloader +1
}

These lines are transferred into /boot/grub2/grub.cfg. I believe root is found correctly as hd3,msdos1, which is one of Windows’s partitions.

Directory /boot/efi contains directories EFI/boot and EFI/opensuse, which contain a bucnch of .efi files.

I have read that chainloader +1 may not work and in that case needs to be replaced by something like
chainloader (${root})/efi/…

How shall I proceed to correct this trouble?

That “40_custom” that you quoted looks as if it is for legacy MBR booting rather than UEFI booting.

I think you have Windows installed for legacy booting, but you managed to install opensuse for EFI booting.

The two don’t mix.

Can somebody tell me: In the code below, what do root and +1 mean?

Does root point to the bootable Windows partition? Or does it point to /boot/efi? Or to something else?

menuentry 'Windows 7' --class windows --class os $menuentry_id_option 'osprober-chain-6ECA89E0CA89A545' {
        insmod part_msdos 
        insmod part_gpt
        insmod ntfs
        insmod fat

        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 --hint='hd3,msdos1'  6ECA89E0CA89A545
        else
          search --no-floppy --fs-uuid --set=root 6ECA89E0CA89A545
        fi
        
        echo
        echo $root
        echo
        
        chainloader +1
}

Again - this code is for booting Windows in legacy BIOS mode; you are booting openSUSE in EFI mode. You cannot use this code to boot Windows. And you cannot boot Windows in EFI mode because for this you need Windows bootloader on ESP and you do not have it.

The simplest solution is to change how you boot openSUSE (i.e. to switch it to legacy BIOS mode). If you consider it, please post “fdisk -l” output to show your current partition table and “blkid” output to check UUIDs.

I used to have this setup working (booting opensuse and Windows 7) with opensuse 13.2. I believe I used grub2.

Most likely, during installation of Leap I reformatted the /boot/efi or /boot. But I don’t remember.

How can I put the Windows’s bootloader on ESP? Is it a matter of copying files? I can mount Windows 7’s partitions and copy files from there. This is the path I would like to go if possible.

Shall I change motherboard’s settings for this?

Here are outputs of disk-related commands, with some information removed. /dev/sdb4 is data storage, not an OS. Opensuse OS is entirely on /dev/sda

fdisk -l


Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 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
Disklabel type: dos
Disk identifier: 0x..d3

Device     Boot     Start        End   Sectors   Size Id Type
/dev/sdb1  *         2048     206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sdb2          206848  839072951 838866104   400G  7 HPFS/NTFS/exFAT
/dev/sdb3       839073792  964911103 125837312    60G  c W95 FAT32 (LBA)
/dev/sdb4       964911104 1953523711 988612608 471.4G 83 Linux




Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 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
Disklabel type: gpt
Disk identifier: ..2F

Device         Start       End  Sectors  Size Type
/dev/sda1       2048    610303   608256  297M EFI System
/dev/sda2     610304   2715647  2105344    1G EFI System
/dev/sda3    2715648  48852991 46137344   22G Microsoft basic data
/dev/sda4   48852992 103378943 54525952   26G Microsoft basic data
/dev/sda5  103378944 136937471 33558528   16G Microsoft basic data
/dev/sda6  136937472 199848011 62910540   30G Microsoft basic data

GPT PMBR size mismatch (10701336 != 1565565871) will be corrected by w(rite).

blkid


/dev/sdb1: LABEL="System Reserved" UUID="6ECA89E0CA89A545" TYPE="ntfs" PARTUUID="494d34d3-01" 
/dev/sdb2: UUID="26788C4E788C1EA5" TYPE="ntfs" PARTUUID="494d34d3-02" 
/dev/sdb3: UUID="BF3B-1FF5" TYPE="vfat" PARTUUID="494d34d3-03" 
/dev/sdb4: UUID="79a25781-0f45-41b4-ad37-69f35f231a8c" TYPE="ext4" PARTUUID="494d34d3-04" 


/dev/sda1: SEC_TYPE="msdos" UUID="22A0-696F" TYPE="vfat" PARTLABEL="primary" PARTUUID="fd26a45c-8e5e-4dd1-9191-1cfa14715ce3" 
/dev/sda2: UUID="787889e3-ce01-4a27-86dc-a4428a953f5b" TYPE="ext4" PARTLABEL="primary" PARTUUID="d767d397-c7ec-4838-bcd6-888b79fae1e0" 
/dev/sda3: UUID="0b48cc99-4798-41e9-9bd3-48bdb7361567" TYPE="swap" PARTLABEL="primary" PARTUUID="4a7201d0-9e48-47f2-be45-86e25344d742" 
/dev/sda4: UUID="28a034e6-9e05-497c-92c7-34a4d74f4bbd" TYPE="ext4" PARTLABEL="primary" PARTUUID="3686b140-4afe-4ab1-b8a0-9c8ec3175e69" 
/dev/sda5: UUID="01f06fd1-7735-471d-aa69-c6e73c72462d" TYPE="ext4" PARTLABEL="primary" PARTUUID="178d6a6a-3092-4eb9-9b63-17d7a2441d98" 
/dev/sda6: UUID="35d77622-b583-496e-93dd-eba373537cb2" TYPE="ext4" PARTLABEL="primary" PARTUUID="82e97f6d-1dab-41be-8165-29994c7b111b" 

I would say by booting from Windows installation CD and running boot recovery. There is more than just files there, Windows bootloader configuration is also kept on ESP and must be recreated.
But I strongly advice to change /dev/sda2 partition type to something different than ESP; Windows gets very confused when it sees two ESP and bootloader recovery fails. /dev/sda2 cannot be ESP because it contains ext4 filesystem.

Device Start End Sectors Size Type
/dev/sda1 2048 610303 608256 297M EFI System
/dev/sda2 610304 2715647 2105344 1G EFI System
/dev/sda1: SEC_TYPE=“msdos” UUID=“22A0-696F” TYPE=“vfat” PARTLABEL=“primary” PARTUUID=“fd26a45c-8e5e-4dd1-9191-1cfa14715ce3”
/dev/sda2: UUID=“787889e3-ce01-4a27-86dc-a4428a953f5b” TYPE=“ext4” PARTLABEL=“primary” PARTUUID=“d767d397-c7ec-4838-bcd6-888b79fae1e0”

Thank you. I changed: removed EFI booting; now works.

Man, I spent two days. One of the reasons is that os-prober didn’t work.