LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 02-04-2007, 03:36 PM   #1
nyheat
Member
 
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
ichrispa
Member
 
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:
http://orgs.man.ac.uk/documentation/...l#SEC_Contents

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

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
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
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
When you installed Ubuntu, there should have been some options for where to install grub...one 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:
Code:
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
ls

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)
ls
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
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 349

Rep: Reputation: 42
- Watching

Last edited by asimba; 02-04-2007 at 04:54 PM.
 
Old 02-07-2007, 01:51 PM   #6
ichrispa
Member
 
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...
 
  


Reply


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 09:33 PM.

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