Update 2022-10-23: It appears the grub team has not updated for Windows 11 yet as it might show Windows Vista, so I have added how to make the changes in the answer below.
The reason why it still shows Windows 7
or Windows Recovery Environment
instead of Windows 10
is that the file /usr/lib/os-probes/mounted/20microsoft
does not contain the label for Windows 10
, so during the os-prober
detection of the OS it falls back to Windows 7
or Windows Recovery Environment
.
To correct this, you need to make the following changes to the following file (I am going to put gedit as the editor, but use what you want):
sudo gedit /usr/lib/os-probes/mounted/20microsoft
NOTE: You should always make a backup of a file before modifying it!
Added for Windows 11 now as well as it might be detected as Windows Vista.
if item_in_dir -q bootmgr "$2"; then
# there might be different boot directories in different case as:
# boot Boot BOOT
for boot in $(item_in_dir boot "$2"); do
bcd=$(item_in_dir bcd "$2/$boot")
if [ -n "$bcd" ]; then
if grep -qs "W.i.n.d.o.w.s. .1.1" "$2/$boot/$bcd"; then
long="Windows 11"
elif grep -qs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then
long="Windows 10"
elif grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
long="Windows 8 (loader)"
elif grep -qs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
long="Windows 7 (loader)"
the above section is around line 34 of the file. All you should have to do is change the if
statement at the beginning of the line to elif
and then add the section for Windows 11 starting with the if
line above the one for Windows 10.
Once saved, then running os-prober
now looks like this:
terrance@terrance-ubuntu:~$ sudo os-prober
/dev/sdc1:Windows 11:Windows:chain
then running update-grub2
it will now make the updates to your /boot/grub/grub.cfg
permanent anytime you get a kernel update so it will show the correct version of Windows now (example below):
terrance@terrance-ubuntu:~$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Sourcing file `/etc/default/grub.d/lubuntu-grub-theme.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-52-generic
Found initrd image: /boot/initrd.img-5.15.0-52-generic
Found linux image: /boot/vmlinuz-5.15.0-50-generic
Found initrd image: /boot/initrd.img-5.15.0-50-generic
Found linux image: /boot/vmlinuz-5.13.0-52-generic
Found initrd image: /boot/initrd.img-5.13.0-52-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows 11 on /dev/sdc1
done
Hope this helps!