GRUB does not detect Windows
Solution 1:
Boot Ubuntu and mount your Windows partition (simply open the disk on Nautilus)
-
Run the following on the command line (Ctrl+Alt+t):
sudo os-prober
-
If your Windows installation was found, you can run:
sudo update-grub
Note that step 2 is just for your convenience. You could just mount the Windows 7 partition and then run update-grub
.
Related question
- Unable to mount Windows (NTFS) filesystem due to hibernation
Solution 2:
If the os-prober
method above doesn't work try adding a custom grub menu entry. Documented here.
First two steps are for finding your <UUID>
.
- Run
lsblk
and find the name of the row with/boot/efi
Example output (here the answer is sda2):
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 450M 0 part
├─sda2 8:2 0 100M 0 part /boot/efi
├─sda3 8:3 0 16M 0 part
├─sda4 8:4 0 47G 0 part /windows
├─sda5 8:5 0 425,6G 0 part /
└─sda6 8:6 0 3,7G 0 part [SWAP]
mmcblk0 179:0 0 14,9G 0 disk
└─mmcblk0p1 179:1 0 14,9G 0 part
- Run
sudo blkid /dev/sdaX
wheresdaX
is the answer from previous step (sda2
in my case).
Example output (here the answer is 58E4-427D):
/dev/sda2: UUID="58E4-427D" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="b81727be-ba90-5f8c-ab98-d3ec67778b7d"
- Add the following at the end of the file
/etc/grub.d/40_custom
:
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set <UUID>
chainloader +1
}
- Run
sudo update-grub
and reboot.
Solution 3:
I had Windows 10 running and then tried dual boot. Once Ubuntu was installed, Win 10 wasn't showing up in my GRUB loader. I tried the following --
First of all, I disabled Secure Boot in Win10. Then ran the below commands in Ubuntu :
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
Worked out pretty well. Was able to find both Windows and Ubuntu in GRUB after that.
Solution 4:
I solved a similar problem following steps of Boot-Repair
Install boot-repair
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
Push "Recommended repair" And put in a terminal some commands as it suggested.
I think my Grub doesn't recognize windows due to a bad shutdown, and it solved the problem.
Solution 5:
Slightly different method as I copied from a working example on another computer, posting for my own records.
Append the following to /etc/grub.d/40_custom
:
menuentry "Windows 10" {
insmod part_gpt
insmod fat
search --no-floppy --fs-uuid --set <boot_efi_uuid>
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
where <boot_efi_uuid>
is the UUID of your /boot/efi
partition. To find this:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
└─md126 9:126 0 357.7G 0 raid0
├─md126p1 259:0 0 499M 0 md
├─md126p2 259:1 0 100M 0 md /boot/efi
$ sudo blkid | grep md126p2 # Replace with your device
/dev/md126p2: UUID=<boot_efi_uuid>
Then of course, once you're saved the file, run:
sudo update-grub
Reboot, you should now be able to successfully start up Windows.