Installing GRUB after installing Linux on a second drive

I finally got around to installing Linux on my desktop PC. I had problems installing it on the same physical harddrive as Windows, so I forked out $100 for a new SATA 250GB drive.

I got the drive a couple of days ago and started installing Fedora Core 5. About 45 minutes later, I rebooted the system and to my dismay it booted directly into Windows. I realized that I may have gone through the installation process a little to quickly and forgot to change the setting to put the bootloader on the first disc.

I am considerably new to Linux and wasn't sure how to install GRUB bootloader so that it started instead of Windows. All you have to do is use any bootable Linux disc, in this case I just used the same DVD I that installed Fedora with, and at the boot prompt before the installation begins you type the following:

boot: linux rescue

It then proceeds to ask you a couple of general localization questions. The installer will attempt to locate your partition that contains Linux. Once it does, it will mount it to the /mnt/sysimage directory. Once it does that, it will take you to a command prompt. Simply type the following at the prompt to change the root to your Linux install:

# chroot /mnt/sysimage

Once you have done that you need to type the following. NOTE: I am using sda in this example because I have a serial ata drive. If you have an IDE drive then you would use hda:

# grub-install /dev/sda

Unfortunately this did not work for me as I got this error:

/dev/sdb1 does not have any corresponding BIOS drive

After searching for the solution I found out I had to add a parameter to the install:

# grub-install --recheck /dev/sda

Once I did that and rebooted, it showed me my GRUB bootloader which worked for both my Windows and Linux installations. It was perfect.

Related reading:

How to Repair a Corrupt MBR and boot into Linux

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Thank you so much for putting this piece of info on the internet. I had the exact same problem and just couldn't figure out where it went wrong. But this solves it, awesome!

Cheers.
# Posted By Pepe | 4/22/07 2:13 PM
First hit on google for me and it worked right away. Thanks so much!
# Posted By Peter MacLellan | 4/24/07 6:20 PM
Awesome glad to hear!!!
# Posted By Kyle Hayes | 4/24/07 6:22 PM
Another happy customer! It is great to find clear directions for my exact problem that work!!
# Posted By Cinth | 5/17/07 9:33 AM
I am thrilled to hear that this post is still helping people out! I haven't had Linux installed on any of my systems for quite some time now, and forgot what the problem was all about anyway :-P
# Posted By Kyle Hayes | 5/17/07 3:07 PM
Thanks for the help on this critical issue. I was searching around google for this exact same problem, and strangely, the ubuntu forums didn“t have any solutions. This did the trick. Gracias!
# Posted By 5yte | 11/16/07 6:22 PM
I am glad to hear that this post is still helping people!
# Posted By Kyle Hayes | 11/17/07 7:27 AM
Thanks for the help with installing grub!
# Posted By Johan | 1/8/08 3:32 AM
haha! Glad to here it is still helpful!
# Posted By Kyle Hayes | 1/8/08 6:06 AM