Fedora This forum is for the discussion of the Fedora Project. |
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.
|
|
12-26-2007, 08:08 AM
|
#1
|
Member
Registered: Jun 2005
Distribution: RHEL, CentOS, Debian, Ubuntu, Arch
Posts: 181
Rep:
|
GRUB won't boot into Windows SATA drive
I have two hard drives. One is an IDE drive with Fedora 8 installed. The other is SATA with Windows XP installed. When I boot up, GRUB shows both options but when I select windows, it just says
Code:
Windows (XP Home SP2)
rootnoverify (hd1,0)
chainloader +1
my grub.conf if that helps:
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.23.9-85.fc8)
root (hd0,0)
kernel /boot/vmlinuz-2.6.23.9-85.fc8 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.23.9-85.fc8.img
title Fedora (2.6.23.1-42.fc8)
root (hd0,0)
kernel /boot/vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.23.1-42.fc8.img
title Windows (XP Home SP2)
rootnoverify (hd1,0)
chainloader +1
thanks,
gary
|
|
|
12-26-2007, 08:46 AM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790
Rep:
|
Windows is stupid, it has to be the primary or first drive to boot from. You need to map your drives so Windows "thinks" it the first drive. Try something like;
Code:
title Windows (XP Home SP2)
map (hd0,0) (hd0,1)
map (hd0,1) (hd0,0)
setup (hd0)
rootnoverify (hd0,1)
chainloader +1
|
|
|
12-26-2007, 09:03 AM
|
#3
|
Member
Registered: Jun 2005
Distribution: RHEL, CentOS, Debian, Ubuntu, Arch
Posts: 181
Original Poster
Rep:
|
Well, it got further that time until it game me an error
Code:
Error 13: Invalid or unsupported executable format
EDIT:
I changed a few numbers from Lenard's suggestion.
new grub.conf:
Code:
title Windows (XP Home SP2)
map (hd0,0) (hd1,0)
map (hd1,0) (hd0,0)
setup (hd1)
rootnoverify (hd1,0)
chainloader +1
Last edited by garyozzy; 12-26-2007 at 09:16 AM.
Reason: solved!
|
|
|
12-26-2007, 02:47 PM
|
#4
|
Senior Member
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790
Rep:
|
What does your /boot/grub/device.map file show???
cat /boot/grub/device.map
|
|
|
12-26-2007, 03:02 PM
|
#5
|
Member
Registered: Jun 2005
Distribution: RHEL, CentOS, Debian, Ubuntu, Arch
Posts: 181
Original Poster
Rep:
|
sorry I wasn't more specific earlier. changing the numbers fixed the problem.
|
|
|
12-26-2007, 05:51 PM
|
#6
|
Member
Registered: May 2007
Distribution: LFS
Posts: 628
Rep:
|
Quote:
Originally Posted by garyozzy
title Windows (XP Home SP2)
map (hd0,0) (hd1,0)
map (hd1,0) (hd0,0)
setup (hd1)
rootnoverify (hd1,0)
chainloader +1
|
Hello garyozzy,
I'm glad things are working now. But your grub.conf has some unusual syntax in it now even though XP boots. I thought I should at least point these things out to you.
First, I recommend that you change your map command lines to this traditional syntax...
Code:
map (hd0) (hd1)
map (hd1) (hd0)
See the difference? Yours are designating partitions. They should be designating only drives. I guess yours work because they still remap the two drives and the map command doesn't object to the commas and extra numbers. But the partition syntax doesn't need to be there. Here is the GRUB manual on the subject...
Quote:
Originally Posted by The GRUB Manual
13.3.23 map
— Command: map to_drive from_drive
Map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. Here is an example:
grub> map (hd0) (hd1)
|
Next, I recommend that you remove that setup command line from the XP section of your grub.conf. That command is a GRUB installation command. It is usually used in the GRUB shell to install or reinstall GRUB. The setup command is a front-end for the install command which reinstalls GRUB. With that in your grub.conf, you are reinstalling GRUB every time you boot XP. You only need the title, map, rootnoverify, and chainloader commands to fix the very common problem you had. I recommend not runnning setup over and over like that.
Quote:
Originally Posted by The GRUB Manual
13.3.34 setup
— Command: setup [--force-lba] [--stage2=os_stage2_file] [--prefix=dir] install_device [image_device]
Set up the installation of GRUB automatically. This command uses the more flexible command install (see install) in the backend and installs GRUB into the device install_device. If image_device is specified, then find the GRUB images (see Images) in the device image_device, otherwise use the current root device, which can be set by the command root. If install_device is a hard disk, then embed a Stage 1.5 in the disk if possible.
The option --prefix specifies the directory under which GRUB images are put. If it is not specified, GRUB automatically searches them in /boot/grub and /grub.
The options --force-lba and --stage2 are just passed to install if specified. See install
|
Quote:
Originally Posted by The GRUB Manual
13.3.18 install
— Command: install [--force-lba] [--stage2=os_stage2_file] stage1_file [d] dest_dev stage2_file [addr] [p] [config_file] [real_config_file]
This command is fairly complex, and you should not use this command unless you are familiar with GRUB. Use setup (see setup) instead.
In short, it will perform a full install presuming the Stage 2 or Stage 1.510 is in its final install location.
In slightly more detail, it will load stage1_file, validate that it is a GRUB Stage 1 of the right version number, install in it a blocklist for loading stage2_file as a Stage 2. If the option d is present, the Stage 1 will always look for the actual disk stage2_file was installed on, rather than using the booting drive. The Stage 2 will be loaded at address addr, which must be `0x8000' for a true Stage 2, and `0x2000' for a Stage 1.5. If addr is not present, GRUB will determine the address automatically. It then writes the completed Stage 1 to the first block of the device dest_dev. If the options p or config_file are present, then it reads the first block of stage2, modifies it with the values of the partition stage2_file was found on (for p) or places the string config_file into the area telling the stage2 where to look for a configuration file at boot time. Likewise, if real_config_file is present and stage2_file is a Stage 1.5, then the Stage 2 config_file is patched with the configuration file name real_config_file. This command preserves the DOS BPB (and for hard disks, the partition table) of the sector the Stage 1 is to be installed into.
|
Do what you want, of course. The last thing in the world that I want to do is cause trouble with somebody or confuse you. But this problem that you had is a very common problem and has a well-established and well-documented remedy.
Last edited by stoat; 12-26-2007 at 07:00 PM.
|
|
|
All times are GMT -5. The time now is 06:45 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
|
|