LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-06-2003, 07:29 PM   #1
jpsrm
LQ Newbie
 
Registered: Jan 2003
Location: Portugal
Distribution: Red Hat Linux 9.0
Posts: 13

Rep: Reputation: 0
[HELP] GRUB problems!!! (WindowsXP-hda / RedHat8.0-hdb)


SUMMARY: Change in HardDrive's order! hda <-> hdb

VERSION: grub (GNU GRUB 0.92)

I have 2 HardDrives, one with RedHat 8.0 Linux and another with Windows XP!

I had Linux HD as MASTER (hda) and Windows as SLAVE (hdb), both EMPTY!

I installed Linux on hda, and when I was trying to install windows on hdb, I remmember that windows must be instaled on a Active Primary Partition on the Master HD of hda!!!

So I switch the HardDrives!!! Linux -> hdb and Windows(Empty) -> hda

I updated /etc/fstab and /boot/grub/grub.conf and write the new grub config on the MBR of Linux HD. Linux boots fine!

I installed Windows on the hda and it's booting fine too!

- HDA has Windows Loader on his MBR and boot's windows fine!
- HDB has Grub Loader on his MBR and boot's Linux fine!


STRANGE BUG:

- Grub (installed on Linux HD, hdb) only boot's Linux with:
-----------------------------------------------------------
splashimage=(hd0,1)/boot/grub/splash.xpm.gz

title Red Hat Linux (2.4.18-14)
root (hd0,1)
kernel /boot/vmlinuz-2.4.18-14 ro root=/dev/hdb2 hdc=ide-scsi hdd=ide-scsi
initrd /boot/initrd-2.4.18-14.img
-----------------------------------------------------------
The correct setting should be (hd1,1), right???
Even root (hd0,1) don't agree with root=/dev/hdb2!!!
When Linux HD was hda, everything had logic: (hd0,1) and root=/dev/hda2!


MY REAL PROBLEM:

- I can't boot Windows on hda choosing on BIOS hdb that contains Grub and Linux:
-----------------------------------------------------------
title Microsoft Windows XP
rootnoverify (hd0,0)
chainloader +1
-----------------------------------------------------------

PS1: HDA has only 1 partition with Windows!
PS2: HDB has 3 partitions, 1st SWAP, 2nd / and 3rd /home!

I can boot both O/S by setting on BIOS each HardDrive as first boot drive!

Thanks in Advance!!!

Last edited by jpsrm; 01-06-2003 at 07:30 PM.
 
Old 01-06-2003, 09:19 PM   #2
deadbug
Member
 
Registered: Oct 2002
Location: San Antonio, Texas
Distribution: MDK 8.0, 9.0; RH 7.2, 8.0, 9.0, FC3, FC4, FC5
Posts: 355

Rep: Reputation: 30
The simplest solution here is to add Linux to your XP boot loader and stop using the BIOS as a boot loader.

Log onto Linux as root, put a disk in the floppy, mount it and type this command in a terminal window:

dd /dev/hda /mnt/floppy/bootsect.lnx bs=512 count=1

Note: This assumes your root ('/') partition is hda. If it is not, change the above example. It also assumes you floppy drive is mounted as floppy. Again, if it isn't, make the change.

This command will copy a boot image to the floppy drive.

Exit Linux and boot XP. Copy the file from the floppy to C:\

Start Notepad and open file: C:\boot.ini

Add this as the last line:

C:\bootsect.lnx=Linux"

Towards the beginning of the file there is a line for time. I don't recall if it says wait or time, but it is pretty obvious. Set this to about 20.

Save the file and reboot your computer.

You should get an option to boot either XP or Linux. Try both.
 
Old 01-06-2003, 10:13 PM   #3
jpsrm
LQ Newbie
 
Registered: Jan 2003
Location: Portugal
Distribution: Red Hat Linux 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
I allready know that solution... I used that before I've bought my second Hard Drive (Linux one), when I had both Win and Linux O/S on the same drive.

