PDA

View Full Version : Correct grub.conf file for dual boot on same SATA drive


jeepfreak
2007-04-08, 07:09 PM CDT
I have a single SATA drive. I have Windows XP on the 1st partition and Fedora on the second. I have tried numerous settings for the Windows boot option in GRUB and I'm either getting an Error 11, or it just hangs with the word GRUB on the screen.

here is my grub.conf:

#boot=/dev/sda
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.20-1.2933.fc6)
root (hd0,1)
kernel /vmlinuz-2.6.20-1.2933.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.20-1.2933.fc6.img
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,1)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-1.2798.fc6.img
title Windows XP

rootnoverify (hd0,0)
chainloader +1

Here is my fdisk:

[root@localhost ~]# fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 6374 51199123+ 7 HPFS/NTFS
/dev/sda2 6375 6387 104422+ 83 Linux
/dev/sda3 6388 30401 192892455 8e Linux LVM

--------------------------------------------------------------------------------

I just can't this to work. Please give me any advice that you can.

Jeepfreak

jeepfreak
2007-04-08, 07:20 PM CDT
I also tried:

title Windows XP

map (hd0) (hd0) <---------------- this was just a guess to map the 1st partition
rootnoverify (hd0,0)
chainloader +1


But this just continues to have Grub hang. I get all in caps "GRUB" and a blinking cursor. Could it be that my grub.conf is correct, and that my Windows is screwed up???

glennzo
2007-04-08, 07:23 PM CDT
I'm not sure if I see the problem or not, but here's a clip from my grub:
title Fedora Core 6 (2.6.20-1.2933.fc6)
splashimage=(hd0,4)/boot/grub/splash.xpm.gz
root (hd0,4)
kernel /boot/vmlinuz-2.6.20-1.2933.fc6 ro root=LABEL=/12 vga=791
initrd /boot/initrd-2.6.20-1.2933.fc6.img

Notice initrd /boot/initrd
Your's says initrd /initrd

jeepfreak
2007-04-08, 07:24 PM CDT
yeah, but I'm not having probs booting into Fedora, and that string is for the Fedora option

stoat
2007-04-08, 07:30 PM CDT
Try this for your XP section. This is the correct way to remap the drives.title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,0)
chainloader +1EDITED FOR THE RECORD: This is obviously ridiculous since there is only one hard drive. I didn't notice this until later. I am leaving it this way here because jeepfreak tried it and it didn't help (no surprise).

P.S. for glennzo: It's okay not to have /boot preceding kernel and initrd paths in the grub.conf if you have a /boot partition. For example, a snippet from my grub.conf...# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd1,5)
# kernel /vmlinuz-version ro root=/dev/hdb7
# initrd /initrd-version.img
#boot=/dev/hdb6
default=0
timeout=5
splashimage=(hd1,5)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.20-1.2933.fc6)
root (hd1,5)
kernel /vmlinuz-2.6.20-1.2933.fc6 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.20-1.2933.fc6.img

jeepfreak
2007-04-08, 07:51 PM CDT
I tried that and grub is still stalling. I just get "GRUB" with a blinking cursor. Is it possible that I have to fix something in Windows? I've read things about fixing the MBR, but I figured that grub was handling the booting.

stoat
2007-04-08, 08:04 PM CDT
Open your grub.conf again and make sure there is a newline character after each line of the Windows XP section (press ENTER at the end of each line, especially the last one). Delete the resulting blank lines. This is important particularly if you pasted any lines into the grub.conf.

P.S.: While you are at it, delete all blank lines in your grub.conf (like the one after title Windows XP). But leave one at the very end.

P.P.S:I've read things about fixing the MBR, but I figured that grub was handling the booting.1. There's no reason yet to think anything is wrong with the MBR. GRUB stage1 is in the MBR. Changing that now will stop GRUB from booting Fedora.
2. GRUB is handling booting. That's why Fedora is booting.

jeepfreak
2007-04-08, 08:38 PM CDT
Well, I cleaned out the spaces, and made sure that there was a hard return after each line, and one added to the end. Still the same thing.

stoat
2007-04-08, 09:01 PM CDT
I just realized that mapping isn't appropriate in this case. There is only one hard drive so that suggestion was ridiculous. I'm sorry and embarrassed about that. If those lines are still in the grub.conf, remove them.

Do you have any reason to think that the volume boot record of sda1 has been damaged in any way? Such as an attempt to install GRUB there? The volume boot record of sda1 would contain boot code that finds and starts ntldr (XP bootloader). It's this code that the chainloader +1 line in the grub.conf starts.

Seve
2007-04-08, 09:28 PM CDT
Hello:

Just a suggestion:
Try:
title Windows XP
root (hd0,0)
chainloader +1
makeactive

leave at least one blank line / carriage return after makeactive

Edit:
I believe you have to eliminate the empty lines in your /etc/grub.conf file that you posted.

title Windows XP

rootnoverify (hd0,0)
chainloader +1

it should be
title Windows XP
rootnoverify (hd0,0)
chainloader +1

Seve

jeepfreak
2007-04-08, 10:54 PM CDT
tried that as well, and it still hangs. Any other ideas? At this point is there any way to check my window partition?

Dies
2007-04-08, 11:39 PM CDT
tried that as well, and it still hangs. Any other ideas? At this point is there any way to check my window partition?

You mean without restoring the MBR

yup:

http://supergrub.forjamari.linex.org/?section=home

You may also want to try re-installing grub at this point since

title Windows XP
rootnoverify (hd0,0)
chainloader +1
should be all that's needed.

glennzo
2007-04-09, 02:24 AM CDT
yeah, but I'm not having probs booting into Fedora, and that string is for the Fedora optionIf I paid attention to what you wrote.....

stoat
2007-04-09, 05:44 AM CDT
Hello jeepfreak,

I second this idea by Dies. Just for fun, I tried the Super Grub Disk on a floppy. It's a handy utility to have around. If your Windows XP bootloader is still working, the Super Grub Disk will boot it.
You mean without restoring the MBR

yup:

http://supergrub.forjamari.linex.org/?section=home

jeepfreak
2007-04-09, 06:26 AM CDT
Will try that tonight. (supergrub) Is there a way to repair the Windows bootloader, or do I just have to reinstall Windows?

ever-free
2007-04-09, 07:06 AM CDT
The best is always to take GAG, THE GRAPHICAL BOOT MANAGER. You will find it at http://gag.sourceforge.net/
GAG uses only the MBR and you can resore the MBR. GRUB is a chainloader an uses the MBR and the /boot partion.
If you use one ore more Linux systems on your pc, install always the GRUB in the /boot partition. With GAG you can activate the Windows or Linux (/boot) partition and you never will have any problems. You can install GAG from floppy disk or CD.
I use it since some years and never had any problems. :)

stoat
2007-04-09, 07:34 AM CDT
Is there a way to repair the Windows bootloaderYes. But if you can get XP booted again, backup any valuable data to another medium before continuing with this. Then you can more confidently play around with things like fixmbr, fixboot, grub-install or even start over as indicated.

Try the Super Grub Disk tonight. Best wishes.

...install always the GRUB in the /boot partition.I have to admit that I never install GRUB in the MBR nowadays. I have tried many bootloader schemes, and I just happen to prefer booting Linux with the XP bootloader. But you are already in this now. You can continue to try and fix it if the installations are worth the effort (many apps installed, many system updates, etc.). Or, try again or other ways if things never work out with this. It happens.

jeepfreak
2007-04-09, 11:58 AM CDT
Well, the "supergrub" link is down... I'll try later.