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 (http://pastebin.com/Cgv1igHc):

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.
share|improve this question
    
Please indicate your Boot-Info URL. This will provide relevant information to help you. – LovinBuntu Oct 9 '12 at 9:30

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:additionally 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. Best Regards Luke

share|improve this answer

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 this video https://www.youtube.com/watch?v=0fCA7ToywoY and this article https://forums.linuxmint.com/viewtopic.php?f=46&t=209082, but unfortunately both didn't work for me so I use 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 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 line:

sudo update-grub

Then restart your machine to see if it works.

Hope this will work for others too.

share|improve this answer
    
I believe that this answer while correct, is largely a copy of the answer submitted May 29, 2015 – Charles Green May 30 '17 at 13:55

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.

share|improve this answer

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.

share|improve this answer
    
I think mine also caused by the raid. But sudo dmraid -rE does not work for me. I finally made it by switch to AHCI in BIOS temporary, then boot to Ubuntu and execute sudo update-grub , then switch RAID ON back. – realhu Nov 20 '17 at 13:50

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.

share|improve this answer

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.

share|improve this answer

If the os-prober method above doesn't work try to add a custom grub menu entry

documented here edit the /etc/grub.d/40_custom file

menuentry "Windows 7" {  
     insmod ntfs  
     set root='(hd0,1)'  
     search --no-floppy --fs-uuid --set a3f1ea41fc67a3f1  
     chainloader +1  
}

to get the uuid you can to use the blkid /dev/sdx command

share|improve this answer
  1. Boot Ubuntu and mount your Windows partition (simply open the disk on Nautilus)

  2. Run the following on the command line (Ctrl+Alt+t):

    sudo os-prober
    
  3. 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

share|improve this answer
    
I have 2 partitions with 2 windows install, it only detects my install on another partition, but not the new installed windows (on a SSD)! even mounted... an idea? – Philippe Gachoud May 29 '15 at 9:00
    
Thanks. Interesting that the os-prober seems to need step 1. Very important, or windows won't work. – Eliptical view Oct 26 '16 at 2:03
    
mount -t ntfs-3g -o ro /dev/sda4 /media/windows to mount the windows partition – Yuvaraj Loganathan May 1 '17 at 4:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.