Dual Boot issues with Windows 7 and Ubuntu
The Ubuntu installer probably autodetected a recovery partition and set up GRUB (the bootloader) to boot to that instead of the proper Windows partition.
First just try doing sudo os-prober; sudo update-grub
and see if that doesn't put the right entries in GRUB for you. If it doesn't, you'll need to edit your GRUB configuration to point to the right partition.
First we want to figure out what partition your Windows installation is on. Do sudo fdisk -l
(don't worry, this is a safe operation; it just lists your disks and partitions) and you should see a list of partition entries formatted a bit like this:
/dev/sda3 * 1 6374 51199123+ 7 HPFS/NTFS
Note the device path of any partitions that are of type "HPFS/NTFS" or "MS-DOS" or something to that effect. What you'll probably see is a small NTFS partition at the start of the disk and a bigger NTFS partition elsewhere. The smaller one is your recovery partition and the bigger one is your Windows instance proper. Make a note of the device path of the larger one.
Now we need to know the UUID of that filesystem, which we will give to GRUB to help it find it. Say sudo blkid
and find the entry corresponding to the partition you noted above. Note the value in quotes after UUID=
.
Now use the editor of your choice to open /etc/grub.d/40_custom
. sudo nano -w /etc/grub.d/40_custom
will do nicely. At the end of this file add something like the following:
menuentry "Windows 7" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set UUID-GOES-HERE
chainloader +1
}
Two things need to be substituted here. Where I've written UUID-GOES-HERE
substitute the UUID you noted above (no quotation marks). Where I've written msdos1
substitute 1 with the number of the partition you noted before (sda6
would be msdos6
etc.).
Save this file and do sudo update-grub
, then reboot. Try your new menu entry. Should work.
I had the very same problem. I had Windows 7 on my laptop and decided to give Ubuntu a try too. So I made a new partition, allocated 15 gigabyte of my hard disk to it and installed Ubuntu on the new partition. Every thing went smoothly, the installation wizard rebooted the system and GRUB loaded with Ubuntu and Windows 7 on its menu.
I could load into Windows 7 but when I chose Ubuntu, all I could get was a black screen. I searched the web and tried almost everything I could get but the problem remained. So I decided to format the Ubuntu partition and reinstall Ubuntu. During my search for a solution, I noticed that it is important where to install GRUB.
Originally I had chosen to install GRUB on the same partition that Ubuntu was going to be installed (sda8 in my case) and that was the problem. When installing GRUB, it is important to specify a hard disk (and not a partition) for GRUB to be installed on. Specifying a partition instead could lead to trouble.
So this time I chose 'sda' for GRUB to be installed on and installed Ubuntu on 'sda8' and that was it. The problem was solved and now I have both Windows 7 and Ubuntu 12.04 on my laptop working smoothly.