booting with wrong grub.conf

Andrew Robinson awrobinson at cox.net
Sat Dec 11 16:58:56 UTC 2004


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




More information about the fedora-list mailing list