LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB Multi boot system (https://www.linuxquestions.org/questions/linux-newbie-8/grub-multi-boot-system-208909/)

JSThePatriot 07-23-2004 07:52 PM

GRUB Multi boot system
 
I tried installing Linux on a second hard drive that I had. Everything was working great till for some reason the installation wasnt recognizing the second cd (which I know is fine). After fighting with that for quite a while and it saying it was successfull and it really wasnt I finally disconnected my windows drive (which I probably should have done from the start) and then installed. Everything seemed to work fine that time and now I have linux and no Windows. Is there a way I can add to GRUB my windows operating system? Because I think it originally tried to load itself on my windows disk. All I know is that I want my windows back, but I want to keep my linux.

Another thing I have noticed about GRUB is that I upgraded my kernel and now it is saying I have 4 different options in the GRUB (I am running a multi-processor machine) so I should only have 2, but there are 4.

Thanks any help or linux tips would be much appreciated.

JS

Demonbane 07-23-2004 10:11 PM

How are your drives connected right now?
As for the options in grub, you can edit them in /boot/grub/grub.conf(or menu.lst)
The old kernel is kept there so that if something goes wrong with the new kernel you still have the option of going back.

osvaldomarques 07-23-2004 11:08 PM

Hi JsPatriot,
The reason for you to have 4 options in the grub menu may be you have 2 for the old kernel and 2 for the new. For eache ot the two sets, one of each may have "console text" or "text mode" and the other is the first and default boot which enter graphics mode.
It is easy to set the windows to be booted by grub. If you installed the linux disk as the first, you have to install windows as the second and add one more entry in grub. I think the graphical environment of FC has some utility to add your windows disk, but in reality, all you need is to edit the grub configuration menu, which is named /boot/grub/grub.conf or /boot/grub/menu.lst. You have to add to it
Code:

title = Microsoft Windows (tm)
      map (hd0) (hd1)
      map (hd1) (hd0)
      rootnoverify (hd0,0)
      chainloader +1


JSThePatriot 07-24-2004 01:33 PM

Okay my drives are connected through IDE cables. Is that what you mean?

As for the windows boot option, it gives me the following error.

Error 13: Invalid or unsupported executable format

Press any key to continue...

So I dont know whats up. Maybe I messed up my windows installation? I hope not. :( If I did then I need to write alot of CD's with the information and go from there.

JS

osvaldomarques 07-24-2004 03:50 PM

Hi JsPatriot,
The question Demonbane did to you was, if you have 2 hds, installed XP in one of those and Linux in the other, what is the order of the disks. When you boot, the linux disk appears as primary master or this is the windows disk.
As you are booting linux as we suppose, can you post the results of the commands "fdisk -l" and "df -v", and also the listing of your grub.conf? This files will help us to clarify the problem you have.

Have a nice week end!

JSThePatriot 07-24-2004 04:31 PM

Okay when I installed linux (and actually got it to work) I had disconnected my drive windows drive which was primary master. The linux drive is secondary master.

fdisk -l returned the following:
Code:

Disk /dev/hda: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
 
  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1      77536    39078081    7  HPFS/NTFS
 
Disk /dev/hdc: 20.5 GB, 20525137920 bytes
16 heads, 63 sectors/track, 39770 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
 
  Device Boot      Start        End      Blocks  Id  System
/dev/hdc1  *          1        203      102280+  83  Linux
/dev/hdc2            204      37690    18893448  83  Linux
/dev/hdc3          37691      39770    1048320  82  Linux swap

df -v returned the following:
Code:

Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/hdc2            18596936  2945972  14706292  17% /
/dev/hdc1                99043    11080    82849  12% /boot
none                    257768        0    257768  0% /dev/shm

The grub.conf before I tried the above (windows add in thingie):
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 (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hdc2
#          initrd /initrd-version.img
#boot=/dev/hdc
default=2
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.6.6-1.435.2.3)
        root (hd0,0)
        kernel /vmlinuz-2.6.6-1.435.2.3 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.6-1.435.2.3.img
title Fedora Core (2.6.6-1.435.2.3smp)
        root (hd0,0)
        kernel /vmlinuz-2.6.6-1.435.2.3smp ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.6-1.435.2.3smp.img
title Fedora Core (2.6.5-1.358smp)
        root (hd0,0)
        kernel /vmlinuz-2.6.5-1.358smp ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.5-1.358smp.img
title Fedora Core-up (2.6.5-1.358)
        root (hd0,0)
        kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.5-1.358.img

The grub.conf now:
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 (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hdc2
#          initrd /initrd-version.img
#boot=/dev/hdc
default=2
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title = Microsoft Windows (tm)
      map (hd0) (hd1)
      map (hd1) (hd0)
      rootnoverify (hd0,0)
      chainloader +1
title Fedora Core (2.6.6-1.435.2.3)
        root (hd0,0)
        kernel /vmlinuz-2.6.6-1.435.2.3 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.6-1.435.2.3.img
title Fedora Core (2.6.6-1.435.2.3smp)
        root (hd0,0)
        kernel /vmlinuz-2.6.6-1.435.2.3smp ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.6-1.435.2.3smp.img

When I click the windows it gives me an error that is as follows.
Code:

Error 13: Invalid or unsupported executable format.

Press any key to continue...

Thank you everyone for your help and I hope someone can come up with a solution! :)
JS

Kroenecker 07-24-2004 08:36 PM

I think that you might try removing the two map lines from your menu file. From what I understand those are meant to trick Windows into thinking it is installed on the first hard disk. It is already installed there so removing those might do something.

Oh also add makeactive below rootnoverify.

http://www.linuxgazette.com/issue64/kohli.html

osvaldomarques 07-24-2004 09:32 PM

Hi JSThePatriot,
As Kroenecker said, you must remove the lines "map (hd0) (hd1)" and "map (hd1) (hd0)". In my prior post I suggested it based on the supposition your windows drive was the second. Also, I guess the lines where you see "(hd0)" or "(hd0,x)" in the Fedora entries should be changed to "(hd1)" and "(hd1,x)" as your linux is on the second disk. I refer to the entries "splashimage" and "root (hd0,0)" in the FC entries.

Demonbane 07-24-2004 09:49 PM

If you set the bios to boot from your Linux drive(looks like your are) then you do need the map line
Code:

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


JSThePatriot 07-29-2004 05:38 PM

When I did that all it did was say Booting... then under that it showed everything that you had me put in the .conf file.

JS

jwijesundra 07-30-2004 06:28 AM

I have the same problem that patriot has. Using the information from the other posts, I configured my grub.conf however when selecting windows from the menu the lines from the windows section of grub.conf with a message saying that there is an error in them.
I cannot load Windows even by setting the BIOS to load through the hard disk with windows, while loading windows stalls. The only way to load windows is to disconnect the hard disk that has Linux on it. I have tried all the suggestions such as using the makeactive command, unsuccessfully.

JSThePatriot 07-30-2004 08:04 PM

Dang you would think that with this many of us having a problem they would have a solution for it.

JS


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