Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-07-2006, 01:31 PM
|
#1
|
LQ Newbie
Registered: Sep 2005
Location: north
Distribution: gentoo
Posts: 23
Rep:
|
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
|
|
|
10-07-2006, 03:07 PM
|
#2
|
LQ Newbie
Registered: Sep 2005
Location: north
Distribution: gentoo
Posts: 23
Original Poster
Rep:
|
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.
|
|
|
10-07-2006, 08:50 PM
|
#3
|
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908
|
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.
|
|
|
All times are GMT -5. The time now is 07:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|