Dual Boot (winxp / ubunto 10.x) - how does installer know where mbr is?

Asked by DJ Len

Jumping into Linux for the first time and before I make the leap, I have a question about the install process w.r.t. how does the installer know where the master boot record is? I have a C drive (100gb/NTFS) all for winxp and a new 320gb drive to use for ubuntu.

Note: I did run the ubuntu 10.04 installer and was doing well but quit on step 8 of 8 because it appeared as if the boot loader was going to be written to the new drive (identified as /dev/sda and lists that it's ext4 format so I know its the new drive) but I thought it should have be pointing to the C drive which is identified as /dev/sdb and lists NTFS.

FYI: I read about 15 different posts about dual boot issues looking for something that would answer this or be close. I found some answers that were on the right track and actually helped me greatly with some of the steps. It only Step 8 of 8 where my question lies.

Can anyone please advise after reading the info below?

Steps (skipping to step 4 for everyone's sanity ;-)
4. prepare disk space: chose Specify partitions manually (advanced)
5. /dev/sdb was listed as 100gb NTFS and /dev/sda was listed as 320gb.

   I highlighted /dev/sda and chose New Partition Table. highlighted free space
   and chose Add.
   Then created a new Primary, 300000, location=Beginning, Use as: Ext4... Mount point: /
   Then I specified the rest as: Logical, Beginning, swap area

skipping to step 8:
the dialog had a checked item for configuration of the bootloader and there was an Advanced button.
I viewed the Advanced info and it said that it would update the mbr in "/dev/sda".

This is where I was confused. I thought it would point to the main (or C) drive "/dev/sdb".

Please let me know if there is any information that I can provide to you so I can help you help me.
kind regards,
Len

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Marc Stewart
Solved:
Last query:
Last reply:
Revision history for this message
Best Marc Stewart (marc.stewart) said :
#1

The installer finds the MBR the same way anything else does: it's in a pre-defined location. In this case, the installer will create it on the first hard drive, /dev/sda. The 100Gb one might be the "main" drive to you, but the computer sees it as the second device, /dev/sdb. You'll have to swap over the connections if you want to change that, although it's probably unnecessary.

Unless you're going to disconnect the Ubuntu drive occasionally, and therefore need the bootloader on the Windows drive, you should just let the installer do its thing-it seemed like the process was going well. An entry for Windows will still be placed in the bootloader, GRUB, so you should be able to dual-boot just fine.

Revision history for this message
DJ Len (djlen) said :
#2

Hi Marc,

First, thank you for the fast response!! Your answer makes perfect sense. I'm installing the new OS to the clean drive so the installer thinks of it as the primary "/dev/sda". You also read my mind about disconnecting the Ubuntu drive occasionally: I did forget to mention that I have a laptop and use the dvd bay for the 2nd drive (with a harddrive caddy). I have a normal D drive (in another caddy) that is purely for file storage. However, I will be inserting the new drive running Ubuntu a couple of weeks a month. That said, my plan is to move completely to Ubuntu in January/Feruary as I can see how folks love the speed, flexibilty and more. I was amazed at how fast it booted up (after I quit the install) last night.

That said, would you recommend that I first do the install to the new drive without the bootloader. Verify when I reboot the winxp does launch fine and then run ubuntu install again to hopefully have it add the bootloader to the /dev/sba?
I'm wondering if the have to run some kind of a bootloader while xp is active so it is added to the "main drives" mbr.

I did read a post that mentioned something like that but was unclear what to expect when running the install again.

(please note I chose the "I still need an Answer" button but probably could have used the "add a comment" one) hope that was ok.

Revision history for this message
Marc Stewart (marc.stewart) said :
#3

Looks like "I still need an answer" was the right thing to choose. I had to think about this for a bit, and I was hoping to check but I couldn't get a spare drive.

If you have an XP installation disc (or can get one), you can always experiment, safe in the ability to restore the Windows bootloader and MBR, without having to reinstall the entire OS. (The Ubuntu live CD can do the same for GRUB.) I've forgotten exactly how but it's described on plenty of websites.

Because the Ubuntu drive takes priority (becoming /dev/sda) when it's attached, having GRUB on that drive is probably better, since when it's disconnected, boot priority reverts to the Windows drive and the untouched bootloader on it. (That's what I wanted to verify: if the bootloader on the Windows drive *is* altered, then you'll need the Ubuntu drive to even start Windows, but like I said, with an XP CD you can fix that quickly enough.)

So if you have an XP CD, just go ahead and let the Ubuntu installer run completely.

If you don't have one, then I'd still go ahead and let the Ubuntu installer finish, then after checking that Ubuntu boots, shut down and disconnect the Ubuntu drive, then check that Windows will start without it.

If it can't start without the other drive, then you should reattach it and run the installer again. Create a /boot partition (~30MB) on the Windows drive, and use the manual partitioning of the Ubuntu installer to make sure GRUB is installed there by selecting it for the mount point /boot. Select the mounts for the partitions created for Ubuntu the first time round again— / (root) (don't keep contents), swap, and /home (if applicable)—and let the installation complete again. With GRUB on the permanent drive, you should then be able to boot into Windows at any time, and Ubuntu when its drive is connected.

Revision history for this message
DJ Len (djlen) said :
#4

Thanks Marc Stewart, that solved my question.

Revision history for this message
DJ Len (djlen) said :
#5

Hi Marc,

I was able to back up the MBR with a free utility. However, I did use your both suggestions using a vmware environment to play it safe. The install of ubuntu on a c partition worked so easy and I had dual boot easily. I then reset vmware and installed it on a the 'new' drive. This of course has no knowledge of the boot master from C so it is essentially standalone. When I reboot it boots directly into Ubuntu. If I press f12 when rebooting I can boot windows. Not elegant but it does the job. Either solution allows for mounting folders on the c drive so I files can be shared between systems.

Thank you again for your help and patience. This new ubuntu beginner is very grateful and am glad to be apart of this community. Just hope I can pay it forward some day.

kind regards,
Len

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#6

If you are new to Ubuntu, i recommend reading through the Ubuntu Manual, it's very informative:

http://ubuntu-manual.org/

Click on the "download Button" to download the latest PDF version.