LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   hard drive dev assignment in GRUB (http://www.linuxquestions.org/questions/fedora-35/hard-drive-dev-assignment-in-grub-507601/)

daisychick 12-05-2006 08:08 AM

hard drive dev assignment in GRUB
 
Ok, I have a system that has two SATA drives on a SATA RAID card running FC5 and 1 ATA drive connected to the motherboard running windows. Fdisk -l shows

hda
sda
sdb

Now I can get GRUB to load linux fine but I can't get it to load windows. I keep getting an error 13. How can I find out what drive is what according to GRUB so I can get windows to load? i.e. which is hd0, hd1, hd2... etc. etc.

theNbomr 12-05-2006 09:05 AM

I use a setup like yours, without the raid component. This is how I get grub to load Windows.
Code:

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

--- rod.

daisychick 12-05-2006 10:28 AM

Nope. That didn't work... Any other suggestions?

theNbomr 12-05-2006 07:35 PM

In your BIOS configuration, you should be able to define which drive is considered 'first', 'second', etc. Windows likes to be on what it thinks is the 'first' drive. Make the ATA drive the 'first' drive, and remove the part about using 'map' to logically swap drives in the grub config. You might have to use grub to do a logical swap in order to boot linux this way.

--- rod.

glussier 12-05-2006 07:43 PM

fdisk should list the drives in the order which they are seen by the system and grub. Then, it's only a matter of numbering them from 0.

daisychick 12-06-2006 09:04 AM

Quote:

Originally Posted by daisychick
Fdisk -l shows

hda
sda
sdb

So if what you're saying is, that if the above is true, then GRUB should accept the hard drives as:

hda = hd0
sda = hd1
sdb = hd2

right?

Well, problem is, there's already a hd0 listed in GRUB. That's what boots linux. and linux is not on hda. It's on sda/sdb. I tried using hd1 and hd2 but got the error 13 on both. Suggestions?

theNbomr 12-06-2006 09:26 AM

Can you show us what your existing grub.conf file looks like? It is easier to guess what is going on with something concrete to see, and provides a good point of reference for suggestions. Also, in what order were the two operating systems installed? Is Windows capable of loading and running if it is the only installed disk?
--- rod.

daisychick 12-06-2006 10:00 AM

OOO crap. I made a mistake on the last post. Linux is booting off hd1 according to grub. Well so that's right anyways. Means that hd0 should be windows then... why won't it boot?

The windows OS was installed on one hdd and has been running fine for 5 years. FC5 was installed on two new SATA hdd via PCI card and runs fine. I can access both using the BIOS to select which drive I want to boot from.

Code:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd1,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup01/LogVol00
#          initrd /initrd-version.img
#boot=/dev/md0
default=1
timeout=5
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.15-1.2054_FC5)
        root (hd1,0)
        kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup01/LogVol00
        initrd /initrd-2.6.15-1.2054_FC5.img
#
title Windows 2000
        rootnoverify (hd0,0)
        chainloader +1

fdisk shows:
Code:

[root@server ~]# fdisk -l

Disk /dev/hda: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1      19929  160079661    c  W95 FAT32 (LBA)

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          13      104391  fd  Linux raid autodetect
/dev/sda2              14      38913  312464250  fd  Linux raid autodetect

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

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1          13      104391  fd  Linux raid autodetect
/dev/sdb2              14      38913  312464250  fd  Linux raid autodetect

Disk /dev/md1: 319.9 GB, 319963267072 bytes
2 heads, 4 sectors/track, 78116032 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md0: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn't contain a valid partition table


osor 12-06-2006 10:02 AM

You can always test to see what grub sees the drives as in the grub console. For example, "geometry (hd0)" will give you the geometry for that drive (including partition table). You can compare partition tables to the ones you think you have.

Additionally, I think grub has tab-completion for device names (though I'm not sure of this).

osor 12-06-2006 04:30 PM

Quote:

Originally Posted by osor
Additionally, I think grub has tab-completion for device names (though I'm not sure of this).

Yes, I just tried this method. For example, I type (at the GRUB console) "root (" and then press Tab twice. Since the open parenthesis is the start of a drive name in GRUB-speak, it will spit out possible drives that it detected. This may not work on all drives or all cases (perhaps certain configurations aren't auto-detected, but are available with explicit references).

theNbomr 12-07-2006 09:43 AM

I don't see any reason that your grub.conf shouldn't boot Windows. However, I do have one thing that you might try, and I'm not sure precisely why it should work, but it just might. It might have something to do with how Windows sees the drives, in terms of 'first' vs 'second'.
In your BIOS, reverse the definitions of first and second hard disk. Then, use grub to boot the respective OS's from the reversed definitions. So your grub.conf would look something like this:

Code:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd1,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup01/LogVol00
#          initrd /initrd-version.img
#boot=/dev/md0
default=1
timeout=5
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.15-1.2054_FC5)
        root (hd1,0)
        kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup01/LogVol00
        initrd /initrd-2.6.15-1.2054_FC5.img
#
title Windows 2000
        rootnoverify (hd1,0)
        map (hd0) (hd1)
        map (hd1) (hd0)
        chainloader +1

If that doesn't work, then I'm at a loss. Good luck.

--- rod.

daisychick 12-07-2006 03:17 PM

I can't change the order in the bios. No matter what board I use, it will always see the ATA drives attached to the board before the SATA drives attached to the PCI card.

theNbomr 12-07-2006 04:13 PM

Okay, so did you try what osor said? Does grub's view of the possible drive numbers agree with what is in your grub.conf? It is also possible, I think, that Windows' view of what the drives are is different from what grub's is. This should be fixable by using grub's map function.

--- rod.

daisychick 12-09-2006 07:00 AM

grub geometry shows:

hd0: part0/ ext2fs - type 0xfd. part1/unknown - type -xfd
hd1: part0/ fat - type 0xc

grub now has:
Code:

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

still getting "Error 13: Invalid or unsupported executable format

theNbomr 12-09-2006 11:33 AM

Well, I'm at a loss now. However, I did a Google search for "Error 13: Invalid or unsupported executable format", and got a lot of hits that looked germaine to your question. This one http://ubuntuforums.org/showthread.p...ed#post1650325
even had a possible solution, although I don't understand it. For now, though, I'm out of ideas. Perhaps starting a fresh thread will draw interest from more people.

--- rod.


All times are GMT -5. The time now is 11:35 PM.