LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Getting 64-bit GRUB to boot Windows XP on a second HD? (https://www.linuxquestions.org/questions/linux-newbie-8/getting-64-bit-grub-to-boot-windows-xp-on-a-second-hd-485634/)

Tom "Techno" Earl 09-21-2006 09:00 AM

Getting 64-bit GRUB to boot Windows XP on a second HD?
 
Hi all,

I'm new here, so first I'll start with an intro.

I'm running Linux Fedora Core 5 x86_64 on an AMD athlon 64 3200+ board. Which leads me to my first question!!

I would very much like to run Windows XP SP2 32-bit as a secondary OS. I have Fedora Core 5 64-bit on a SATA drive so that it will boot. I have Windows XP on an IDE drive set as master. As it is, Linux will boot, but the GRUB Bootloader doesn't see windows as being there.

Without reinstalling either of the systems, how would I get it to Dual boot? Is there some scripting I can add to the GRUB, or is it more sinister, lol?!

Thanks

Tom "Techno" Earl

Lenard 09-21-2006 10:00 AM

First show us the output from the typed commands;

/sbin/fdisk -l (that is the lower case letter 'L' in the command)

cat /etc/grub.conf
cat /boot/grub/device.map

Tom "Techno" Earl 09-22-2006 02:21 AM

Hi thanks for the reply!!

The first command

/sbin/fdisk -l (that is the lower case letter 'L' in the command)

doesn't produce anything

the second command

cat /etc/grub.conf

produces:

cat: /etc/grub.conf: Permission denied

the last command:

cat /boot/grub/device.map

produces:

(hd0) /dev/sda

hope that helps!

Thanks:newbie:

Electro 09-22-2006 02:27 AM

You need to use the map command in Grub to remap each drive in order to boot up Windows. It is confusing. I suggest searching for examples. I suggest ignoring device.map step that Lenard have given to you. The device.map is not the cause.

Lenard 09-22-2006 06:50 AM

The permission denied error from the command 'cat /etc/grub.conf' is because (my mistake) you need to be root for this command to work. The first command '/sbin/fdisk -l' should have worked also and produced as in the output the hard drive(s) partitioning information, example;

/sbin/fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 7395 59400306 7 HPFS/NTFS
/dev/hda2 7396 14593 57817935 f W95 Ext'd (LBA)
/dev/hda5 7396 14593 57817903+ b W95 FAT32

Disk /dev/hdb: 40.0 GB, 40037760000 bytes
16 heads, 63 sectors/track, 77578 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 203 102280+ 83 Linux
/dev/hdb2 204 44288 22218840 83 Linux
/dev/hdb3 44289 75496 15728832 83 Linux
/dev/hdb4 75497 77578 1049328 5 Extended
/dev/hdb5 75497 77576 1048288+ 82 Linux swap / Solaris


It looks like you may have added the IDE Windows drive to the system after Linux (FC5) was installed, since the Windows drive is not listed in the /boot/grub/device.map file, why I asked to see the device.map file. Electro is correct, one needs to use the map command inside the grub.conf file so Windows can boot. But grub needs to know which drive is which for the map command to work, only the SATA Linux drive (/dev/sda) is currently listed (known). This can be fixed by booting into Fedora Core and as root from the console or xterm session type something like;

/sbin/grub-install --recheck /dev/sda

Hopefully the results will now show in the /boot/grub/device.map the two drives, for example;

(hd0) /dev/sda
(hd1) /dev/hda

Here's an example entry to boot into Windows from grub, this may be added at the end of the /boot/grub/grub.conf file. When the grub splash screen is displayed press any key then select the Windows XP (as per the example entry) boot choice. The primary Windows partition [the rootnoverify (hd0,0) line] after the remapping of the drives may or may not be correct, this depends on the partitioning of the added Windows IDE drive, which is why the output from the 'fdisk -l' command was requested.

Code:

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


Electro 09-22-2006 04:31 PM

Again do not mess around with device.map unless you know what you are doing. My device.map has neither my primary hard drive (hda) and secondary hard drive (hde). Though device.map could be used to name /dev/hda as windows instead of hd0.

I recommend running grub and type root (<tab> will provide you with a list of drives you can use.

Tom "Techno" Earl 09-23-2006 12:29 AM

Hey Electro and Lenard.

Thanks for the advice, I've run:

/sbin/grub-install --recheck /dev/sda

and the output was:

(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/sda

I'm gonna try the grub scripting next!!

Thanks for all the quick replies, linux can be a confusing place when starting a new task, but with any luck, you've both helped me through

Thanks

Lenard 09-23-2006 06:29 AM

It seems the layout of the hard drives has changed. The Linux drive changed from hd0 to hd1, you need to take this into account when checking/editing the /etc/grub/grub.conf file. The example I provided may not need to have the remapping of the drives also.

Code:

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


Tom "Techno" Earl 09-23-2006 02:47 PM

Hey,

thanks for the hasty replies!!

Right I've added the grub.conf scripting, both the revised and the original. the revised comes up with:

Error 13: Invalid or unsupported format

when I try to boot windows.

the first one also said Error 13, but slightly different, I can't remember how!

I have tried replacing rootnoverify (hd0,0) with rootnoverify (hd1,1) and now it comes up with:

Error 22: No such partition

Hope that helps

Tom

Electro 09-23-2006 04:26 PM

I think it is
Code:

title WindowsXP
        root (hd1,0)
        chainloader +1
        map (hd1) (hd0)
        map (hd0) (hd)

When I first did a dual boot with two drives, it never used chainloader.

I got the above from http://gentoo-wiki.com/HOWTO_Dual_Bo...NTLDR)_and_why, but this link may not work in all browsers.

Lenard 09-24-2006 09:48 AM

So which partition is the Windows boot partition on the second hard drive???

Sometimes it is not the first partition, for example the Windows partition is actually the second partition on my laptop, the first is hidden from Microsoft;

Code:

$ /sbin/fdisk -l

Disk /dev/hda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1              1        261    2096451  16  Hidden FAT16
/dev/hda2  *        262        6258    48170902+  c  W95 FAT32 (LBA)
/dev/hda3            6259        6271      104422+  83  Linux
/dev/hda4            6272      12161    47311425    5  Extended
/dev/hda5            6272        8882    20972826  83  Linux
/dev/hda6            8883      10447    12570831  83  Linux
/dev/hda7          10448      10708    2096451  82  Linux swap / Solaris
/dev/hda8          10709      12161    11671191  83  Linux

So the Windows entry in my /boot/grub/grub.conf file looks like;
Code:

title Windows XP
        rootnoverify (hd0,1)
        chainloader +1


louieb 09-24-2006 07:55 PM

I have win xp on my second drive and Ubuntu on the first. This is what my entry for win xp looks like. It works for me.
Code:

title Win XP Home
                map (hd0) (hd1)
                map (hd1) (hd0)
                rootnoverify (hd1,0)
                chainloader +1
                makeactive
                boot


Tom "Techno" Earl 09-25-2006 05:11 AM

Hi Louieb,

thanks for all of your help

I've now resolved the problem, louieb, your suggestion worked!!;)

Brilliant. Thanks for helping me Electro and Lenard:cool: !!

Thanks

bskrakes 09-25-2006 10:56 AM

Glad you resolved your problem but I have a question.....

When you installed Linux did it not prompt you for the GRUB dual boot loader?

Correct me if I am wrong but that is the easiest step in installing the Fedora Core 5 on a Dual boot system. If you have Windows on the master drive and are installing FC5 on another partition or secondary drive it will prompt you for GRUB to be installed.... did this not happen? How did you isntall FC5? Even if you had it reversed... FC5 becomes the choice of boot because GRUB selects it by default.... at least from my knowledge...

Tom "Techno" Earl 09-26-2006 03:27 AM

Hi bskrakes,

the situation was:

I already had FC5 installed on the computer, I then got another hard drive to put in with XP on it. As you can probably understand, I didn't want to reinstall FC5 and have to set it all up again.

I put the XP hard drive into my linux box, and wanted to just alter GRUB, so that I could dual boot!

Hope that clears it up!

Thanks once again to all who helped!!

Tom "Techno" Earl


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