[Bug 2129422] [NEW] os-prober fail to detect windows 11 2025H2
Nicola Lunghi
2129422 at bugs.launchpad.net
Wed Oct 22 01:11:11 UTC 2025
Public bug reported:
```
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.3 LTS
Release: 24.04
Codename: noble
os-prober version: 1.81ubuntu4
```
os-prober cannot find windows efi partition with windows 11
```
$/usr/lib/os-probes/mounted/efi/20microsoft /boot/efi
$
```
new windows 11 has a different efi layout and there's a /boot/efi/EFI
partition that is the new root
```
tree /boot/efi
/boot/efi
├── $RECYCLE.BIN
│ └── desktop.ini
├── EFI
│ ├── Boot
│ │ ├── bootx64.efi
│ │ ├── fbx64.efi
│ │ └── mmx64.efi
│ ├── Microsoft
│ │ ├── Boot
│ │ │ ├── BCD
│ │ │ ├── BCD.LOG
│ │ │ ├── BCD.LOG1
│ │ │ ├── BCD.LOG2
│ │ │ ├── bg-BG
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── bootmgfw.efi
│ │ │ ├── bootmgr.efi
│ │ │ ├── BOOTSTAT.DAT
│ │ │ ├── boot.stl
│ │ │ ├── CIPolicies
│ │ │ │ └── Active
│ │ │ │ ├── {5DAC656C-21AD-4A02-AB49-649917162E70}.cip
│ │ │ │ ├── {82443e1e-8a39-4b4a-96a8-f40ddc00b9f3}.cip
│ │ │ │ └── {CDD5CB55-DB68-4D71-AA38-3DF2B6473A52}.cip
│ │ │ ├── cs-CZ
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── da-DK
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── de-DE
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── el-GR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── en-GB
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── en-US
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── es-ES
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── es-MX
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── et-EE
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── fi-FI
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── Fonts
│ │ │ │ ├── chs_boot.ttf
│ │ │ │ ├── cht_boot.ttf
│ │ │ │ ├── jpn_boot.ttf
│ │ │ │ ├── kor_boot.ttf
│ │ │ │ ├── malgun_boot.ttf
│ │ │ │ ├── malgunn_boot.ttf
│ │ │ │ ├── meiryo_boot.ttf
│ │ │ │ ├── meiryon_boot.ttf
│ │ │ │ ├── msjh_boot.ttf
│ │ │ │ ├── msjhn_boot.ttf
│ │ │ │ ├── msyh_boot.ttf
│ │ │ │ ├── msyhn_boot.ttf
│ │ │ │ ├── segmono_boot.ttf
│ │ │ │ ├── segoen_slboot.ttf
│ │ │ │ ├── segoe_slboot.ttf
│ │ │ │ └── wgl4_boot.ttf
│ │ │ ├── fr-CA
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── fr-FR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── hr-HR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── hu-HU
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── it-IT
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── ja-JP
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── kd_02_10df.dll
│ │ │ ├── kd_02_10ec.dll
│ │ │ ├── kd_02_1137.dll
│ │ │ ├── kd_02_1414.dll
│ │ │ ├── kd_02_14e4.dll
│ │ │ ├── kd_02_15ad.dll
│ │ │ ├── kd_02_15b3.dll
│ │ │ ├── kd_02_1969.dll
│ │ │ ├── kd_02_19a2.dll
│ │ │ ├── kd_02_1af4.dll
│ │ │ ├── kd_02_8086.dll
│ │ │ ├── kd_07_1415.dll
│ │ │ ├── kd_0C_8086.dll
│ │ │ ├── kdnet_uart16550.dll
│ │ │ ├── kdstub.dll
│ │ │ ├── ko-KR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── lt-LT
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── lv-LV
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── memtest.efi
│ │ │ ├── nb-NO
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── nl-NL
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── pl-PL
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── pt-BR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── pt-PT
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── qps-ploc
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── qps-plocm
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── Resources
│ │ │ │ ├── bootres.dll
│ │ │ │ └── en-US
│ │ │ │ └── bootres.dll.mui
│ │ │ ├── ro-RO
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── ru-RU
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── SecureBootRecovery.efi
│ │ │ ├── sk-SK
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── sl-SI
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── sr-Latn-RS
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── sv-SE
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── tr-TR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── uk-UA
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── winsipolicy.p7b
│ │ │ ├── zh-CN
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ └── zh-TW
│ │ │ ├── bootmgfw.efi.mui
│ │ │ ├── bootmgr.efi.mui
│ │ │ └── memtest.efi.mui
│ │ └── Recovery
│ │ ├── BCD
│ │ ├── BCD.LOG
│ │ ├── BCD.LOG1
│ │ └── BCD.LOG2
│ └── ubuntu
│ ├── BOOTX64.CSV
│ ├── grub.cfg
│ ├── grubx64.efi
│ ├── mmx64.efi
│ └── shimx64.efi
└── System Volume Information
├── IndexerVolumeGuid
└── WPSettings.dat
51 directories, 156 files
```
current os-prober microsoft script
```
$cat /usr/lib/os-probes/mounted/efi/20microsoft
#!/bin/sh
# Detects Microsoft bootloader on a EFI System Partition
. /usr/share/os-prober/common.sh
efi="$1"
found=
for microsoft in $(item_in_dir microsoft "$efi"); do
for boot in $(item_in_dir boot "$efi/$microsoft"); do
bcd=$(item_in_dir bcd "$efi/$microsoft/$boot")
bootmgfw=$(item_in_dir bootmgfw.efi "$efi/$microsoft/$boot")
if [ -n "$bcd" -a -n "$bootmgfw" ]; then
long="Windows Boot Manager"
short=Windows
path="$microsoft/$boot/$bootmgfw"
found=true
break
fi
done
done
if [ -n "$found" ]; then
label="$(count_next_label "$short")"
result "${path}:${long}:${label}"
fi
exit 0
```
I've updated the script to fix this
```
#!/bin/sh
partition="$1"
mpoint="$2"
type="$3"
if [ "$type" = vfat ]; then
for base in "$mpoint" "$mpoint/EFI"; do
if [ -d "$base" ]; then
for microsoft in $(ls -d "$base"/[mM][iI][cC][rR][oO][sS][oO][fF][tT] 2>/dev/null); do
microsoft=$(basename "$microsoft")
for boot in $(ls -d "$base/$microsoft"/[bB][oO][oO][tT] 2>/dev/null); do
boot=$(basename "$boot")
if [ -f "$base/$microsoft/$boot/bootmgfw.efi" ] && [ -f "$base/$microsoft/$boot/bcd" ]; then
if grep -aqs "W.i.n.d.o.w.s. .1.1" "$base/$microsoft/$boot/bcd"; then
long="Windows 11"
elif grep -aqs "W.i.n.d.o.w.s. .1.0" "$base/$microsoft/$boot/bcd"; then
long="Windows 10"
elif grep -aqs "W.i.n.d.o.w.s. .8" "$base/$microsoft/$boot/bcd"; then
long="Windows 8"
elif grep -aqs "W.i.n.d.o.w.s. .7" "$base/$microsoft/$boot/bcd"; then
long="Windows 7"
elif grep -aqs "W.i.n.d.o.w.s. .V.i.s.t.a" "$base/$microsoft/$boot/bcd"; then
long="Windows Vista"
elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$base/$microsoft/$boot/bcd"; then
long="Windows Server 2008 R2"
elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$base/$microsoft/$boot/bcd"; then
long="Windows Server 2008"
elif grep -aqs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$base/$microsoft/$boot/bcd"; then
long="Windows Recovery Environment"
elif grep -aqs "W.i.n.d.o.w.s. .S.e.t.u.p" "$base/$microsoft/$boot/bcd"; then
long="Windows Recovery Environment"
else
long="Windows Boot Manager"
fi
if [ "$base" = "$mpoint" ]; then
echo "$partition:$long:Windows:efi"
else
echo "$partition:$long:Windows:efi"
fi
exit 0
fi
done
done
fi
done
fi
if [ "$type" = fuseblk ] || [ "$type" = ntfs ]; then
if [ -f "$mpoint/Windows/System32/winload.exe" ]; then
echo "$partition:Windows 11:Windows:chain"
exit 0
fi
fi
exit 1
```
** Affects: os-prober (Ubuntu)
Importance: Undecided
Status: New
** Description changed:
+ ```
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.3 LTS
Release: 24.04
Codename: noble
os-prober version: 1.81ubuntu4
-
-
+ ```
os-prober cannot find windows efi partition with windows 11
- /usr/lib/os-probes/mounted/efi/20microsoft /boot/efi
-
-
- new windows 11 has a different efi layout and there's a /boot/efi/EFI partition that is the new root
-
-
+
+ ```
+ $/usr/lib/os-probes/mounted/efi/20microsoft /boot/efi
+ $
+ ```
+
+ new windows 11 has a different efi layout and there's a /boot/efi/EFI
+ partition that is the new root
+
+ ```
tree /boot/efi
/boot/efi
├── $RECYCLE.BIN
│ └── desktop.ini
├── EFI
│ ├── Boot
│ │ ├── bootx64.efi
│ │ ├── fbx64.efi
│ │ └── mmx64.efi
│ ├── Microsoft
│ │ ├── Boot
│ │ │ ├── BCD
│ │ │ ├── BCD.LOG
│ │ │ ├── BCD.LOG1
│ │ │ ├── BCD.LOG2
│ │ │ ├── bg-BG
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── bootmgfw.efi
│ │ │ ├── bootmgr.efi
│ │ │ ├── BOOTSTAT.DAT
│ │ │ ├── boot.stl
│ │ │ ├── CIPolicies
│ │ │ │ └── Active
│ │ │ │ ├── {5DAC656C-21AD-4A02-AB49-649917162E70}.cip
│ │ │ │ ├── {82443e1e-8a39-4b4a-96a8-f40ddc00b9f3}.cip
│ │ │ │ └── {CDD5CB55-DB68-4D71-AA38-3DF2B6473A52}.cip
│ │ │ ├── cs-CZ
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── da-DK
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── de-DE
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── el-GR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── en-GB
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── en-US
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── es-ES
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── es-MX
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── et-EE
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── fi-FI
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── Fonts
│ │ │ │ ├── chs_boot.ttf
│ │ │ │ ├── cht_boot.ttf
│ │ │ │ ├── jpn_boot.ttf
│ │ │ │ ├── kor_boot.ttf
│ │ │ │ ├── malgun_boot.ttf
│ │ │ │ ├── malgunn_boot.ttf
│ │ │ │ ├── meiryo_boot.ttf
│ │ │ │ ├── meiryon_boot.ttf
│ │ │ │ ├── msjh_boot.ttf
│ │ │ │ ├── msjhn_boot.ttf
│ │ │ │ ├── msyh_boot.ttf
│ │ │ │ ├── msyhn_boot.ttf
│ │ │ │ ├── segmono_boot.ttf
│ │ │ │ ├── segoen_slboot.ttf
│ │ │ │ ├── segoe_slboot.ttf
│ │ │ │ └── wgl4_boot.ttf
│ │ │ ├── fr-CA
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── fr-FR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── hr-HR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── hu-HU
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── it-IT
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── ja-JP
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── kd_02_10df.dll
│ │ │ ├── kd_02_10ec.dll
│ │ │ ├── kd_02_1137.dll
│ │ │ ├── kd_02_1414.dll
│ │ │ ├── kd_02_14e4.dll
│ │ │ ├── kd_02_15ad.dll
│ │ │ ├── kd_02_15b3.dll
│ │ │ ├── kd_02_1969.dll
│ │ │ ├── kd_02_19a2.dll
│ │ │ ├── kd_02_1af4.dll
│ │ │ ├── kd_02_8086.dll
│ │ │ ├── kd_07_1415.dll
│ │ │ ├── kd_0C_8086.dll
│ │ │ ├── kdnet_uart16550.dll
│ │ │ ├── kdstub.dll
│ │ │ ├── ko-KR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── lt-LT
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── lv-LV
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── memtest.efi
│ │ │ ├── nb-NO
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── nl-NL
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── pl-PL
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── pt-BR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── pt-PT
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── qps-ploc
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── qps-plocm
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── Resources
│ │ │ │ ├── bootres.dll
│ │ │ │ └── en-US
│ │ │ │ └── bootres.dll.mui
│ │ │ ├── ro-RO
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── ru-RU
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── SecureBootRecovery.efi
│ │ │ ├── sk-SK
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── sl-SI
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── sr-Latn-RS
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── sv-SE
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── tr-TR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── uk-UA
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── winsipolicy.p7b
│ │ │ ├── zh-CN
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ └── zh-TW
│ │ │ ├── bootmgfw.efi.mui
│ │ │ ├── bootmgr.efi.mui
│ │ │ └── memtest.efi.mui
│ │ └── Recovery
│ │ ├── BCD
│ │ ├── BCD.LOG
│ │ ├── BCD.LOG1
│ │ └── BCD.LOG2
│ └── ubuntu
│ ├── BOOTX64.CSV
│ ├── grub.cfg
│ ├── grubx64.efi
│ ├── mmx64.efi
│ └── shimx64.efi
└── System Volume Information
- ├── IndexerVolumeGuid
- └── WPSettings.dat
+ ├── IndexerVolumeGuid
+ └── WPSettings.dat
51 directories, 156 files
+ ```
current os-prober microsoft script
- 20microsoft
+ ```
+ $cat /usr/lib/os-probes/mounted/efi/20microsoft
#!/bin/sh
# Detects Microsoft bootloader on a EFI System Partition
. /usr/share/os-prober/common.sh
efi="$1"
found=
for microsoft in $(item_in_dir microsoft "$efi"); do
- for boot in $(item_in_dir boot "$efi/$microsoft"); do
- bcd=$(item_in_dir bcd "$efi/$microsoft/$boot")
- bootmgfw=$(item_in_dir bootmgfw.efi "$efi/$microsoft/$boot")
- if [ -n "$bcd" -a -n "$bootmgfw" ]; then
- long="Windows Boot Manager"
- short=Windows
- path="$microsoft/$boot/$bootmgfw"
- found=true
- break
- fi
- done
+ for boot in $(item_in_dir boot "$efi/$microsoft"); do
+ bcd=$(item_in_dir bcd "$efi/$microsoft/$boot")
+ bootmgfw=$(item_in_dir bootmgfw.efi "$efi/$microsoft/$boot")
+ if [ -n "$bcd" -a -n "$bootmgfw" ]; then
+ long="Windows Boot Manager"
+ short=Windows
+ path="$microsoft/$boot/$bootmgfw"
+ found=true
+ break
+ fi
+ done
done
-
if [ -n "$found" ]; then
- label="$(count_next_label "$short")"
- result "${path}:${long}:${label}"
+ label="$(count_next_label "$short")"
+ result "${path}:${long}:${label}"
fi
exit 0
-
+ ```
I've updated the script to fix this
+
+ ```
#!/bin/sh
partition="$1"
mpoint="$2"
type="$3"
if [ "$type" = vfat ]; then
- for base in "$mpoint" "$mpoint/EFI"; do
- if [ -d "$base" ]; then
- for microsoft in $(ls -d "$base"/[mM][iI][cC][rR][oO][sS][oO][fF][tT] 2>/dev/null); do
- microsoft=$(basename "$microsoft")
- for boot in $(ls -d "$base/$microsoft"/[bB][oO][oO][tT] 2>/dev/null); do
- boot=$(basename "$boot")
- if [ -f "$base/$microsoft/$boot/bootmgfw.efi" ] && [ -f "$base/$microsoft/$boot/bcd" ]; then
- if grep -aqs "W.i.n.d.o.w.s. .1.1" "$base/$microsoft/$boot/bcd"; then
- long="Windows 11"
- elif grep -aqs "W.i.n.d.o.w.s. .1.0" "$base/$microsoft/$boot/bcd"; then
- long="Windows 10"
- elif grep -aqs "W.i.n.d.o.w.s. .8" "$base/$microsoft/$boot/bcd"; then
- long="Windows 8"
- elif grep -aqs "W.i.n.d.o.w.s. .7" "$base/$microsoft/$boot/bcd"; then
- long="Windows 7"
- elif grep -aqs "W.i.n.d.o.w.s. .V.i.s.t.a" "$base/$microsoft/$boot/bcd"; then
- long="Windows Vista"
- elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$base/$microsoft/$boot/bcd"; then
- long="Windows Server 2008 R2"
- elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$base/$microsoft/$boot/bcd"; then
- long="Windows Server 2008"
- elif grep -aqs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$base/$microsoft/$boot/bcd"; then
- long="Windows Recovery Environment"
- elif grep -aqs "W.i.n.d.o.w.s. .S.e.t.u.p" "$base/$microsoft/$boot/bcd"; then
- long="Windows Recovery Environment"
- else
- long="Windows Boot Manager"
- fi
- if [ "$base" = "$mpoint" ]; then
- echo "$partition:$long:Windows:efi"
- else
- echo "$partition:$long:Windows:efi"
- fi
- exit 0
- fi
- done
- done
- fi
- done
+ for base in "$mpoint" "$mpoint/EFI"; do
+ if [ -d "$base" ]; then
+ for microsoft in $(ls -d "$base"/[mM][iI][cC][rR][oO][sS][oO][fF][tT] 2>/dev/null); do
+ microsoft=$(basename "$microsoft")
+ for boot in $(ls -d "$base/$microsoft"/[bB][oO][oO][tT] 2>/dev/null); do
+ boot=$(basename "$boot")
+ if [ -f "$base/$microsoft/$boot/bootmgfw.efi" ] && [ -f "$base/$microsoft/$boot/bcd" ]; then
+ if grep -aqs "W.i.n.d.o.w.s. .1.1" "$base/$microsoft/$boot/bcd"; then
+ long="Windows 11"
+ elif grep -aqs "W.i.n.d.o.w.s. .1.0" "$base/$microsoft/$boot/bcd"; then
+ long="Windows 10"
+ elif grep -aqs "W.i.n.d.o.w.s. .8" "$base/$microsoft/$boot/bcd"; then
+ long="Windows 8"
+ elif grep -aqs "W.i.n.d.o.w.s. .7" "$base/$microsoft/$boot/bcd"; then
+ long="Windows 7"
+ elif grep -aqs "W.i.n.d.o.w.s. .V.i.s.t.a" "$base/$microsoft/$boot/bcd"; then
+ long="Windows Vista"
+ elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$base/$microsoft/$boot/bcd"; then
+ long="Windows Server 2008 R2"
+ elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$base/$microsoft/$boot/bcd"; then
+ long="Windows Server 2008"
+ elif grep -aqs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$base/$microsoft/$boot/bcd"; then
+ long="Windows Recovery Environment"
+ elif grep -aqs "W.i.n.d.o.w.s. .S.e.t.u.p" "$base/$microsoft/$boot/bcd"; then
+ long="Windows Recovery Environment"
+ else
+ long="Windows Boot Manager"
+ fi
+ if [ "$base" = "$mpoint" ]; then
+ echo "$partition:$long:Windows:efi"
+ else
+ echo "$partition:$long:Windows:efi"
+ fi
+ exit 0
+ fi
+ done
+ done
+ fi
+ done
fi
if [ "$type" = fuseblk ] || [ "$type" = ntfs ]; then
- if [ -f "$mpoint/Windows/System32/winload.exe" ]; then
- echo "$partition:Windows 11:Windows:chain"
- exit 0
- fi
+ if [ -f "$mpoint/Windows/System32/winload.exe" ]; then
+ echo "$partition:Windows 11:Windows:chain"
+ exit 0
+ fi
fi
exit 1
+ ```
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to os-prober in Ubuntu.
https://bugs.launchpad.net/bugs/2129422
Title:
os-prober fail to detect windows 11 2025H2
Status in os-prober package in Ubuntu:
New
Bug description:
```
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.3 LTS
Release: 24.04
Codename: noble
os-prober version: 1.81ubuntu4
```
os-prober cannot find windows efi partition with windows 11
```
$/usr/lib/os-probes/mounted/efi/20microsoft /boot/efi
$
```
new windows 11 has a different efi layout and there's a /boot/efi/EFI
partition that is the new root
```
tree /boot/efi
/boot/efi
├── $RECYCLE.BIN
│ └── desktop.ini
├── EFI
│ ├── Boot
│ │ ├── bootx64.efi
│ │ ├── fbx64.efi
│ │ └── mmx64.efi
│ ├── Microsoft
│ │ ├── Boot
│ │ │ ├── BCD
│ │ │ ├── BCD.LOG
│ │ │ ├── BCD.LOG1
│ │ │ ├── BCD.LOG2
│ │ │ ├── bg-BG
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── bootmgfw.efi
│ │ │ ├── bootmgr.efi
│ │ │ ├── BOOTSTAT.DAT
│ │ │ ├── boot.stl
│ │ │ ├── CIPolicies
│ │ │ │ └── Active
│ │ │ │ ├── {5DAC656C-21AD-4A02-AB49-649917162E70}.cip
│ │ │ │ ├── {82443e1e-8a39-4b4a-96a8-f40ddc00b9f3}.cip
│ │ │ │ └── {CDD5CB55-DB68-4D71-AA38-3DF2B6473A52}.cip
│ │ │ ├── cs-CZ
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── da-DK
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── de-DE
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── el-GR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── en-GB
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── en-US
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── es-ES
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── es-MX
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── et-EE
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── fi-FI
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── Fonts
│ │ │ │ ├── chs_boot.ttf
│ │ │ │ ├── cht_boot.ttf
│ │ │ │ ├── jpn_boot.ttf
│ │ │ │ ├── kor_boot.ttf
│ │ │ │ ├── malgun_boot.ttf
│ │ │ │ ├── malgunn_boot.ttf
│ │ │ │ ├── meiryo_boot.ttf
│ │ │ │ ├── meiryon_boot.ttf
│ │ │ │ ├── msjh_boot.ttf
│ │ │ │ ├── msjhn_boot.ttf
│ │ │ │ ├── msyh_boot.ttf
│ │ │ │ ├── msyhn_boot.ttf
│ │ │ │ ├── segmono_boot.ttf
│ │ │ │ ├── segoen_slboot.ttf
│ │ │ │ ├── segoe_slboot.ttf
│ │ │ │ └── wgl4_boot.ttf
│ │ │ ├── fr-CA
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── fr-FR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── hr-HR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── hu-HU
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── it-IT
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── ja-JP
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── kd_02_10df.dll
│ │ │ ├── kd_02_10ec.dll
│ │ │ ├── kd_02_1137.dll
│ │ │ ├── kd_02_1414.dll
│ │ │ ├── kd_02_14e4.dll
│ │ │ ├── kd_02_15ad.dll
│ │ │ ├── kd_02_15b3.dll
│ │ │ ├── kd_02_1969.dll
│ │ │ ├── kd_02_19a2.dll
│ │ │ ├── kd_02_1af4.dll
│ │ │ ├── kd_02_8086.dll
│ │ │ ├── kd_07_1415.dll
│ │ │ ├── kd_0C_8086.dll
│ │ │ ├── kdnet_uart16550.dll
│ │ │ ├── kdstub.dll
│ │ │ ├── ko-KR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── lt-LT
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── lv-LV
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── memtest.efi
│ │ │ ├── nb-NO
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── nl-NL
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── pl-PL
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── pt-BR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── pt-PT
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── qps-ploc
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── qps-plocm
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── Resources
│ │ │ │ ├── bootres.dll
│ │ │ │ └── en-US
│ │ │ │ └── bootres.dll.mui
│ │ │ ├── ro-RO
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── ru-RU
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── SecureBootRecovery.efi
│ │ │ ├── sk-SK
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── sl-SI
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── sr-Latn-RS
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── sv-SE
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── tr-TR
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ ├── uk-UA
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ └── bootmgr.efi.mui
│ │ │ ├── winsipolicy.p7b
│ │ │ ├── zh-CN
│ │ │ │ ├── bootmgfw.efi.mui
│ │ │ │ ├── bootmgr.efi.mui
│ │ │ │ └── memtest.efi.mui
│ │ │ └── zh-TW
│ │ │ ├── bootmgfw.efi.mui
│ │ │ ├── bootmgr.efi.mui
│ │ │ └── memtest.efi.mui
│ │ └── Recovery
│ │ ├── BCD
│ │ ├── BCD.LOG
│ │ ├── BCD.LOG1
│ │ └── BCD.LOG2
│ └── ubuntu
│ ├── BOOTX64.CSV
│ ├── grub.cfg
│ ├── grubx64.efi
│ ├── mmx64.efi
│ └── shimx64.efi
└── System Volume Information
├── IndexerVolumeGuid
└── WPSettings.dat
51 directories, 156 files
```
current os-prober microsoft script
```
$cat /usr/lib/os-probes/mounted/efi/20microsoft
#!/bin/sh
# Detects Microsoft bootloader on a EFI System Partition
. /usr/share/os-prober/common.sh
efi="$1"
found=
for microsoft in $(item_in_dir microsoft "$efi"); do
for boot in $(item_in_dir boot "$efi/$microsoft"); do
bcd=$(item_in_dir bcd "$efi/$microsoft/$boot")
bootmgfw=$(item_in_dir bootmgfw.efi "$efi/$microsoft/$boot")
if [ -n "$bcd" -a -n "$bootmgfw" ]; then
long="Windows Boot Manager"
short=Windows
path="$microsoft/$boot/$bootmgfw"
found=true
break
fi
done
done
if [ -n "$found" ]; then
label="$(count_next_label "$short")"
result "${path}:${long}:${label}"
fi
exit 0
```
I've updated the script to fix this
```
#!/bin/sh
partition="$1"
mpoint="$2"
type="$3"
if [ "$type" = vfat ]; then
for base in "$mpoint" "$mpoint/EFI"; do
if [ -d "$base" ]; then
for microsoft in $(ls -d "$base"/[mM][iI][cC][rR][oO][sS][oO][fF][tT] 2>/dev/null); do
microsoft=$(basename "$microsoft")
for boot in $(ls -d "$base/$microsoft"/[bB][oO][oO][tT] 2>/dev/null); do
boot=$(basename "$boot")
if [ -f "$base/$microsoft/$boot/bootmgfw.efi" ] && [ -f "$base/$microsoft/$boot/bcd" ]; then
if grep -aqs "W.i.n.d.o.w.s. .1.1" "$base/$microsoft/$boot/bcd"; then
long="Windows 11"
elif grep -aqs "W.i.n.d.o.w.s. .1.0" "$base/$microsoft/$boot/bcd"; then
long="Windows 10"
elif grep -aqs "W.i.n.d.o.w.s. .8" "$base/$microsoft/$boot/bcd"; then
long="Windows 8"
elif grep -aqs "W.i.n.d.o.w.s. .7" "$base/$microsoft/$boot/bcd"; then
long="Windows 7"
elif grep -aqs "W.i.n.d.o.w.s. .V.i.s.t.a" "$base/$microsoft/$boot/bcd"; then
long="Windows Vista"
elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$base/$microsoft/$boot/bcd"; then
long="Windows Server 2008 R2"
elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$base/$microsoft/$boot/bcd"; then
long="Windows Server 2008"
elif grep -aqs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$base/$microsoft/$boot/bcd"; then
long="Windows Recovery Environment"
elif grep -aqs "W.i.n.d.o.w.s. .S.e.t.u.p" "$base/$microsoft/$boot/bcd"; then
long="Windows Recovery Environment"
else
long="Windows Boot Manager"
fi
if [ "$base" = "$mpoint" ]; then
echo "$partition:$long:Windows:efi"
else
echo "$partition:$long:Windows:efi"
fi
exit 0
fi
done
done
fi
done
fi
if [ "$type" = fuseblk ] || [ "$type" = ntfs ]; then
if [ -f "$mpoint/Windows/System32/winload.exe" ]; then
echo "$partition:Windows 11:Windows:chain"
exit 0
fi
fi
exit 1
```
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/2129422/+subscriptions
More information about the foundations-bugs
mailing list