How to boot second grub?

Scott talbotscott at cox.net
Sun May 1 17:12:17 UTC 2005


>
> Scott Talbot writes:
>
>> On Sat, 2005-04-30 at 11:23 -0400, av1 at ansae.com wrote:
>>
>>> Very sorry, my finger hit "send" too fast and I forgot to type a 
>>> subject. 
>>> I've been able to set up two FC3's with a single grub, but what I'd 
>>> really like to do is set up a second grub and have the first 
>>> chainload to the second. (I want to play with custom kernels on the 
>>> second.) 
>>> I have two ide's, hda and hdb. My first fc3 is on hda. I tried 
>>> installing the second fd3 with /boot on hdb1 and / on hdb2. I told 
>>> anaconda to put the second grub on the mbr and used the advanced 
>>> bootloader screen to reorder the drives so it would write it to hdb 
>>> instead of hda. 
>>> After installing, I went to my first grub.conf and added 
>>>    title Second Fedora
>>>        rootnoveriy (hd1,0)
>>>        chainloader +1 
>>> But when I reboot and select Second Fedora, I get Error 13 invalid 
>>> or unsupported executable format. What did I do wrong? What's the 
>>> right way to set this up? 
>>>  --Cliff 
>>
>>
>> Cliff:
>>     You need to have a copy of grub in the /boot directory (or / if you
>> didn't make a new /boot).
>>     assuming grub's hd1,0 is = to hdb1 you'll want to boot into your new
>> FC3 and perform grub-install /dev/hdb1
>>     You now won't be able to get to your old install, so you'll have to
>> boot a rescue cd, chroot into your old install, and perform the grub-
>> install to wherever that bootstrap is (/dev/hda is the MRB and the most
>> usual place).
>> HTH
>> Scott
>>
>> -- 
>> fedora-list mailing list
>> fedora-list at redhat.com
>> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
>
>
> av1 at ansae.com wrote:
>
>> Thanks for the info, Scott. Unfortunately I'm still stuck.
>> When I installed the second fc3 on /dev/hdb, I did tell the installer 
>> to put a grub on the first sector of the root partition on /dev/hdb. 
>> (I installed the second fc3 in one partition instead of separate / 
>> and /boot partitions.) I booted the first fc3 and temporarily mounted 
>> /dev/hdb1 to see what the installer did. It did install grub in 
>> /boot/grub on hdb1.
>
>> It gets weirder though. I took your suggestion of running 
>> grub-install /dev/hdb anyway. (On the theory the installer copied the 
>> grub files but did not set up the first sector of hdb.) Now when I 
>> boot the machine, and it tries to boot the original grub on the mbr 
>> of hda, it goes into an infinite loop printing "GRUB GRUB GRUB 
>> GRUB..." across the screen. Looks like I'll need to boot into an 
>> emergency Linux from the CD and figure out what went wrong.
>> Maybe I missed something. Starting from square one, with a clean fc3 
>> on /dev/hda, and an empty, unformatted /dev/hdb, I'd like to do this: 
>> install a new, self-contained fc3 with its own grub on /dev/hdb, and 
>> chainload from the first grub on hda to the second one on hdb. What's 
>> the right way to set up the second fc3 so I can do this?
>> Thanks for your advice
>> --Cliff 
>
   
    Okay, I think I got this: boot into the rescue cd it should find 
both fc3 installs, choose to run the newer fc3.  Follow the screen 
instructions to chroot into that environment. when you get to the prompt 
type grub-install /dev/hdb1.  Reboot into the rescue cd and select the 
origional FC3, again following ithe screen chroot into the origional 
environment ant issue the command grub-install /dev/hda.  You should now 
be able to boot into your origional FC3, and if your grub.cof is good 
also into your new FC3 too!

    I think the problem was that you told grub to install to /dev/hdb 
instead of hdb1 these are not the same place! A HDD has first a MBR just 
a couple of sectors for the partition table and startup code,  Each 
partition has it's own PBR for the code the local OS needs to startup (I 
believe grub stores the stage 2 here, stage 1 goes in the MBR).  I am 
not a complete expert on this area, but I got a pretty good hold on it 
anyway as I have always at least three distros on my machine 8-)

HTH

Scott




More information about the fedora-list mailing list