Grub Does Not Detect Windows
I Have Finally Installed Ubuntu on My Second Drive. When I Start My Computer Grub Only Offers Me to Boot Ubuntu, Not Windows 7. What Needs to Be Done So That I...
I have finally installed Ubuntu on my second drive. When I start my computer GRUB only offers me to boot Ubuntu, not Windows 7. What needs to be done so that I can choose between Ubuntu and Windows in GRUB?
When I press F12 for boot menu at startup and I choose Windows Boot Manager it boots into Windows 7.
I ran command sudo fdisk -l and here is log ():
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xc3ffc3ff
Device Boot Start End Blocks Id System
/dev/sda1 1 1953525167 976762583+ ee GPT
Partition 1 does not start on physical sector boundary.
13 Answers
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-proberIf 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.
Must Read
Related question
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
lsblkand 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/sdaXwheresdaXis the answer from previous step (sda2in 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-gruband reboot.
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.
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.
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.
If you have previously had a RAID installed that may be causing issues. In my case, I built my desktop in 2010, and I installed two 1.5 TB with a striped RAID. User gracemercy54 mentions here that this is left over metadata from the former RAID configuration.
When I originally tried the steps by Hermes I got an error specifying "wrong number of devices in a RAID set." So, if this happens to you open a terminal and run:
sudo dmraid -rE
sudo os-prober
sudo update-grub
That fixed this for me.
I had issues like here above and the solution was just to add manual entry as below:
menuentry "WINDOWS10 (on /dev/sda1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(/dev/sda,msdos1)'
search --no-floppy --fs-uuid --set=root 688EB92384B85968
drivemap -s (hd0) ${root}
chainloader +1
}
where UUID above (688E...) was taken from boot windows disk via blkid /dev/sdb1.
ATTENTION: the additional line
set root='(/dev/sda,msdos1)'
refers to sda which is visible under Ubuntu as /dev/sdb even actually it is the first disk in sata bus while /dev/sda is in fact second drive mounted as root /.
Maybe that is why grub scripts could not work properly. I had no time to change the physical order of disks but it is quite possible it would help to resolve the issue, too.
I had the same problem with Windows 10. I installed Linux Mint 18.1 Cinnamon 64-bit on my laptop for dual boot with WIN10. After the installation GRUB only offered to boot Linux but not Windows.
I found the video solution for windows 10 missing from grub menu and the forum thread Grub not recognizing Win10 after Update/Repair, but unfortunately neither worked for me so I used a combination of these two to resolve my problem.
Open your terminal and follow these commands and open the file named 40_custom:
sudo gedit /etc/grub.d/40_custom
Add these lines to the end of the file and then save and exit:
menuentry "Windows 10" {
set root='{hd0,1}'
chainloader + 1
}
After you save the file update your GRUB with this command:
sudo update-grub
Then restart your machine to see if it works.
Hope this will work for others too!
I had the same problem and had spent 2 days figuring it out. But today I had this sudden idea in the morning and it worked out.
You should review your bios/uefi settings. In my case I had to let Uefi boot first. Otherwise I wasn't able to detect windows from ubuntu. What I had to set was ubuntu > Windows Boot Manager > DISK1 > DISK2 > DISK3. Insted DISK1 > ubuntu > Windows Boot Manager > DISK3.
I had 2 ubuntu installations one on hdd and one on ssd. Apparently ssd installation wasn't showing as UEFI for some reasone but I wanted boot faster disk first.
I wasn't expecting that order of boot can influence grub in detecting systems. So it is worth to review that.
I had the same issue after I installed the updates from ubuntu. The following commands worked for me perfectly:
sudo apt-get install os-prober
First install os-prober to detect windows and then update grub:
sudo grub-mkconfig -o /boot/grub/grub.cfg
In addition to the answer of Bartosz Dabrowski, which lead me to solving my problem:
Be sure that if your Linux uses UEFI Boot/GPT that your other OS (eg. Windows in my case) also uses UEFI Boot/GPT. Coming from an old Win7 to Win10 installation the hard drive still had old school boot and MBR. Somehow os-prober and boot-repair had their problems to fix this.
Ensure that in BIOS / Boot order there is your HDD with ubuntu (eg. uefi: ubuntu) and your HDD with Windows Boot Manager (eg. uefi: Windows Boot Manager) to be found.
If WBM is missing ensure that windows boot disk has GPT. You can check this in Windows using Disk Management (Win + X, then Disk Management).
There is a Windows tool: mbr2gpt which can convert your MBR to GPT. After doing so (and booting via UEFI) os-prober and finally update-grub was able to find my Windows installation and added it to the boot options of grub.
Follow these steps if os-prober shows Windows, but GRUB does not.
- Edit
grub-mkconfigsudo nano /usr/bin/grub-mkconfig - Find these lines near the middle
# Disable os-prober by default due to security reasons. GRUB_DISABLE_OS_PROBER="true" - Change
truetofalse - Exit nano (CTRL+X, Y, Enter)
- Update GRUB
sudo update-grub
Okay, so I had the same problem and couldn't find a solution for me out there for a long time, finally got it, so here is my little grain of sand to the world. Before you try, remember to check you are booting using UEFI everytime you can:
Apparently, in the process of installing Debian the Windows data inside the EFI partition was lost, so what I did is a System restore using a Windows 10 USB (I tried fixing the boot but somehow it didn't work, I even tried it on console, anyways I lost no data). After this, now I coulnd't boot Debian, so I run a Debian live CD, mounted everything and chrooted like this (and don't forget to boot the USB as UEFI):
mount /dev/your_linux_partition /mnt
cd /mnt
mount -t proc /proc proc/
mount -t sysfs /sys sys/
mount --rbind /dev dev/
mount --rbind /sys/firmware/efi/efivars sys/firmware/efi/efivars/
mount /dev/your_efi_partition /boot/efi/
chroot /mnt /bin/bash
Now, here os-prober didn't detect Windows 10, but I decided to grub-install /dev/sda and grub-update anyways and restart.
Here is the funny thing, now I couldn't boot Windows 10 and only Debian, BUT!, I tried once again to grub-update and finally found the Windows 10 boot. This doesn't make any sense honestly, but I don't care. Hope it helps anyone as desperate as me :D .