LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-22-2006, 10:40 PM   #1
chocloman
Member
 
Registered: Mar 2005
Location: Lima, Peru, South america
Distribution: slackware
Posts: 35

Rep: Reputation: 15
grub installation and MBR


Hi everyone, I'm about to install a linux distro on my box and I've got some questions about grub installation on the MBR.

My box has 2 hard disks , let's say disk A (master)and B (slave). In disk A I have windows so I would like to install linux on disk B.

I'm a little bit confused about the master boot record concept. As far as I'm concerned every disk has a MBR (either master or slave) ,so I would like to know if it's possible to install grub on the MBR of my slave disk without touching the MBR of the master disk?

If it is possible, could I boot also windows from grub?

Thanks in advance
 
Old 08-22-2006, 11:02 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
Yes you can - no you don't want to.
There is only one MBR (M - master), and that is the disk the BIOS successfully initiates a boot from. Other disks (if they exist) of course have an equivalent sector.

Simply install to the MBR - if you have problems, the windows loader can be easily restored in need (search on fixmbr).
Much less grief all round.
 
Old 08-22-2006, 11:04 PM   #3
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,144

Rep: Reputation: 56
Quote:
Originally Posted by chocloman
Hi everyone, I'm about to install a linux distro on my box and I've got some questions about grub installation on the MBR.

My box has 2 hard disks , let's say disk A (master)and B (slave). In disk A I have windows so I would like to install linux on disk B.

I'm a little bit confused about the master boot record concept. As far as I'm concerned every disk has a MBR (either master or slave) ,so I would like to know if it's possible to install grub on the MBR of my slave disk without touching the MBR of the master disk?

If it is possible, could I boot also windows from grub?

Thanks in advance
Yes it is possible. Install grub on linux hd. In the bios, change the boot order of your hard drives so that linux hd comes first.

Last but not the least you have use map option in grub config file to trick windows into thinking it is the primary drive.

in the windows section of grub config file...add the following.

Code:
map (hd1) (hd0)
map (hd0) (hd1)
Here's my grub config if you need to refer:

Quote:
title Windows XP
root (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1)
makeactive
chainloader +1
Tux,
 
Old 08-23-2006, 12:31 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
***Start contest to see which graybeard can nitpick this the most***
The mbr is--I think--defined as the 1st sector on a hard disk. It includes boot code, and the partition table (actually, the FIRST partition table: If you have more than 4 partitions, one will be an extended partition---which is actually a pointer to some more partition tables in other sectors)
Makeup:
boot code: 446 bytes
partition table: 64 bytes
signature: 2 bytes

The bios goes to the mbr on the "first drive" to find how to proceed. As already mentioned you can change the bios settings to have a different drive be #1. Setting up the bootloader with a menu is easier, however.
 
Old 08-23-2006, 02:27 AM   #5
SilentCat
LQ Newbie
 
Registered: Aug 2006
Posts: 2

Rep: Reputation: 0
Hmmm

This took some figuring on my part and I have used Linux a long time ago in school, but I installed onto my second SATA drive (I only have two SATA drives for Hard disks-No Eide-) But I set it up thusly...

Disk 1 winXP
Disk 2 Linux
In Linux terms. XP is on hdb1.(MBR is ,by my bios, defaulted to hdb) Linux is on hda - the root partition is hda3
So I installed GRuB to hdb (the default MBR) with the XP option to hdb1 and the Linux option set to hda3.
Now I don't have to change my bios or remap to boot either one, I just selct which OS I want from grub and away I go. Good luck!

Last edited by SilentCat; 08-23-2006 at 02:29 AM.
 
Old 08-23-2006, 04:11 PM   #6
chocloman
Member
 
Registered: Mar 2005
Location: Lima, Peru, South america
Distribution: slackware
Posts: 35

Original Poster
Rep: Reputation: 15
Great Tips!! Thank you very much. For the record let me tell you that the map option trick worked like a charm after changing the boot order of my hard drives.
Now I can boot my precious Slackware and also windows XP (my brother needs it).

Linuxquestions never lets me down.

Last edited by chocloman; 08-24-2006 at 11:39 PM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub and MBR tavienu Fedora 2 01-12-2006 09:22 PM
Grub on MBR vivekian SUSE / openSUSE 13 02-20-2005 10:49 PM
GRUB MBR overwritten by WIN98 MBR TOuseef Linux - General 7 11-14-2004 05:25 PM
Installation Questions: GRUB / LILO / RAID Config & MBR Zaphod98 Linux - General 1 09-09-2004 01:32 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:27 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration