I have been running with dual boot between 20.04 and Windows 10 for some time, but now I can no longer boot into Windows. The option has mysteriously disappeared from the boot menu. The only thing that I have been doing is to install Ubuntu updates whenever requested to do so.
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-58-generic
Found initrd image: /boot/initrd.img-5.4.0-58-generic
Found linux image: /boot/vmlinuz-5.4.0-52-generic
Found initrd image: /boot/initrd.img-5.4.0-52-generic
find: ‘/boot/efi/EFI/Microsoft/Boot/el-GR’: Input/output error
find: ‘/boot/efi/EFI/Microsoft/Boot/es-ES’: Input/output error
find: ‘/boot/efi/EFI/Microsoft/Boot/fi-FI’: Input/output error
find: ‘/boot/efi/EFI/Microsoft/Boot/sl-SI’: Input/output error
find: ‘/boot/efi/EFI/Microsoft/Boot/sv-SE’: Input/output error
find: ‘/boot/efi/EFI/Microsoft/Boot/uk-UA’: Input/output error
Adding boot menu entry for UEFI Firmware Settings
doneWhen I try to run boot repair I get this message: "LegacyWindows detected. Please enable BIOS-compatibility/CSM/Legacy mode in your UEFI firmware, and use this software from a live-CD (or live-USB)."
Since I have already been running dual boot then I seriously doubt that I need to change anything in the BIOS.
I don't want to re-install Windows so before I risk messing things up I want to ask you guys out there how to proceed.
Kind regards, Christian
sudo parted -l Model: ATA SanDisk SSD PLUS (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 556MB 555MB ntfs Basic data partition hidden, diag
2 556MB 661MB 105MB fat32 EFI system partition boot, esp
3 661MB 677MB 16.8MB Microsoft reserved partition msftres
4 677MB 550GB 549GB ntfs Basic data partition msftdata
5 550GB 1000GB 450GB ext4
Model: ATA WDC WD20EARX-00P (scsi) Disk /dev/sdb: 2000GB Sector size (logical/physical): 512B/4096B Partition Table: msdos Disk Flags:
Number Start End Size Type File system Flags 1 1049kB 2000GB 2000GB primary ext3 boot
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0
has been opened read-only.
Model: ASUS BW-16D1HT (scsi)
Disk /dev/sr0: 41.8GB
Sector size (logical/physical): 2048B/2048B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags 1 0.00B 41.8GB 41.8GB udf
test -d /sys/firmware/efi && echo efi || echo bios
efi
41 Answer
Find the UUID of your EFI partition in Terminal as follows:-
lsblk -o name,partlabel,fstype,uuid|grep -i efi. It's shown in the last column, and you will need this shortly.
Make a copy of your grub.cfg file from Terminal - sudo cp /boot/grub/grub.cfg /boot/grub/grub2.cfg.
Open grub.cfg with sudo gedit /boot/grub/grub.cfg.
Click the 3 vertical dots (top right panel) and select Find, and in the box enter menuentry 'Ubuntu'. That first Ubuntu menu entry will highlight. Then scroll several lines down to the closing brace after the initrd...line. Make a new paragraph after this closing brace, then add/paste the following lines:
menuentry 'Windows Boot Manager (on /dev/sda4)' --class windows --class os $menuentry_id_option 'osprober-efi-UUID' { insmod part_gpt insmod fat set root='hd0,gpt2' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 UUID else search --no-floppy --fs-uuid --set=root UUID fi chainloader /EFI/Microsoft/Boot/bootmgfw.efi }Note, where I've put UUID (uppercase) in the code you now need to substitute the actual UUID you found earlier. There are 3 instances of it. With the first one (first line) there is no space after the hyphen. Make sure the last line of code is a closing brace as shown, then save the file. Do not update grub, but reboot.
Note this grub entry assumes your Win 10 booting files have not been altered or corrupted, as any missing or defiled entries in the ESP will result in booting errors for Windows. Grub isn't responsible once it hands over control to Windows.