View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-04-2007, 03:36 PM   #1
Registered: Aug 2005
Distribution: Debian
Posts: 75

Rep: Reputation: 15
need some help with the MBR and grub

My hard drive layout:
- SATA 1 with Windows 2003
- SATA 2 with Ubuntu Edgy (new install)
- IDE with files (no system)

My computer boots straight into SATA 1 (win2003) even though I just did a full install of Ubuntu onto SATA 2
what can I do to fix the mbr so it shows me grub instead of booting straight into Windows?
Old 02-04-2007, 03:54 PM   #2
Registered: Mar 2005
Location: Dresden, Germany
Distribution: OpenSuse 11.2/3, Debian 5.0 , Debian 1.3.1, OpenBSD
Posts: 277

Rep: Reputation: 32
You need to install GRUB on your MBR. There should be an option during installation, alternatively you should use the grub-install utility (which is part of the grub source tarball).

After that you have to configure grub to chainload the windows bootloader.

There are details about how on the grub homepage here:

Last edited by ichrispa; 02-04-2007 at 03:57 PM.
Old 02-04-2007, 04:09 PM   #3
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 13,623

Rep: Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393
Try changing the order of the bootdisk to boot the Ubuntu disk first. That will tell you if grub was installed to that MBR.
If so you'll probably find a Windows option on the boot menu. May, or may not, work. Can be easily rectified.
Else you'll need to do as ichrispa suggested - install back to the other MBR, chainload Windows and reset the boot order.
Old 02-04-2007, 04:28 PM   #4
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735
When you installed Ubuntu, there should have been some options for where to install way to proceed is simply re-install and watch for this. If there is any doubt, tell it to put grub on a floppy.

Another option: if you can get to a terminal (live CD, or by pressing ctrl-alt-F1 after the install CD has booted), you can install grub. Let's assume that drive 1 is the 1st SATA, drive 2 is the 2nd SATA, and that Linux is on one (/) partition on drive 2:
grub     starts the grub shell
root   (hd1,0)    points grub at the "home-base"--defined as the location of the /boot directory
setup (hd0)    puts grub on the mbr of drive 1
Now, you need to check the grub config file: /boot/grub/menu.lst
To do this, you will need to mount drive 2 to the filesystem being used by the liveCD/installer.
cd /mnt
mkdir drive2
mount /dev/sdb1 drive2
cd drive 2

Here you should see the root directory of the Ubuntu install. Now to get to the Ubuntu boot/grub, do:
cd boot/grub (do NOT put / in front of the boot)
you should see a file named menu.lst (or possibly grub.conf) Open this with an editor--eg nano--and look for an entry similar to this:
title Ubuntu
root (hd1,0)
kernel /boot/vmlinuz<something> root=/dev/sdb1
initrd /boot/initrd<something>

The entries for kernel and initrd need to match the names of the files in boot. On easy way to proceed is to create soft links in boot named simply "vmlinuz" and "initrd". Then you can use these generic names in the grub config file.
Old 02-04-2007, 04:51 PM   #5
Registered: Mar 2005
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
- Watching

Last edited by asimba; 02-04-2007 at 04:54 PM.
Old 02-07-2007, 01:51 PM   #6
Registered: Mar 2005
Location: Dresden, Germany
Distribution: OpenSuse 11.2/3, Debian 5.0 , Debian 1.3.1, OpenBSD
Posts: 277

Rep: Reputation: 32
In order to avoid reinstallation of the entire Linux distribution, I suggest the following:
Use a life Linux distro like knoppix that uses grub.Then follow the grub-install procedure...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB on MBR ... dipenchaudhary Linux - General 12 02-16-2006 12:52 PM
Grub and MBR tavienu Fedora 2 01-12-2006 09:22 PM
grub to mbr rekaye1005 Linux - General 1 10-18-2005 08:20 PM
GRUB MBR overwritten by WIN98 MBR TOuseef Linux - General 7 11-14-2004 05:25 PM
Grub and MBR, need some help entm Linux - General 3 05-13-2002 04:49 AM

All times are GMT -5. The time now is 03:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration