Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

4 Answers 4

up vote 10 down vote accepted

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.

share|improve this answer
    
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 ;) –  RolandiXor Nov 1 '10 at 3:38
1  
No, I had him switch to root. sudo su -. Then you don't need to use sudo for the rest. –  Alex Launi Nov 1 '10 at 3:41
    
oh my bad =D lol (remove sudo from the last command :P lol haha) –  RolandiXor Nov 1 '10 at 3:44
    
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.. –  Alex Launi Nov 1 '10 at 4:02
1  
@Alex: you should use sudo -i instead of sudo su - though. ;-) –  JanC Nov 1 '10 at 5:21
show 1 more comment

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

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.