How can I stop windows from always booting first?

5,116

Solution 1

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.

Solution 2

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.

Solution 3

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:
5,116

Related videos on Youtube

Arron
Author by

Arron

Updated on September 17, 2022

Comments

  • Arron
    Arron over 1 year

    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?

  • Jason Southwell
    Jason Southwell over 13 years
    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 ;)
  • Alex Launi
    Alex Launi over 13 years
    No, I had him switch to root. sudo su -. Then you don't need to use sudo for the rest.
  • Jason Southwell
    Jason Southwell over 13 years
    oh my bad =D lol (remove sudo from the last command :P lol haha)
  • Alex Launi
    Alex Launi over 13 years
    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..
  • Jason Southwell
    Jason Southwell over 13 years
    only if we have a rep that's through the roof lol
  • JanC
    JanC over 13 years
    @Alex: you should use sudo -i instead of sudo su - though. ;-)