LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-03-2005, 06:00 PM   #1
patufet99
Member
 
Registered: Dec 2005
Location: Switzerland
Distribution: Debian/Ubuntu
Posts: 37

Rep: Reputation: 15
Dual boot. Grub configuration question.


Hello,

I am trying to configure Grub in order to be able to boot in Debian or XP.
I have Debian installed in a Sata HD seen in the Bios as Device 4.
XP is installed in a IDE HD seen in the Bios as Device 1.

Grub starts Linux with no problem, but I cannot manage to start XP.

menu.lst file:

color cyan/blue white/blue

title Windows XP
rootnoverify (hd1,0)
makeactive
chainloader +1
savedefault

title Debian GNU/Linux, kernel 2.6.12-1-amd64-generic
root (hd0,0)
kernel /vmlinuz-2.6.12-1-amd64-generic root=/dev/sda6 ro
initrd /initrd.img-2.6.12-1-amd64-generic
savedefault
boot

title Debian GNU/Linux, kernel 2.6.12-1-amd64-generic (recovery mode)
root (hd0,0)
kernel /vmlinuz-2.6.12-1-amd64-generic root=/dev/sda6 ro single
initrd /initrd.img-2.6.12-1-amd64-generic
savedefault
boot


When I select XP at boot Grub just writes

title Windows XP
rootnoverify ...

and nothing happens.
I don't understand why linux is in (hd0,0) and not in (hd3,0).
How can I know which hd correspond to which /dev ?

If I unplug the linux hard disk, XP boots normally.

Any help is welcome!

Thanks.
 
Old 12-03-2005, 06:19 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,898

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Linux isn't in hd0, it's in root=/dev/sda6. The first stage of grub is in hd0.

Try adding this between title windows and rootnoverify:
map (hd0) (hd1)
map (hd1) (hd0)

Since the Linux entry says root(hd0,0), apparently the SATA drive is recognized as the first (primary) drive, and the IDE is recognized as the second (slave). Windows wants to be first, so you have to fool it into thinking it is on the first drive. That's what the two map lines are for.

PS. is that how the jumpers are set on the drives? SATA is master, and IDE is slave?

Last edited by bigrigdriver; 12-03-2005 at 06:27 PM.
 
Old 12-04-2005, 03:12 AM   #3
Basel
Member
 
Registered: Feb 2004
Location: United States
Distribution: Ubuntu 10.10
Posts: 319

Rep: Reputation: 30
Quote:
Originally Posted by bigrigdriver
PS. is that how the jumpers are set on the drives? SATA is master, and IDE is slave?
Jumbers are irrelevant with SATA HDs.
 
Old 12-04-2005, 09:47 AM   #4
patufet99
Member
 
Registered: Dec 2005
Location: Switzerland
Distribution: Debian/Ubuntu
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bigrigdriver
Linux isn't in hd0, it's in root=/dev/sda6. The first stage of grub is in hd0.

Try adding this between title windows and rootnoverify:
map (hd0) (hd1)
map (hd1) (hd0)

Since the Linux entry says root(hd0,0), apparently the SATA drive is recognized as the first (primary) drive, and the IDE is recognized as the second (slave). Windows wants to be first, so you have to fool it into thinking it is on the first drive. That's what the two map lines are for.

PS. is that how the jumpers are set on the drives? SATA is master, and IDE is slave?
Thanks for your reply.

I don't know how but finally it works.
I just changed in menu.lst rootnoverify (hd1,0) by (hd0,0):

title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1
savedefault

The thing I still does not understand is why in /boot/grub/device.map

(fd0), /dev/fd0
(hd0), /dev/hda
(hd1), /dev/sda


hd0 being the ide drive where xp is installed and
hd1 being the sata disk where linux is installed
why

title Debian GNU/Linux, kernel 2.6.12-1-amd64-generic
root (hd0,0)
kernel /vmlinuz-2.6.12-1-amd64-generic root=/dev/sda6 ro
initrd /initrd.img-2.6.12-1-amd64-generic
savedefault
boot

boots Linux?

shouldn't it be root (hd1,0) that boots linux?

Thank you again.
 
Old 12-04-2005, 11:10 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,996

Rep: Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219
One would have thought so.
When you said in the original post
Quote:
If I unplug the linux hard disk, XP boots normally.
did you mean that it used the XP loader, not grub ???.

What do the following show ???
Code:
fdisk -l
cat /etc/fdisk
 
Old 12-04-2005, 11:37 AM   #6
patufet99
Member
 
Registered: Dec 2005
Location: Switzerland
Distribution: Debian/Ubuntu
Posts: 37

Original Poster
Rep: Reputation: 15
Hello,

My last post was wrong.
When I re-boot the system it does not take in account my last menu.lst modifs. It only takes it in account at the next re-boot. Should I tell grub to take in account this modifs. with a command before re-boot?
The modification I thought to work was not the good one, but the previous.
The version that works is the one proposed by bigdigriver:

title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
makeactive
chainloader +1
savedefault



Quote:
did you mean that it used the XP loader, not grub ???.
Grub is in the first partition of the sata hd where linux resides.
If I unplug this drive, XP boots without grub.

Thank you very much for your help!
 
Old 12-04-2005, 11:47 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,996

Rep: Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219
Makes a lot more sense
 
  


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
(another) Grub dual boot question with XP/Redhat agerkis Linux - Newbie 6 01-11-2011 03:14 PM
Another Grub/Dual Boot Question linda SUSE / openSUSE 15 08-21-2005 08:19 PM
GRUB and Dual-boot configuration rgbrock1 SUSE / openSUSE 9 07-21-2005 09:02 AM
grub/dual boot problem/question... wrat Linux - Newbie 2 11-28-2004 04:59 PM
GRUB/dual boot question 0perat0r Linux - Newbie 6 07-19-2004 10:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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

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