Double foreign OS entry - how to get rid of one?

Dual boot LEAP 42.3 & W7, non UEFI.

Grub menu show two entries for W7: on /sda1 and /sda2. Both work. /sda1 is windows’ system reserved partition and /sda2 is C:

 # fdisk -l 
Disco /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 setores 
Unidades: setor de 1 * 512 = 512 bytes 
Tamanho de setor (lógico/físico): 512 bytes / 4096 bytes 
Tamanho E/S (mínimo/ótimo): 4096 bytes / 4096 bytes 
Tipo de rótulo do disco: dos 
Identificador do disco: 0x000a9419  
Dispositivo Inicializar    Início        Fim    Setores Tamanho Id Tipo
/dev/sda1   *                2048     206847     204800    100M  7 HPFS/NTFS/exFAT 
/dev/sda2                  206848  629350399  629143552    300G  7 HPFS/NTFS/exFAT 
/dev/sda3               629350400  692264959   62914560     30G  7 HPFS/NTFS/exFAT 
/dev/sda4               692264960 1953523711 1261258752  601,4G  f Estendida W95 (LBA)
/dev/sda5               692267008  709044223   16777216      8G 82 Linux swap / Solaris 
/dev/sda6               709046272  813901823  104855552     50G 83 Linux 
/dev/sda7               813903872 1953503231 1139599360  543,4G 83 Linux

In Yast’s bootloader module, tab boot code options*, boot from MBR is selected (obviously, from above). Other options are not.
In tab bootloader options*, test foreign SO is checked.

  • Translated from pt_BR, so probably not accurate.

IINM the /sda2 menu boot option is from an earlier installation, or perhaps it’s /sda1.

This is just a cosmetic issue, since both entries work, but how do I get rid of one of them without borking something in the bootloader? I knew how to do this with grub legacy, but grub2 is different monster altogether :slight_smile:

Yast -boot loader should do it

Yes, that happens here, except that it is “sda2” and “sda3”. (“sda1” was a small vendor partition that I stole for “/boot”).

If you are using “grub2”, then this is happening because “os-prober” is finding both ways of booting Windows 7.

I’m just putting up with it.

For grub2, the way to deal with that is to find the boot code (in “/boot/grub2/grub.cfg”) and enter it somewhere in “/etc/grub.d/40_custom”. You will now have 3 entries for Windows. But then you can turn off the “probe foreign os” in Yast bootloader, and you will be back to the one entry from “40_custom”.

Could you elaborate? There’s no obvious setting to change. Maybe changing “boot from MBR” to “root”? (but I think that’s not it)


Ah, makes sense. Thank you very much!

Yes, that would be more practical.