LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 12-05-2006, 08:08 AM   #1
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

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

Last edited by daisychick; 12-05-2006 at 08:14 AM.
 
Old 12-05-2006, 09:05 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
Old 12-05-2006, 10:28 AM   #3
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

Original Poster
Rep: Reputation: 0
Nope. That didn't work... Any other suggestions?
 
Old 12-05-2006, 07:35 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
Old 12-05-2006, 07:43 PM   #5
glussier
Member
 
Registered: Jul 2005
Location: Montreal, Qc, Canada
Distribution: Fedora Core 5/6 Slackware 10.1/11
Posts: 120

Rep: Reputation: 15
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.
 
Old 12-06-2006, 09:04 AM   #6
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

Original Poster
Rep: Reputation: 0
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?
 
Old 12-06-2006, 09:26 AM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
Old 12-06-2006, 10:00 AM   #8
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

Original Poster
Rep: Reputation: 0
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

Last edited by daisychick; 12-06-2006 at 10:03 AM.
 
Old 12-06-2006, 10:02 AM   #9
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 79
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).
 
Old 12-06-2006, 04:30 PM   #10
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 79
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).
 
Old 12-07-2006, 09:43 AM   #11
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

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

Last edited by theNbomr; 12-07-2006 at 09:50 AM.
 
Old 12-07-2006, 03:17 PM   #12
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

Original Poster
Rep: Reputation: 0
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.
 
Old 12-07-2006, 04:13 PM   #13
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
Old 12-09-2006, 07:00 AM   #14
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

Original Poster
Rep: Reputation: 0
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
 
Old 12-09-2006, 11:33 AM   #15
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

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


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
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
Hard Drive to /dev mapping rdhochhalter SUSE / openSUSE 4 11-02-2005 06:37 PM
Installed GRUB on 3rd hard drive, how do I boot 1st drive? jesusphreak Linux - Newbie 4 04-06-2005 09:34 AM
Grub to access new hard drive and old multi os hard drive ? gedi1 Linux - Hardware 0 06-03-2004 12:01 PM
USB hard drive rejects dev number mad2physicist Linux - Hardware 16 12-15-2003 12:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

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