I tried to make a dual boot setup on my computer. Already had windows 7 installed on one hard drive, then tried to install ubuntu on part of another hard drive. When i turn my computer on windows7 always boots, there is no option to select which os to boot regardless of the order i put the hard drives to boot from in the bios this always happens. If I remove the hard drive with windows on it instead of booting ubuntu it just says there is an error - windows can't boot because something is missing. After installing ubuntu it said everything was fine. Something else which may help: originaly i had kubuntu installed before windows but when i insstalled windows 7 i could no longer get to it and just stopped uing it. How can I stop this from happening so that I can boot into Ubuntu?
4 Answers
What's happened is that Windows 7 has overridden Grub (the Linux boot loader) with its own bootloader. This is fixable, it just takes a little bit of work. Here's how to fix it. You'll need an Ubuntu 10.10 live cd.
Boot into the live session Open a terminal (Applications > Accessories > Terminal) and become root by running
sudo su -
Next you'll need to inspect your disk and look at the partitioning. Run
fdisk -l
You'll need to do a little bit of detective work, but you want to identify the Ubuntu root partition. you will get output that looks like this
Device Boot Start End Blocks Id System
/dev/sda1 * 1 18663 149903360 83 Linux
/dev/sda2 18663 19458 6384641 5 Extended
/dev/sda5 18663 19458 6384640 82 Linux swap / Solaris
With another for your windows setup. The /dev/sda1 line, and the numbers will probably be different, but you want to find the one that is listed as System: Linux.
Now you'll mount that, and install grub.
mount /dev/sda1 /mnt
grub-install --root-directory=/mnt/ /dev/sd1
replacing /dev/sda1 with what yours said.
That should be it, reboot and you should be able to boot Ubuntu and Windows.
-
if you read it carefully, he installed in incorrectly, and the windows drive boots first lol. + you forgot sudo for fdisk (I don't recall it working without it on the live cd). still voted you up ;) Nov 1, 2010 at 3:38
-
1No, I had him switch to root. sudo su -. Then you don't need to use sudo for the rest. Nov 1, 2010 at 3:41
-
-
Good call! I thought these things were supposed to be collaboratively edited? Can't we edit each others' answers, or is that just for questions.. Nov 1, 2010 at 4:02
-
1
You need to install grub on the correct hard drive (the drive that boots first). To find detailed info on how to do it: here
You haven't installed grub to your second hdd (Contains ubuntu). Just install grub to this hdd. if you feel difficult to do it, just reinstall the ubuntu ( Be sure that you are opted to install grub). And make this hdd to boot first.
If you don't feel confident installing GRUB again using the install cd i recommend downloading and installing Easy BCD for Win7.
http://neosmart.net/blog/2010/welcome-to-easybcd-2/
It should be able to recognize all operating systems installed and allow you to easily decide the boot order