LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-13-2003, 06:13 PM   #1
msoares
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Rep: Reputation: 0
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?

Last edited by msoares; 10-13-2003 at 06:15 PM.
 
Old 10-13-2003, 06:45 PM   #2
Jan_73
LQ Newbie
 
Registered: Oct 2003
Location: Netherlands
Distribution: Red Hat Linux 9.0 (Shrike)
Posts: 28

Rep: Reputation: 15
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.
 
Old 10-13-2003, 07:02 PM   #3
Jan_73
LQ Newbie
 
Registered: Oct 2003
Location: Netherlands
Distribution: Red Hat Linux 9.0 (Shrike)
Posts: 28

Rep: Reputation: 15
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
 
Old 10-13-2003, 07:33 PM   #4
msoares
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
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
 
Old 10-13-2003, 07:44 PM   #5
Jan_73
LQ Newbie
 
Registered: Oct 2003
Location: Netherlands
Distribution: Red Hat Linux 9.0 (Shrike)
Posts: 28

Rep: Reputation: 15
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.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how-to boot into linux after installing Windows on top of it. rbh123 Linux - Newbie 15 11-02-2005 08:39 AM
I Can't boot windows after installing Linux stryker5233 Linux - Newbie 5 09-21-2004 10:08 AM
Dual boot : Installing Windows after Linux. dsridhar Linux - Newbie 1 07-29-2004 07:33 AM
Installing Dual Boot Linux and Windows XP suwandy_chandra Linux - Newbie 18 03-04-2004 10:56 PM
Windows ME won't boot after installing RH9 maxwel Linux - Newbie 5 12-11-2003 08:38 AM


All times are GMT -5. The time now is 06:17 AM.

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