LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 03-29-2010, 08:58 AM   #1
Seleucid
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Rep: Reputation: 0
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.
 
Old 03-29-2010, 09:11 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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
 
1 members found this post helpful.
Old 03-29-2010, 09:13 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by Seleucid View Post
since the 80g is my master
Not relevant---all that matters is the boot order set in the BIOS configuration.
 
1 members found this post helpful.
Old 03-29-2010, 09:20 AM   #4
Seleucid
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Original Poster
Rep: Reputation: 0
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
 
Old 03-29-2010, 09:23 AM   #5
Seleucid
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Original Poster
Rep: Reputation: 0
not sure how to check my version
 
Old 03-29-2010, 09:25 AM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
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.

Last edited by johnsfine; 03-29-2010 at 09:27 AM.
 
1 members found this post helpful.
Old 03-29-2010, 09:29 AM   #7
Seleucid
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Original Poster
Rep: Reputation: 0
thank you i will be reading all these areas and take it from there
 
Old 03-29-2010, 09:40 AM   #8
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
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.

Last edited by johnsfine; 03-29-2010 at 09:45 AM.
 
1 members found this post helpful.
Old 03-29-2010, 09:52 AM   #9
Seleucid
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Original Poster
Rep: Reputation: 0
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
 
Old 03-29-2010, 10:13 AM   #10
nonamenobody
Member
 
Registered: Oct 2002
Posts: 138

Rep: Reputation: 22
* 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'

Last edited by nonamenobody; 03-29-2010 at 10:15 AM. Reason: Cross post
 
  


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
Duel Booting Windows XP harley51 Fedora 5 06-28-2009 03:57 PM
can I re-installing duel booting phoenix_wolf Linux - Newbie 1 07-06-2008 02:26 AM
Duel Booting tommytomato Linux - General 16 05-31-2007 10:04 AM
Duel booting with Linspire mat_uk111 Linspire/Freespire 1 12-08-2005 03:36 PM
Duel Booting Jedi_Cheese Linux - Newbie 4 01-15-2002 12:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:24 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