Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, I'm a Newbie in Linux, although experienced user of Windows.
I'm working with Ubuntu 9.0.4, Vista and XP in multiboot on a PC with two Hard Disks. HDa has Vista and Ubuntu, HDb has XP.
I read that the MBR is on the first record of the HD. My question is ; on which of the two HD's is the MBR to be found in my case? HD0, HD1?
If it is on only one HD, how can it see the partitions on the other HD?
Thanks in advance for any clear explanation.
Janvanha
well you have ubuntu on the first hdd which i presume you are using grub which /dev/hda2 would be hd(0,1) for grub and xp would be /dev/hdb1 and hd(1,0) in grub but ubuntu will be the mbr meaning grub is in the mbr and i assume vista was the first partition making it /dev/hda1 and hd(0,0) in grub but grub isnt always in the mbr sometimes in /boot/ which is common so it might not be in the mbr it may be longhorn (win bootloader) but that is inactive but still there
Last edited by theacerguy; 08-09-2009 at 03:14 AM.
Reason: typo
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369
Rep:
Quote:
Originally Posted by janvanha
Hello, I'm a Newbie in Linux, although experienced user of Windows.
I'm working with Ubuntu 9.0.4, Vista and XP in multiboot on a PC with two Hard Disks. HDa has Vista and Ubuntu, HDb has XP.
I read that the MBR is on the first record of the HD. My question is ; on which of the two HD's is the MBR to be found in my case? HD0, HD1?
If it is on only one HD, how can it see the partitions on the other HD?
Thanks in advance for any clear explanation.
Janvanha
Most linux distros write GRUB in MBR of SDA .
But you can decide where to write GRUB .
Just imagine that you can boot up from all you're HD drive and you're prepare to change the boot order of you're HD in the BIOS you can decided
to let you're windows MBR untouched and write GRUB on the MBR of a other drive
You even can decide to write GRUB on the boot partition of SDA1 being the
second partition of SDA , but in this case you need a other boot loader to boot the OS
The MBR is defined as the first sector (512 bytes) of the hard drive.
There must be boot code (e.g. GRUB) in the MBR of any device that the BIOS attempts to boot. In the BIOS setup, the boot order is defined. The BIOS will try each device in turn until it finds one that is bootable. In your case--without more information, we can't know which device has GRUB on it.
GRUB knows the available devices from the BIOS. It then refers to its configuration file (/boot/grub/menu.lst) to determine where it will send control.
So far I can follow you. But suppose:
1. Win XP is on the sdb, so we will find its bootcode on the bootsector of sdb1
2. and suppose that Vista and Ubuntu are respectiveley on sda1 and sda2.
3. that in the bios sda1 was indicated to start from,
All information about partitions on the sda-device will be easily found.
But what about the information on the sdb-device where XP is on? How and when is this info collected?
(It is needed by Grub in order to compose the different boot options.)
Sorry to bother but this is to improve my understanding.
Thanks in advance
Janvanha
The first sector of each HD has both the root of the partition table and boot code.
Depending on how you use the BIOS during boot, the mbr code on the second hard drive might never get used.
There is also a position for secondary boot code at the beginning of each partition. Windows normally uses that. I'm less sure under what conditions Grub uses that.
A normal Windows MBR just transfers control to the secondary boot code at the start of whichever partition is marked active on the current drive.
The most usual way to chain load Windows from Linux is to configure Grub to transfer control to that same secondary boot code.
So for XP on sdb1 you might tell the bios to directly boot to the mbr on sdb without touching whatever you have in the mbr of sda. Or you might leave the bios always booting to the mbr in sda, which (in your example) loads grub from the /boot/grub directory on sda2, which then chain loads to the secondary boot code on sdb1 never using the boot code in the mbr of sdb.
There are many other ways. I just described the common ones.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.