The Problem here is that Grub can't boot Win on another H/D.

An the strange thing is that grub.conf is not correct, but it must be like this so Linux can boot... strange...

What If I installed Grub on MBR of hda??? and boot hda on BIOS instead on hdb?
 
Old 01-07-2003, 12:38 PM   #4
deadbug
Member
 
Registered: Oct 2002
Location: San Antonio, Texas
Distribution: MDK 8.0, 9.0; RH 7.2, 8.0, 9.0, FC3, FC4, FC5
Posts: 355

Rep: Reputation: 30
Make a boot disk and set the BIOS to to boot from floppy. Boot Linux and, as root, usse this command:

grub-install /dev/hda

Good luck
 
Old 01-07-2003, 04:42 PM   #5
UnTamed
Member
 
Registered: Dec 2002
Location: Qc, Canada
Distribution: CRUX
Posts: 317

Rep: Reputation: 30
>The Problem here is that Grub can't boot Win on another H/D.

Try to make your M$ entry like this:
Code:
title Microsoft Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1
>What If I installed Grub on MBR of hda??? and boot hda on BIOS instead on hdb?

That's how I run my multi-boot, and the usual way to do it AFAIK.
 
Old 01-07-2003, 07:51 PM   #6
jpsrm
LQ Newbie
 
Registered: Jan 2003
Location: Portugal
Distribution: Red Hat Linux 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
I tryied that but ther error still the same:

ERROR13: Invalid or Unsupported Executable Format

PS: what do you think about me having linux on hdb and Grub only boots linux as (hd0,1)??? hd1,1 should be the correct setting, right?
 
Old 01-07-2003, 08:52 PM   #7
UnTamed
Member
 
Registered: Dec 2002
Location: Qc, Canada
Distribution: CRUX
Posts: 317

Rep: Reputation: 30
Well, I dunno, must have to do with how the system is seen at BIOS level, when hdb is set as first boot device.
Have you tried to boot M$ as (hd1,0)?

All I can say is if I were you I'd put grub on the master's MBR,
make the redhat entry in menu.lst as (hd1,1) and the M$ entry as suggested earlier [...include makeactive] and of course set the master as first boot device.
 
Old 01-08-2003, 09:20 AM   #8
jpsrm
LQ Newbie
 
Registered: Jan 2003
Location: Portugal
Distribution: Red Hat Linux 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
Well this how I resolved my problem:

/boot/grub/grub.conf
------------------------------------------------------------------------------------
default=0
timeout=5
splashimage=(hd1,1)/boot/grub/splash.xpm.gz

title Red Hat Linux (2.4.18-19.8.0)
root (hd1,1)
kernel /boot/vmlinuz-2.4.18-19.8.0 ro root=/dev/hdb2 hdc=ide-scsi hdd=ide-scsi
initrd /boot/initrd-2.4.18-19.8.0.img

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


and installed Grub on hda:
------------------------------------------------------------------------------------
[root@localhost grub]# /sbin/grub-install /dev/hda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/hdb
------------------------------------------------------------------------------------

Conclusion: Grub has strange behaviours when installed on a HardDrive other than hda!

PS: I posted this "bug" on Grubs website ( http://www.gnu.org/software/grub/ ) Bug Tracking System and I get no answer...
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub troubles. Moving linux from hda to hdb Zarneth Linux - General 3 06-29-2005 04:57 PM
Where do I put Grub? hda (XP) or hdb(FC2)? TimDog Fedora - Installation 1 10-04-2004 05:56 PM
Moved W2k(hda) to new computer, now Gentoo(hdb) problems jrperiod Linux - Newbie 6 04-15-2004 07:45 AM
Can I swap hda and hdb? snatale1 Linux - Hardware 1 03-10-2004 01:23 AM
Trying to uninstall Grub, Win2000 on HdA; RH9 on HdB? jlbincr Linux - General 4 02-21-2004 10:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:17 PM.

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