LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 11-13-2007, 09:36 AM   #31
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185

Quote:
Originally Posted by gy78

Any suggestions?
Yes.

Hello gy78,

First, I recommend that you not post your questions in a long, old thread like this. The preceding posts in a two-page (now three-page) year-old thread often are of no help to the current situation. In fact, many people (at least I) won't even read through them to get to what is at the end (your problem). And I can imagine others not even wanting to look at all because they don't want to read all those posts to get up-to-speed for the situation at the end.

Second, I am confident that you do not need to reinstall Fedora if it is currently working okay. The problem you described is a boot loader problem, not an operating system problem.

Third, the problem and solution will most likely be found in the grub.conf file. After correcting it, you may need to reinstall GRUB again.

Please take a moment to copy and paste the results of these two terminal commands run as root:

Code:
cat /boot/grub/grub.conf
/sbin/fdisk -l
Note: The fdisk option is dash lower case letter L as in "list".

Last edited by stoat; 11-13-2007 at 01:14 PM.
 
Old 11-13-2007, 07:45 PM   #32
gy78
LQ Newbie
 
Registered: Nov 2007
Posts: 6

Rep: Reputation: 0
hi stoat,

The output of "cat /boot/grub/grub.conf" results in:

Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd1,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hdd1
default=0
timeout=30
splashimage=(hd1,0)/grub/splash.xpm.gz
#hiddenmenu
title Fedora Core (2.6.22.9-61.fc6)
        root (hd1,0)
        kernel /vmlinuz-2.6.22.9-61.fc6 ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.22.9-61.fc6.img
title Fedora Core (2.6.18-1.2798.fc6)
        root (hd1,0)
        kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.18-1.2798.fc6.img
title WinXP
        rootnoverify (hd0,0)
        chainloader +1
I'm not sure if this is the issue since it's the same grub.conf used when my dual boot was working.

The output of "fdisk -l" is:

Code:
Disk /dev/hdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1       10199    81923436    7  HPFS/NTFS
/dev/hdc2           10200       16708    52283542+   f  W95 Ext'd (LBA)
/dev/hdc5           10200       16708    52283511    7  HPFS/NTFS

Disk /dev/hdd: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1   *           1          13      104391   83  Linux
/dev/hdd2              14       30515   245007315   8e  Linux LVM

Thanks,
gy78
 
Old 11-13-2007, 08:16 PM   #33
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by gy78

I'm not sure if this is the issue since it's the same grub.conf used when my dual boot was working.
Hello again gy78,

Well, maybe not. But it won't hurt to try a few things. In a Fedora terminal as root or in linux rescue, start the GRUB shell with this simple command...
Code:
grub

or...

/sbin/grub
Then at the grub> prompt in the shell, use the find command to look for grub.conf like I did here...
Code:
    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]

grub> find /grub/grub.conf
 (hd1,4)
 (hd1,8)

grub>
If the result that you get is not (hd1,0) like it is in your grub.conf, then that is the problem. These drives appear to be on the secondary IDE channel. Is that the way they have always been? Could you have swapped channels when you replaced the bad drive? The partition with the NTLoader files (ntldr, ntdetect.com, boot.ini) needs to be either a primary partition on the first drive in BIOS or mapped that way. Otherwise, XP will not boot from GRUB.

Last edited by stoat; 11-13-2007 at 08:39 PM.
 
Old 11-14-2007, 06:03 AM   #34
gy78
LQ Newbie
 
Registered: Nov 2007
Posts: 6

Rep: Reputation: 0
hi stoat,

Last night, my windows hdd crashed again and I installed a new hdd and re-installed windows and grub as before. Same thing happens.

I ran "find /grub/grub.conf" from the grub command line and it came back with (hd1,0). This is what it should be, right? I have the windows hdd at the end of the ide cable (primary) and the fc6 hdd connected to the 2nd connection of the ide cable (secondary).


