LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   duel booting os (https://www.linuxquestions.org/questions/linux-newbie-8/duel-booting-os-798636/)

Seleucid 03-29-2010 07:58 AM

duel booting os
 
i have 2 harddrives one 80g running ubuntu 9.10 the other 320g running windows xp he. i was hoping to use both in my system but since the 80g is my master the computer loads up linux. is there a way to use grub at startup for this?

p.s keep the answer simple ive only been messing with linux for a week.

pixellany 03-29-2010 08:11 AM

They way you describe it, it sounds like each drive has boot code in the MBR. This means that you can always change the boot order in the BIOS and get into either system.

Regardless, all you have to do is add the appropriate entries to the /boot/grub/menu.lst file. While running in Linux, open a terminal and run:
fdisk -l (ell, not one) run it as root, or:
sudo fdisk -l (on a Ubuntu system)

Post the results here and also tell us what version of Linux you are using.

The format of the menu.lst entry is somewhere in my "booting" link below

pixellany 03-29-2010 08:13 AM

Quote:

Originally Posted by Seleucid (Post 3916653)
since the 80g is my master

Not relevant---all that matters is the boot order set in the BIOS configuration.

Seleucid 03-29-2010 08:20 AM

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x41ab2316

Device Boot Start End Blocks Id System
/dev/sda1 * 1 9353 75127941 83 Linux
/dev/sda2 9354 9726 2996122+ 5 Extended
/dev/sda5 9354 9726 2996091 82 Linux swap / Solaris

Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf1925c54

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 38912 312560608+ 7 HPFS/NTFS

Seleucid 03-29-2010 08:23 AM

not sure how to check my version

johnsfine 03-29-2010 08:25 AM

IIUC, Ubuntu 9.10 uses grub2. I haven't used grub2 yet, so I can't give you a good answer.

I think Pixellany's answer above assumes grub, not grub2.

You still probably should use a partitioning tool (such as the command Pixellany suggested) to find out which partition on your second drive contains Windows. You might have some small utility partition before the Windows partition.

Then you can configure grub2 to have a "Windows" choice which switches the drive identities (because the Windows install is probably configured to think it is on the "first" drive) then chainloads to the partition boot code of the Windows partition.

I don't know the details, but a google for +"Ubuntu 9.10" +gurb2 pointed me to this page of Ubuntu documentation that looks like a good starting point:
https://wiki.ubuntu.com/Grub2

Edit: I was delayed in the middle of typing the above, meanwhile you posted fdisk output. So we now know your Windows partition is the only partition on your second drive.

Seleucid 03-29-2010 08:29 AM

thank you i will be reading all these areas and take it from there

johnsfine 03-29-2010 08:40 AM

This thread in another forum seems to discuss exactly this same issue
https://answers.launchpad.net/ubuntu...question/98794
You need to skip past a massive amount of info quoted from files on the problem system.

Even though the thread says grub2, it looks to me like a grub answer. Maybe grub2 is less different from grub than I understand.

It says to add an entry like this to your /boot/grub/menu.lst file
Code:

title Windows
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,1)
savedefault
makeactive
chainloader +1

The two map commands reverse the drive identities (lasts until the computer is rebooted) as I described above.

The root command selects the partition you will boot from.

savedefault says that once you make this choice, if you later let the menu timeout, this will be the default choice. You might or might not want that behavior.

makeactive marks the partition with the boot flag. That does neither harm nor good in your case. But if you were multi booting more than one OS that cares about the boot flag, that line would be needed. Windows cares, Linux doesn't, so you can leave the Windows partition always marked bootable.

Seleucid 03-29-2010 08:52 AM

I FOUND IT!!!!!
sudo apt-get install --reinstall libdebian-installer4
sudo os-prober
sudo update-grub

if i wasnt shy i would kiss u all

nonamenobody 03-29-2010 09:13 AM

* edit, looks like you found your answer

I am surprised that Ubuntu didn't find your Windows drive and configure Grub accordingly. Was the drive disconnected when you installed Ubuntu?

Assuming you disconnected your Windows drive, all you need to do is open a terminal* and enter (with the drive reconnected)
Code:

sudo update-grub
If that doesn't work then let us know and hopefully someone can explain how to make the necessary changes your grub scripts to get the configuration you desire. Which should be something along the lines of adding the following to the end of your '/etc/grub.d/40_custom':
Code:

echo "Adding Windows" >&2
menuentry "Windows" {
  set root=(hd1,1)
  chainloader+1
}

Assuming Windows is on the first partition of your second drive. You will need to run update-grub after making the changes to the file.

An alternative would be to add Linux to your Windows boot loader and then change the boot order in the BIOS, but I let you google for that yourself.

* You can start a terminal by clicking on Applications menu 'Applications -> Accessories -> Terminal'


All times are GMT -5. The time now is 04:49 PM.