LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   grub installation and MBR (https://www.linuxquestions.org/questions/linux-newbie-8/grub-installation-and-mbr-476419/)

chocloman 08-22-2006 09:40 PM

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

syg00 08-22-2006 10:02 PM

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.

tuxrules 08-22-2006 10:04 PM

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,

pixellany 08-22-2006 11:31 PM

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

SilentCat 08-23-2006 01:27 AM

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!

chocloman 08-23-2006 03:11 PM

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.


All times are GMT -5. The time now is 05:44 PM.