Thanks,
gy78
 
Old 11-14-2007, 08:01 AM   #35
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Hello again gy78,

What follows is a long post. I came back to the top to write this (and make it even longer). I was hoping to prevent you from being discouraged or alarmed. It is often hard to understand and discuss a complex problem via what is basically a chat room. It's even harder to fix it. Therefore, many words are needed. The bright side: This problem may be tangled, but NTLoader and GRUB themselves are astonishingly simple. Your two systems boot individually. They can boot together from the same boot loader. I hope you don't give up on this not only for you, but for my selfish reasons. I want to understand this and its solution.

Quote:
Originally Posted by gy78
Everything worked fine until my harddrive with Windows crashed. I changed the harddrive, re-installed windows and re-installed grub again. But this time, when I choose to boot windows from the grub menu, it does something (screen goes blank for a second) and brings me back to the grub menu.
That is exactly what happens when the chainloader +1 command in grub.conf is misdirected at a partition that contains GRUB stage1 in its boot sector. Launching stage1 like that just cycles back to stage2 and the GRUB menu again. Another way this can happen is to mistakenly reinstall GRUB in the XP boot sector (an easy thing to do). What commands are you using to re-install GRUB after reinstalling XP?

Quote:
Originally Posted by gy78
I already tried unplugging the hdd with FC6 and running fixmbr and fixboot from a windows rescue session and I can boot into windows fine, so there's nothing wrong with my windows installation.
fixmbr rewrites MS boot code to the master boot record (first sector of the drive). Under normal circumstances, that would also have the effect of stopping GRUB and Fedora from booting if you reconnected the Fedora drive since it would remove stage1 from the MBR of the XP drive. fixboot rewrites MS boot code in the boot sector (first sector of a partition, aka volume boot record) of the XP system partition. If you ran those two commands with Fedora's GRUB installed in the MBR of the XP drive, XP would boot but Fedora would no longer boot. Are you observing that?

Quote:
Originally Posted by 78
Last night, my windows hdd crashed again and I installed a new hdd and re-installed windows and grub as before. Same thing happens.
The cycling back to the GRUB menu? I am interested in seeing the command you are using to reinstall GRUB after reinstalling XP.

Quote:
Originally Posted by 78
I ran "find /grub/grub.conf" from the grub command line and it came back with (hd1,0). This is what it should be, right?
Yes.

