LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-24-2007, 10:05 PM   #1
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Rep: Reputation: 31
Question grub booting with SATA, WinXP, WinVista


I have a SATA main drive with several partitions, on which I've installed WinXP, Win Vista, and Fedora Core 6. I can get to all of these installations with a bit of tinkering, but some things are not quite right. Also, I've installed an x86 version of Mac OS X on an external USB drive (since it won't recognize SATA), and it would be great if I could boot to that. So far, no luck there at all.

my grub.conf:
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 (hd0,4)
#          kernel /vmlinuz-version ro root=/dev/sda6
#          initrd /initrd-version.img
#boot=/dev/sda
default=2
timeout=`0
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.20-1.2933.fc6)
        root (hd0,4)
        kernel /vmlinuz-2.6.20-1.2933.fc6 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.20-1.2933.fc6.img
#title Fedora Core (2.6.18-1.2798.fc6)
#       root (hd0,4)
#       kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet
#       initrd /initrd-2.6.18-1.2798.fc6.img
title Windows Vista Home Premium
        rootnoverify (hd0,1)
        chainloader +1
title Mac OS X
        rootnoverify (hd1,3)
        chainloader +1
title Windows XP Professional x64
        rootnoverify (hd0,0)
        chainloader +1
Results:
  • When I select Fedora, it boots just fine.
  • When I select Vista or OS X, it fails with a chain loader error.
  • When I select XP, it sends me to another boot menu, which I assume is Vista's menu (since it defaults to Vista and calls XP an "older version of Windows" in the menu).

If I can get these all to boot properly, I'd like the default boot order to go: Vista, OS X (if it boots), Fedora, and XP. Right now, the grub menu comes up and doesn't default to any of these or time out (I guess changing "timeout=`0" would change that?)

Paritions:
SATA drive:
/dev/sda1 : Windows XP
/dev/sda2 : Windows Vista
/dev/sda5 : Fedora /boot
/dev/sda6 : Fedora /
/dev/sda7 : Fedora swap
USB drive:
/dev/sdb3 : OSx86

What have I done wrong so far, and what improvements can I make?
 
Old 03-25-2007, 04:49 AM   #2
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
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 (hd0,4)
#          kernel /vmlinuz-version ro root=/dev/sda6
#          initrd /initrd-version.img
#boot=/dev/sda
default=2
timeout=`0
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.20-1.2933.fc6)
        root (hd0,4)
        kernel /vmlinuz-2.6.20-1.2933.fc6 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.20-1.2933.fc6.img
#title Fedora Core (2.6.18-1.2798.fc6)
#       root (hd0,4)
#       kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet
#       initrd /initrd-2.6.18-1.2798.fc6.img
title Windows Vista Home Premium
        hide         (hd0,0)
        unhide       (hd0,1)
        rootnoverify (hd0,1)
        chainloader +1
title Mac OS X
        hide         (hd0,0)
        hide         (hd0,1)
        unhide       (hd1,2)
        rootnoverify (hd1,2)
        chainloader +1
title Windows XP Professional x64
        hide         (hd0,1)
        unhide       (hd0,0)
        rootnoverify (hd0,0)
        chainloader +1

Last edited by Junior Hacker; 03-25-2007 at 06:50 AM.
 
Old 03-25-2007, 04:56 AM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
To have the boot order you want:

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 (hd0,4)
#          kernel /vmlinuz-version ro root=/dev/sda6
#          initrd /initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
#title Fedora Core (2.6.18-1.2798.fc6)
#       root (hd0,4)
#       kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet
#       initrd /initrd-2.6.18-1.2798.fc6.img
title Windows Vista Home Premium
        hide         (hd0,0)
        unhide       (hd0,1)
        rootnoverify (hd0,1)
        chainloader +1
title Mac OS X
        hide         (hd0,0)
        hide         (hd0,1)
        unhide       (hd1,2)
        rootnoverify (hd1,2)
        chainloader +1
title Fedora Core (2.6.20-1.2933.fc6)
        root (hd0,4)
        kernel /vmlinuz-2.6.20-1.2933.fc6 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.20-1.2933.fc6.img
title Windows XP Professional x64
        hide         (hd0,1)
        unhide       (hd0,0)
        rootnoverify (hd0,0)
        chainloader +1
I hope you are using a floppy to boot, to install grub in the MBR:

Quote:
grub-install /dev/sda

Last edited by Junior Hacker; 03-25-2007 at 06:54 AM.
 
Old 03-25-2007, 08:19 AM   #4
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Junior Hacker
I hope you are using a floppy to boot ....
This PC doesn't have a floppy. I installed grub with Fedora, but not in the MBR.

Thanks for your code. Still having some trouble. The code gives me these results:
OS X is the default OS, tries to load after 5 seconds. Fails with an "HFS+ partition error".
Booting "Vista" doesn't work: grub just displays the boot settings and doesn't move on.
Booting "fedora" works fine.
Booting "XP" seems to launch the Vista boot loader. From there:
Choosing the XP option works.
Choosing the Vista option tries briefly to boot and then reboots the system.

Last edited by deesto; 03-25-2007 at 10:13 AM.
 
Old 03-25-2007, 04:41 PM   #5
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
Well at least you have two systems booting now.

Change default to (0)
Was not sure, but might have to hide OS X from the two Windows, did not think it was necessary because it is on another drive, but I know Windows XP was famous for seeing all and trying to deal with it, no experience with Vista.
Do they show up in the right order?
For the HSF+ http://forum.insanelymac.com/lofiver...hp/t30858.html

I'm guessing you installed XP first, then Vista, then Fedora. In this order, Vista makes a boot menu and places it in the MBR (I think), how does grub deal with that is a little of a question. I'm thinking XP should have been hidden from Vista when Vista was installed, or if the option to add XP as a boot partition during Vista install was available, then you could have said "no".

I'll do a little more research later on when I catch up.
 
Old 03-26-2007, 05:48 PM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
In addition to the (un)hide suggestions, you might want to add makeactive to the non-Linux stanzas. I think the right place to put is after the root ... line, but before chainloader +1.

It may help & it shouldn't do any harm.
 
Old 03-26-2007, 07:50 PM   #7
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Junior Hacker
Well at least you have two systems booting now.
Yeah, but I had three to start with Well, I could get to three with some key fiddling. Grub definitely wasn't working right.
Quote:
Originally Posted by Junior Hacker
Do they show up in the right order?
Yes, thank you.
Quote:
Originally Posted by Junior Hacker
These instructions are for using Acronis (Boot Manager, I assume) to set the OS X partition as "Active". Any way to do this in Linux? Is this the same as setting the "boot" flag with Gparted? Or as archtoad6 said, is it enough to set this partition as "makeactive" in grub?
Quote:
Originally Posted by Junior Hacker
I'm guessing you installed XP first, then Vista, then Fedora. In this order, Vista makes a boot menu and places it in the MBR (I think), how does grub deal with that is a little of a question. I'm thinking XP should have been hidden from Vista when Vista was installed, or if the option to add XP as a boot partition during Vista install was available, then you could have said "no".
Yup, that's the order I installed in, as recommended somewhere or other. I was given the impression that if XP were installed first, Vista wouldn't make its own menu but use the XP menu instead; it seems that's not the case. Also, during Vista install, there was no option to add (or even recognize) the XP partition to its boot menu.
 
Old 03-26-2007, 08:04 PM   #8
aus9
Guru
 
Registered: Oct 2003
Posts: 5,056

Rep: Reputation: Disabled
your ms device is hd0 so you need to use the map command to trick ms into thinking its on C partition.

read my signature on the theory.

eg

title XP
root (hd0,0)
makeactive
chainloader +1

title Vista
root (hd0,1)
map (hd0,1)(hd0,0)
map (hd0,0) (hd0,1)
makeactive
chainloader +1

( it does not which you swap first...a to b or b to a)


(2) as to a usb device...grub legacy fails to get to it as far I can tell.....you could look at isolinux?
 
Old 03-26-2007, 08:11 PM   #9
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
In that web page link is another link posted by Ahmad Moawya, I guess I could have just poted it but thought both pages would be informational as the first one's thread starter figured out his/her problem was installing OS X in a logical partition instead of a primary, I don't know where yours is installed as you did not mention.
I get the feeling when you boot Vista, it turns to the MBR, because you don't have grub installed there, and I would not install it till everything works. As for the makeactive, XP apparently does not need that. But as deesto mentions, it would not hurt to try.
Also, I would unplug the USB for now and get grub to work right with the three on the internal drive, then work on OS X. Do a sort of "process of elimination" so to speek. If Vista boots with the USB unplugged, you know you have to add "hide (hd1, 2)" to Vista section.

I don't know Vista, but you may have to put the disc in and "fixmbr" or jusr install grub in the MBR to overide Vista's boot menu.
 
Old 03-26-2007, 08:31 PM   #10
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Sorry: yes, it's installed on a primary partition on my USB drive. I ignored the info on the first link on that page because of this statement:
I don't think that this will work on usb drives. Only hard disks directly connected to the motherboard.
I could just as easily copy the partition and move it to a new primary partition on my main drive... but I'd have trouble there too, as it's a SATA drive, and the OSx86 installation doesn't recognize SATA drives, so I assume there would be trouble booting there as well.

I can kind of use grub now to get to Fedora and the two Win partitions:
Choose Fedora -> straight boot
Choose XP -> goes to the Vista boot loader, and I can load either Vista (default) or XP one from there (would be nice to boot straight into either one).
Choose Vista -> nope. Shows the grub parameters for this option and stops.
Choose Max OS X -> nope. Shows the grub parameters for this option and stops.

Last edited by deesto; 03-27-2007 at 08:15 AM.
 
Old 03-29-2007, 07:51 AM   #11
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Question

OK, I played with this a bit more and got frustrated, so much so that I actually tried to install another distro (Ubuntu) in addition to Fedora to try and redo the bootloader and fix the problems. Obviously, that's the wrong approach, but I wasn't making any progress. So now I went backwards.

I installed both Ubuntu Desktop 6.10 and 7.04 beta (both 64-bit versions), and neither one completed successfully on my system. I manually created partitions (same partitions for both versions), told them both to install the boot loader on the first hard drive. 6.10 did appear to get through the full install before telling me to remove the install CD and "Press ENTER to reboot", and then it just wouldn't reboot. 7.04, on the other hand, froze consistently at 88% through the install, claiming to be stuck at "importing documents and settings" (even though I tried it three times, and twice didn't select anything to import).

At any rate, in both cases, I got nothing but a grub "Error 15" on reboot, which I think generally means that the partitions are OK and there's a file missing. I went back in and tried to edit stuff by hand, but no dice: same error. In fact, the only way I can boot to anything now is to use a GParted bootable CD and choose to boot to one of the Windows partitions (the menu only goes up to "Partition 4" on each disk, and the Linux parts are higher than that). So my partitions now look like:
SATA drive:
/dev/sda1 : Windows XP
/dev/sda2 : Windows Vista
/dev/sda3 : empty/FAT32
/dev/sda4 : extended partition (contains the remaining partitions)
/dev/sda5 : Fedora /boot
/dev/sda6 : Fedora /
/dev/sda7 : Linux swap
/dev/sda8 : Ubuntu /boot
/dev/sda9 : Ubuntu /home
/dev/sda10 : Ubuntu /
USB drive:
/dev/sdb3 : OSx86
/dev/sdb4 : NTFS data partition

I tried Vista's DVD boot recovery (says there's nothing wrong), tried Vista's bootsect.exe on the DVD to restore the MBR (no effect), can't get anything to work?

Any ideas, please?
 
Old 03-29-2007, 11:37 AM   #12
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
What are the specs on the box?

In what order were the OS's installed -- especially was Vista installed after any of the *nixen?

If so, did things work better before Vista?

(My paranoid streak wonders if the Vista bootloader is designed to be especially uncooperative w/ GRUB.)

What is your overall objective? -- Are you averse to using VM technology to be able to run all those OS's?
 
Old 03-29-2007, 12:59 PM   #13
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by archtoad6
What are the specs on the box?
It's a Gateway GT5426E, AMD Athlon 64 X2 5200+ dual core, 2GB RAM, 320GB SATA drive (secondary drive: 250GB USB):
http://support.gateway.com/s/PC/R/10...09452sp2.shtml

Quote:
Originally Posted by archtoad6
In what order were the OS's installed -- especially was Vista installed after any of the *nixen?
Installed in this order: XP, Vista, OSx86, Fedora, then (multiple attempts at) Ubuntu

Quote:
Originally Posted by archtoad6
If so, did things work better before Vista?
Actually, this all started because the box came pre-loaded with Vista, and I can't stand it. I've asked both Gateway and Microsoft to exchange my copy for a copy of 64-bit XP, but they both refused.
Quote:
Originally Posted by archtoad6
(My paranoid streak wonders if the Vista bootloader is designed to be especially uncooperative w/ GRUB.)
Ironically, I had read somewhere (an OSx86 forum, I think) that XP should be installed before Vista so that Vista didn't install its boot loader; as it turns out, this wasn't the case: Vista did install it, and included the XP partition in its
menu as "Earlier version of Windows".
Quote:
Originally Posted by archtoad6
What is your overall objective? -- Are you averse to using VM technology to be able to run all those OS's?
Although I'd love to at this point, I can't lose Vista completely, because it's the only OS that so far has been completely compatible with my system (and my wife's and my needs to run a few apps). Fedora is close, but I'm having some issues running things under Wine. And although VMware is an option and does work, it's got some serious overhead, even when it's not "runnning". I've got it installed at work on RHEL4, and even with no VMs loaded or VMware launched, its daemon is the third-highest resource consumer on my system right now.

I'd prefer XP 64 over Vista, but I can't seem to find a few XP-compatible drivers for this system, specifically the ethernet card. And if I could get OSx86 running completely, I might consider ditching Windows alltogether and either dual-booting a Linux distro or running Parallels.

In all, I think I have a few installations that are working (some not, like Ubuntu for some reason, and OSx86), but I don't seem to be able to come up with a reliable and consistent method for accessing and booting into them. If I can get to them all via Vista's bootloader, fine; if grub works for everything, great. But right now, nothing works. And before, I had a combination of grub first, then Vista's loader, and I guess something has cracked.

But if all that is too much to ask, how about just a way to boot into something instead of a grub error, please?

Last edited by deesto; 03-29-2007 at 06:00 PM.
 
Old 03-29-2007, 10:25 PM   #14
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
For anyone interested: I was able to get back into my Windows partitions by booting an XP CD (Vista didn't help at all), pressing "R" to repair, and running "fixmbr". That restored what I thought was the Vista loader, but I guess it was the XP loader after all (which Vista must somehow have altered instead of overwriting).

I can even boot into the OSx86 partition, but the boot process ends with an error after a few minutes.

In addition, I am able to get to my Fedora installation by booting with an excellent utility called Super Grub Disk:
http://supergrub.forjamari.linex.org

Somehow, somewhere, one of the options on the disc is able to find a text version of a grub menu that works for Fedora (not for Ubuntu) and lets me boot into it.

Now, how can I fix all this stuff?
 
  


Reply

Tags
boot, grub, vista, windows, xp


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual boot WinXP/Debian, grub error booting WinXP ChemBot Linux - General 5 02-22-2007 04:13 PM
Dual-booting MEPIS and WinXP, I want Grub to default to WinXP jjf Linux - Newbie 8 01-19-2006 03:27 AM
Problem with Grub SATA and WinXP Slalomsk8er Linux - General 2 01-14-2005 05:00 AM
lilo not booting my SATA winxp drive thrice Slackware 5 10-15-2004 02:02 AM
RH 9 ide + WinXP SATA + dual booting Ev D Linux - Hardware 0 07-21-2003 07:19 AM


All times are GMT -5. The time now is 10:14 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration