LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   need some help with the MBR and grub (https://www.linuxquestions.org/questions/linux-general-1/need-some-help-with-the-mbr-and-grub-525553/)

nyheat 02-04-2007 02:36 PM

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?

ichrispa 02-04-2007 02:54 PM

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

syg00 02-04-2007 03:09 PM

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.

pixellany 02-04-2007 03:28 PM

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.

asimba 02-04-2007 03:51 PM

- Watching

ichrispa 02-07-2007 12:51 PM

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...


All times are GMT -5. The time now is 12:33 AM.