Quote:
Originally Posted by 78
I have the windows hdd at the end of the ide cable (primary) and the fc6 hdd connected to the 2nd connection of the ide cable (secondary).
Okay. But that is not what primary and secondary mean. One entire cable is primary and the other (which you haven't talked about) is secondary. Primary and secondary refer to the two IDE connectors on the mainboard, not the two connectors on a single cable (those would be master & slave). Now, back to the subject. That cable is (was) connected to the secondary IDE channel making your drives /dev/hdc and /dev/hdd in Fedora. Apparently that isn't going to matter, but why isn't it connected to the primary IDE channel making them /dev/hda and /dev/hdb? Just curious. Are you keeping that consistent during all this drive changing? Also, since XP boots when the Fedora drive is unplugged and not when the Fedora drive is connected, check the jumpers on these two drives. The XP drive should be set as master and the Fedora drive should be set as slave. If they are wrong or set to cable select, change them.

Also, which drive is set to first in BIOS? It should be the XP drive. But it could be the Fedora drive which would boot fine that way with GRUB in its MBR. If you unplugged the Fedora drive to reinstall XP, XP might boot normally until you reconnected the Fedora drive which might again boot first from BIOS. But XP would not boot from Fedora's GRUB menu if the XP drive were no longer first in BIOS with the Fedora drive reconnected. The partition with XP's NTLoader files (ntldr, ntdetect.com, boot.ini) has to be a primary partition of a drive that is first in BIOS OR it has to be mapped that way. Otherwise, XP will not boot from the GRUB menu. Actually, this is my favorite theory for your trouble.

There IS an explanation for all of this. It will be somewhere in this tangle of drive changes, cables, jumpers, BIOS settings, grub-install commands, menu configuration files, reinstalls with the other drive unplugged, etc.

This reply has gotten long now. You are probably long gone from here. I hope not. But if nothing said above leads to a correction, I would regroup and try the following in an attempt to normalize/standardize the hardware layout and boot loader:
  1. Connect both drives to the IDE cable and connect the cable to the primary IDE channel connector on the mainboard.
  2. Set the XP drive jumper to master.
  3. Set the Fedora drive jumper to slave.
  4. Leave the drives, cables, and jumpers alone from here on.
  5. Power up, enter BIOS setup, set the XP drive to first in the boot order, exit BIOS setup, and reboot.
  6. If XP does not now boot directly from BIOS, reboot with the XP CD, select "R" for repair, and run fixmbr & fixboot again.
  7. Reboot and XP should now boot directly from BIOS.
  8. Insert the Fedora CD, enter linux rescue, reinstall GRUB in the MBR of the XP drive (chroot /mnt/sysimage then grub-install --recheck /dev/hda).
  9. Reboot and try the GRUB menu choices (grub.conf looks okay as above).
As the last resort, I feel certain that those nine steps will get things right. But we will never really know exactly what the problem was.

Last edited by stoat; 11-14-2007 at 08:54 PM.
 
Old 11-14-2007, 10:17 PM   #36
gy78
LQ Newbie
 
Registered: Nov 2007
Posts: 6

Rep: Reputation: 0
hi stoat,

Thank you very much for taking the time to help me with my problem. I appreciate your help and advice very much!

You are correct. I was confused in my terminology. My harddrives are on my secondary IDE, and I have two dvd drives on my primary IDE. My winXP hard drive is the master while my FC6 harddrive is the slave. I verified the jumpers that they are set to master and slave. Neither is set to cable-select.

I've been re-installing grub by booting into a linux rescue session and doing
Code:
chroot /mnt/sysimage
cd /boot/grub
grub-install --recheck /dev/hdc1
grub-install /dev/hdc1
Quote:
fixmbr rewrites MS boot code to the master boot record (first sector of the drive). Under normal circumstances, that would also have the effect of stopping GRUB and Fedora from booting if you reconnected the Fedora drive since it would remove stage1 from the MBR of the XP drive. fixboot rewrites MS boot code in the boot sector (first sector of a partition, aka volume boot record) of the XP system partition. If you ran those two commands with Fedora's GRUB installed in the MBR of the XP drive, XP would boot but Fedora would no longer boot. Are you observing that?
Yes. After I run fixmbr and fixboot, I boot directly into windows XP.

Quote:
Also, which drive is set to first in BIOS? It should be the XP drive.
Yes. I verified that the BIOS has windows XP set as the first harddrive and the FC6 harddrive as the 2nd.

I did an experiment where I have grub installed (like before) and I disconnected the FC6 harddrive. I would have expected that at least GRUB would load but instead, I got an error "GRUB hard drive error". Is this suppose to happen?

Thanks,
gy78
 
Old 11-14-2007, 10:29 PM   #37
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
This is your problem...

Quote:
Originally Posted by gy78

grub-install /dev/hdc1
Hello again gy78,

That command installs GRUB stage1 not in the master boot record of /dev/hdc, but in the boot sector of its first partition (/dev/hdc1). And that happens to be the XP partition (see the fdisk again). Therefore after doing that, choosing XP in the GRUB menu sends you right back to the menu.

Code:
Figure A. The desired boot sequence:

                      grub.conf
                          |            Fedora
BIOS --->  MBR  ---> GRUB stage2 ---->  menu ---> vmlinuz
      (GRUB stage1)                \   choice
                                    \
                                     \      XP
                                      +--> menu --> ntldr --> ntoskrnl.exe
                                          choice

Figure B. What happens when stage1 is accidentally
installed in the XP boot sector:

                      grub.conf
                          |            Fedora
BIOS --->  MBR  ---> GRUB stage2 ---->  menu ---> vmlinuz
      (GRUB stage1)                \   choice
                          ^         \
                         /|\         \      XP
                          |           +--> menu --> stage1 -->-+
                          |               choice               |
                          |                                    |
                          |                                    |
                          +------<------<-------<-------<------+
This is the grub-install command to install stage1 in the master boot record of your XP drive:

Code:
grub-install /dev/hdc
...and if a "No corresponding drive in BIOS" error occurs...
Code:
grub-install --recheck /dev/hdc
See the difference? Only a drive is specified, no partition.

I'm thinking right at this moment of the proper suggestion. I just wanted to get this posted before you left.

Last edited by stoat; 11-15-2007 at 10:45 AM.
 
Old 11-14-2007, 10:41 PM   #38
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Leave the cables, jumpers, and BIOS like you have them now. They are okay. Here is what you need to do:
  1. Boot with your XP CD, select "R" for Repair, then run...
    Code:
    fixboot
    That will get stage1 out of the XP partition's boot sector and restore MS boot code there. Don't worry with fixmbr this time.

  2. Next, boot with the Fedora disk, enter linux rescue, then...
    Code:
    chroot /mnt/sysimage
    Code:
    grub-install --recheck /dev/hdc
    That will restore GRUB stage1 to where you thought you were putting it all along: the master boot record of the XP drive.
Reboot. BIOS should launch stage1 in the MBR which should lead to stage2 in /boot/grub running and presenting the GRUB menu. Selecting XP from the GRUB menu now should launch the MS boot code in XP partition's boot sector which will launch ntldr and lead to XP booting. And of course, selecting Fedora will directly launch the Fedora kernel as usual.

In my head it works now. Try it now if you can. I figure ten minutes and the answer will be in.

%%%%%%%%%%%%%%%%%%%%%%%%%%%

Dude! You left. Maybe you are in the eastern hemisphere. I hope you come back and try my idea. Anyway, at least I understand this issue thoroughly now, and that is what I wanted from this. But I also hope you fix your system. This very scenario was one of my theories. See my previous post from above:
Quote:
Originally Posted by stoat

That is exactly what happens when the chainloader +1 command in grub.conf is misdirected at a partition that contains GRUB stage1 in its boot sector. Launching stage1 like that just cycles back to stage2 and the GRUB menu again. Another way this can happen is to mistakenly reinstall GRUB in the XP boot sector (an easy thing to do). What commands are you using to re-install GRUB after reinstalling XP?
It's happened before. See you on the other side, gy78.

Last edited by stoat; 11-14-2007 at 11:27 PM.
 
Old 11-15-2007, 07:21 AM   #39
abk4523
Member
 
Registered: Jun 2004
Distribution: RH8/Fedora Core 4
Posts: 139

Rep: Reputation: 15
I am sure Harley51's solution works. I add this for simplicity. If you are installing Fedora in dual boot with windows (assuming two separate drives), it may be easier to disconnect the windows drive before running the install. That way, the MBR and boot loader get installed on the correct disk. When using fedora as your primary drive and using grub, you should edit the grub.conf file and add this:

title Windohs Vista
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1

The title could be Vista or XP, rootnoverify(hd1,0) assumes the windows drive is the secondary. You can change as appropriate.
 
Old 11-15-2007, 07:37 AM   #40
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by abk4523
I add this for simplicity. If you are installing Fedora in dual boot with windows (assuming two separate drives), it may be easier to disconnect the windows drive before running the install. That way, the MBR and boot loader get installed on the correct disk. When using fedora as your primary drive and using grub, you should edit the grub.conf file and add this:

title Windohs Vista
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1
Dear gy78,

Please just fixboot and reinstall GRUB in the MBR but correctly this time as I suggested in post #38. Please don't disconnect anything. Please don't edit the grub.conf now.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

@abk4523:

Thanks. I know you meant well, but simplicity is not needed. Truth and accuracy is needed. I sincerely apologize to you, but this was close to concluding and you are steering it off in a wrong direction. I know they are lengthy, but did you read our posts? Mapping commands are only needed in grub.conf when the XP drive is not the first drive in the boot order as I already said above...
Quote:
Originally Posted by stoat in post #35
The partition with XP's NTLoader files (ntldr, ntdetect.com, boot.ini) has to be a primary partition of a drive that is first in BIOS OR it has to be mapped that way. Otherwise, XP will not boot from the GRUB menu.
gy78 has confirmed that it is first...
Quote:
Originally Posted by gy78 in post #36
I verified that the BIOS has windows XP set as the first harddrive and the FC6 harddrive as the 2nd.
And did you look at the grub.conf and fdisk posted by gy78? (hd1,0) is the Fedora partition, and gy78 has never said that Fedora does not boot...
Quote:
Originally Posted by gy78 in post #32
title Fedora Core (2.6.22.9-61.fc6)
root (hd1,0)
kernel /vmlinuz-2.6.22.9-61.fc6 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.22.9-61.fc6.img
And did you see the result of the GRUB shell command find /grub/grub.conf?...
Quote:
Originally Posted by gy78 in post #34
I ran "find /grub/grub.conf" from the grub command line and it came back with (hd1,0).
I don't think any more proof is needed that (hd1,0) is the Fedora partition and by exclusion the XP partition is (hd0,0). Therefore, mapping is not needed in the grub.conf file.

And BTW, makeactive is not necessary for XP in your grub.conf (try it yourself and see).

gy78 has now clearly identified the problem as GRUB stage1 having been accidently installed in the XP boot sector. The correction is now also clear: fixboot + reinstall GRUB in the MBR.

Last edited by stoat; 11-15-2007 at 11:33 AM.
 
Old 11-15-2007, 08:07 AM   #41
gy78
LQ Newbie
 
Registered: Nov 2007
Posts: 6

Rep: Reputation: 0
Hey stoat,

Sorry, I went to bed right after I posted. Your solution makes perfect sense. I'll try your solution when I get home from work tonight.

I'll keep you posted!

Thanks,
gy78
 
Old 11-15-2007, 08:06 PM   #42
gy78
LQ Newbie
 
Registered: Nov 2007
Posts: 6

Rep: Reputation: 0
Smile

Hi Stoat,

Bingo! That was it. It works like before now. Thank you very much!!!!

gy78
 
Old 02-08-2008, 12:58 PM   #43
rg.viza
Member
 
Registered: Aug 2006
Posts: 74

Rep: Reputation: 15
Quote:
Originally Posted by harley51 View Post
I been using this method since the early days when Red Hat was free. It's been around for at least 6 or 7 years. But it has been refined to work well with any linux distro.
Good one man!

This one is definitely going into the bag of tricks. Thx for passing it on.

-Viz
 
  


Reply

Tags
boot, dual



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
Dual boot, linux + windows, two hard drives already installed Hikaru_K Linux - Software 2 09-10-2006 12:27 PM
Dual Boot Fedora 4 and Windows XP on seperate drives? JohnnyBoy04 Linux - Newbie 1 12-09-2005 07:34 AM
Fedora Core 3 Dual Boot, Dual Hard drives, Grub Boot Loader Denali03 Linux - Newbie 1 03-04-2005 01:44 PM
dual boot system on 2 hard drives, wont load windows kamowa Linux - Newbie 6 01-27-2005 10:31 PM
Want to dual boot Windows and Linux, BUT on 2 hard drives hanchey Linux - Hardware 4 12-02-2003 09:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 09:39 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
Open Source Consulting | Domain Registration