[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: booting with wrong grub.conf



On Sun, 12 Dec 2004 00:06:49 -0600, Andrew Robinson <awrobinson cox net> wrote:
> John Cox wrote:
> 
> 
> > On Sat, 11 Dec 2004 10:58:56 -0600, Andrew Robinson <awrobinson cox net> wrote:
> >
> >>John Cox wrote:
> >>
> >>
> >>
> >>>I have an extra partition that I use to test other distributions. My
> >>>normal procedure is install but not let the new OS install grub. I
> >>>then manually modify my FC3 grub.conf. I didn't do this with an
> >>>installation of caos so now when I boot I'm using the grub.conf on the
> >>>caos partition. I don't want this as FC3 is my main OS. I tried using
> >>>FC3 rescue to reinstall grub to /dev/hda but that doesn't do the job.
> >>>So what determines which grub.conf the system uses and how do I change
> >>>that?
> >>
> >>John, this is what I've done in the past. I cannot claim it is the best
> >>solution.
> >>
> >>Go ahead and boot into your new system. Then mount the partition with
> >>the FC3. Copy the grub.conf from the FC3 partition to the current
> >>/boot/grub directory. Add the new distro to that grub.conf. Reboot. You
> >>should be able to pick the main FC3 entry from the grub menu.
> >>
> >>Doing it this way, the Master Boot Record still points to the new
> >>distro. So once you are booted back into FC3, you should run
> >>grub-install to get the MBR to point back to the FC3 partition.
> >>
> >>Now here's a way to have a fix ready in the future. However, you need to
> >>do this BEFORE installing the new distro. You can install grub on a
> >>diskette and have that direct your booting. My writeup is at work, so
> >>these steps are from memory. I think they are basically correct.
> >>
> >>1. Insert a diskette into the diskette drive.
> >>2. Format it: mkfs.vfat /dev/fd0. Note: you could format the diskette as
> >>either ext2 or vfat. I choose vfat so that if I have to edit the
> >>grub.conf on it, I can do so from either Linux or Windoze.
> >>3. Mount the diskette: mount /mnt/floppy
> >>4. Install grub onto the diskette:  grub-install --root-directory
> >>/mnt/floppy /dev/fd0
> >>5. Copy your grub.conf to the diskette: cp /boot/grub/grub.conf
> >>/mnt/floppy/boot/grub
> >>6. Add this entry to the grub.conf on the diskette:
> >>title Local Hard Drive
> >>        root (hd0)
> >>        chainloader +1
> >>7. Make this new entry the default. This makes the default behavior of
> >>the grub floppy to boot from the local hard drive. I figure this keeps
> >>me from getting into too much trouble.
> >>8. I like to make the timeout on the diskette long to give me time to
> >>decide what I'm going to do. (Conversely, I like to make the timeout on
> >>the hard drive short so I don't have to wait for the default behavior.)
> >>In /mnt/floppy/boot/grub/grub.conf, set timeout=30.
> >>9. "grub.conf" is a Red Hat convention. Gnu grub thinks the name of the
> >>file should be "menu.lst".  So make a copy: cp
> >>/mnt/floppy/boot/grub/grub.conf /mnt/floppy/boot/grub/menu.lst
> >>10. Test it. With the floppy inserted, reboot.
> >>
> >>If the grub floppy works, you should get your ususal menu with the new
> >>entry I suggested adding. The grub menu will probably have a blank black
> >>background.
> >>
> >>If the grub floppy doesn't work, eject it and reboot. You should get
> >>back to your grub menu.
> >>
> >>When you install a new distro, this grub floppy won't know about it
> >>until you add it to the floppy's grub.conf (and menu.lst). But assuming
> >>you have not erased the partitions with you old distro, the floppy grub
> >>should let you get back to them.
> >>
> >>HTH,
> >>
> >>Andrew Robinson
> >>
> >
> >  So then the MBR is what points to the caos installation. How is the
> > MBR changed to point to a particular place? Is that what grub-install
> > does?  Your suggestion about how to avoid this in the future sounds
> > good but I want to delete the caos partition but I am not sure if I'll
> > be able to boot my FC3 OS (my main OS) once I do that.
> > John
> >
> 
> John,
> 
> The short answer to your question is yes and yes. When you run
> grub-install, it puts a stage 1 loader on the MBR which points back to
> the partition from which grub-install was run. I believe the
> --root-directory option to grub-install changes this.
> 
> So yes, if you delete the caos partition before fixing grub, it will
> confuse grub. What I believe will happen is this. Grub will start but
> not be able to find the grub.conf file. It will then drop into the grub
> command mode. I see in your other post, you have at least the grub
> command mode. Once in command mode, you can point grub to the
> configuration file, the grub.conf, on your Fedora partition and start it.
> 
> So that's the worse case senario. Before you delete the caos partition,
> you can try this to get your old grub back:
> 1. Go ahead and boot into the caos distro.
> 2. Mount the Fedora partition.
> 3. Copy the grub.conf from the Fedora partition to the caos partition.
> 4. Reboot. You should get your old grub menu.
> 5. Select the Fedora partition. Boot into it.
> 6. Once in Fedora, run grub-install to get the MBR to point to the
> Fedora partition.
> 
> After this, deleting the caos partition shouldn't cause you any problems.
> 
> Again, HTH.
> 
> Andrew
> 
Thank you everyone.
John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]