LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-07-2006, 01:31 PM   #1
svenwinkle
LQ Newbie
 
Registered: Sep 2005
Location: north
Distribution: gentoo
Posts: 23

Rep: Reputation: 15
setting up grub in a multiple hard drive multiple OS environment


I believe I have a fundamental misunderstanding of how grub is supposed to handle multiple hard drives with multiple operating systems (particularly with windows xp being one of the OS's).

I recently decided to try gentoo, but I will need windows xp on the system as well for some online courses that require shockwave and flash 9. I have read in the gentoo handbook and a gentoo dual boot wiki page that says I need to put Windows on the first hard drive (hd0,0) and to have the linux drive be the first drive in the boot sequence in the bios. I have set up things the way those pages described. Here is my grub.conf file:

=============================================================
livecd / # cat /boot/grub/grub.conf
default 0
timeout 30
splashimage=(hd1,0)/grub/splash.xpm.gz
title=Gentoo Linux
root (hd1,0)
kernel /kernel-genkernel-x86_64-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hdb3
initrd /initramfs-genkernel-x86_64-2.6.17-gentoo-r7

title=Possible Windows P1
rootnoverify (hd0,0)
makeactive
chainloader +1
=============================================================

Windows is on /dev/hda and linux is on drive hdb. The linux drive is partitioned as follows:

=============================================================
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 31 248976 83 Linux
/dev/hdb2 32 397 2939895 82 Linux swap / Solaris
/dev/hdb3 398 7476 56862067+ 83 Linux
=============================================================

In case it's helpful, my windows drive is partitioned as follows:

=============================================================
Device Boot Start End Blocks Id System
/dev/hda1 * 1 3738 30025453+ 7 HPFS/NTFS
=============================================================

/dev/hdb1 is my /boot partition. /dev/hdb3 is my / partition. I have grub installing to the mbr on this drive. If I shouldn't do that, please let me know. As you can see I have the /boot partition toggled to be the dos bootable partition (as I have done on all the other systems I have set up).

I have tried putting the listing for the Windows drive above the linux drive in the grub.conf file. I have tried adding the lines:
map (hd0) (hd1)
map (hd1) (hd0)

That shouldn't have worked (and it didn't) but I did read that the windows drive does need to be fooled into thinking it's a different drive in some cases.

I am running out of ideas to try. I think I could open the computer and swap the drives around so that the windows drive becomes hd1, but I am pretty sure that would accomplish nothing.

Here is the error that I get when booting with the linux hard drive first in the boot order:

=============================================================
Booting 'Gentoo Linux'

root (hd1,0)
Filesystem type unknown, partition type 0x7
kernel /kernel-genkernel-x86_64-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hdb3

Error 17: Cannot mount selected partition

Press any key to continue
=============================================================

If I hit enter it will take me to my grub menu. The screen has a bunch of lines through it, but I think that is a problem with my ati video card which I'm not too concerned about. From the grub menu I can select the Linux drive or the Windows drive, but either gives me an error. The Linux drive will give the same error listed above while the Windows drive gives me an error 13 saying that the executable format is invalid. I believe error 13 indicates a kernel that is not capable of multiboot. But I'm not sure how to get around that.

If I change the boot order in the bios so the windows drive boots first, it will boot. Based on that, I don't think the mbr on the windows drive is corrupted, but I could be mistaken.

If anyone has any advice, I'd be glad to hear it.

Thanks
 
Old 10-07-2006, 03:07 PM   #2
svenwinkle
LQ Newbie
 
Registered: Sep 2005
Location: north
Distribution: gentoo
Posts: 23

Original Poster
Rep: Reputation: 15
Well, once again just trying random stuff fixed a problem. Here is my new grub.conf file:

=============================================================
default 0
timeout 30
title Gentoo
root (hd0,0)
kernel /kernel-genkernel-x86_64-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hdb3
initrd /initramfs-genkernel-x86_64-2.6.17-gentoo-r7

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


I'm not sure why that works. I just set my Gentoo drive to hd0,0 even though it is /dev/hdb and my windows drive to hd1,0 even though it is /dev/hda. I then added the map commands to the end of the windows section of the grub.conf to fool the windows partition into thinking that it is hd0,0 even though it actually is hd0,0.

The only other explanation I can think of is that for some reason, grub is labeling the hdx,y stuff based on the boot order from the bios rather than their tags hda, hdb, etc.

Incidentally, I also took out the splash image section of the grub.conf and that got rid of the lines. I'm pretty sure that is due to the normal fb problems that ati cards have.
 
Old 10-07-2006, 08:50 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Your current, working grub.conf seems to imply that hdb is jumbered to Master, and hda is jumpered to Slave. How you managed to achieve that is beyond me, but that seems to be the bottom line. Gentoo is on the Master drive; XP is on the Slave drive; your current grub.conf confirms that setup.

It isn't a matter of BIOS. It's the jumper settings of the hard drives, and how Gentoo implements software/hardware.

Wierd. I thought I had seen all variations of problems/successes with GRUB.
 
  


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
multiple hard drive question digimars Linux - Hardware 3 05-19-2006 08:38 AM
How to have multiple Linux distros on a hard drive? Micro420 Linux - General 9 10-03-2005 09:18 PM
Multiple Hard Drive Problem with Red Hat 9.0 swap01 Linux - Hardware 1 08-11-2004 06:13 PM
Multiple Linux distros on 2nd hard drive? frija Linux - Newbie 2 04-23-2004 12:32 AM
Multiple distros on same hard drive problem baue8673 Linux - Software 4 02-11-2004 01:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 06:58 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
Open Source Consulting | Domain Registration