LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cannot boot Windows XP after installing Linux RH9 (https://www.linuxquestions.org/questions/linux-software-2/cannot-boot-windows-xp-after-installing-linux-rh9-103547/)

msoares 10-13-2003 05:13 PM

Cannot boot Windows XP after installing Linux RH9
 
I cannot boot Windows XP after installing RH9 Linux. When I get to GRUB, the Red Hat Linux boot works fine, but the Windows XP hangs after the following GRUB commands:
rootnoverify (hd0,0)
chainloader +1

I have tried adding "makeactive" after and before "chainloader +1", but it doesn't make a difference.


I have changed GRUB to be installed in the first sector of the HDD instead of the MBR, but it still doesn't make a difference.

I have 1 HDD with 250GB. I tried several installation configurations, but always with the same result as noted above:
- installing Windows in a small partition in the beginning, then Linux;
- creating a small partition in the beginning (1024 issue?) for the /boot directory, then windows and then linux (/ and swap)
- installing Windows first, but in the end of the HDD; then installing Linux in the beginning.

I also tried installing Linux first and in the beginning of the HDD, then Windows XP. In this last case, I lost GRUB and Windows XP took over and it seems GRUB was not called. I then tried to re-install Linux just to get GRUB to be called, but it did not work either.

Also, before I forget:
- I also tried LILO... did not work either!
- I do not have a floppy disk drive; just a CD/RW and DVD.
- I have searched this site and others... it seems the best to resolve my problem is located at enterprisedt.com/publications/dual_boot.html. Do you think this solution will resolve my problem?

Jan_73 10-13-2003 05:45 PM

this solution is quite easy.
I also have Windows xp and RH9 dual boot with grub !

first, make sure that these lines are in /etc/grub.conf
edit the grub.conf and make sure that this is in it

itle Red Hat Linux (2.4.20-20.9)
root (hd1,0)
kernel /vmlinuz-2.4.20-20.9 ro root=/dev/hdb2
initrd /initrd-2.4.20-20.9.img
title Windows XP
rootnoverify (hd0,0)
chainloader +1

This example is my own linux distro (RH9)
You have to change the files (initrd-2.4.20-20.9.img) with your own kernel img.

root (hd1,0) means that my linux /root is on hdb (1,0 is hdb) (0,0 is the first drive hda)


Okay, then the following:

first of all boot into rescue mode: boot from floppy or the first CD-ROM from the RH distro.

second type at the first boot prompt: linux rescue

third. If there are any messages to store the current linux install image in /mnt/sysimage then click on YES.

when you are in the BASH# or the prompt again type: chroot /mnt/sysimage

This CHROOT command will enable you to make changes (such as install GRUB in MBR)

go to dir: /sbin
there you will find grub.

run the grub-install command with dot-slash in front of it (shell script). see example here:

./grub-installer /dev/hda

(hda, the first harddrive with the mbr)

type exit.. you will get another prompt... type exit again

and you are ready for booting..

This worked for me and I installed windows XP first and then RH9 on hdb
It really doesn't matter if you install windows first or rh9.. you can always put the grub into MBR afterwards !

By the way, people saying that you shouldn't install in the MBR because of WIndows XP is bull.. I have done it myself and it works.

Jan_73 10-13-2003 06:02 PM

i have explained about root (hd1,0)

The first number is the physical drive
the second number is the partition.

You have ONE drive, so you have the leave the first number at 0
and change the second number, which resembles the partitions

root (hd0,5) = the first drive (0) and the fifth partition (5) on the first drive.

You don't have to install linux in the first 1024 cylinder.. it is only nescecary to have the grub in the first 1024 !!

As long you have grub in the MBR then there should be no problems.

but before you begin .. you should do fdisk -l in the shell to determine where all your partitions are located.

example:

Disk /dev/hda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1275 10241406 c Win95 FAT32 (LBA)
/dev/hda2 1276 14946 109812307+ f Win95 Ext'd (LBA)
/dev/hda5 1276 14946 109812276 7 HPFS/NTFS

Disk /dev/hdb: 46.1 GB, 46115758080 bytes
255 heads, 63 sectors/track, 5606 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 5476 43881547+ 83 Linux
/dev/hdb3 5477 5606 1044225 82 Linux swap


eof

msoares 10-13-2003 06:33 PM

THANKS A LOT for your reply.

I think I'm still missing something, so please allow me to ask two questions:
1) Why do I need to edit grub.conf and re-install GRUB? GRUB is already installed and the commands for the Windows boot (rootnoverify and chainloader) are already there, as per my description above. What am I missing?
2) Why do I need to do fdisk? When installing RH9, you can review the partition allocations as part of the view screen in Disk Druid. Do I need anything else?



2) Do I really need to do an "fdisk"? I know

Jan_73 10-13-2003 06:44 PM

I don't mean that you have to re-install GRUB.
The ./grub-installer /dev/hda means that GRUB will put itself into the MBR of hda.

You don't need to do an fdisk. I meant you could do it beforehand.
It is just easy to know where your /root is. But if you can use Disk Druid, is also good.
or if you memorize all the partitions then it is also not needed.
The fdisk part is just a help to edit the grub.conf file to write down the right locations of your /root and kernel image.

The grub.conf contains the pointers to where linux is and where windows is located.
If the grub.conf contains no info, then your boot will hang because grub won't know where to find linux.


All times are GMT -5. The time now is 10:37 PM.