Short bio: Computer Scientist, FOSS supporter (read more)
Tux Machines (TM)-specific
So you've just installed your second, or third, or ninth Linux distribution and it either didn't recognize all your installs or you chose to skip that phase of the install. Of course you'd like to be able to boot all of these installs. Editing the grub.conf (or menu.lst) is an easy peasy procedure once you have an elementary understanding of the basic components.
If you are editing your Grub menu then we'll assume you already have it installed. This howto is to merely add an additional system to the existing file. This howto was inspired by this poor chap who resorted to reinstalling a whole system in order to update his Grub menu. No one should have to do that. Hopefully this will help.
Now I'm far from an expert, but having had to recently learn how to do this myself, I think I'll share what I do. The main advantage of using Grub is that editing the menu file is all that's necessary - as opposed to Lilo which requires one to rerun the Lilo program to reinstall it into the mbr.
The first thing I do is copy and paste an existing entry. No sense in retyping all of that and chances are you will probably want to use the same kernel parameters for the new install that you've used for previous. So:
title. This is easy, just change it to a meaningful name for your new install. In "Tryst's" case, he needed a new entry for PCLinuxOS 2007. So, he could have used PCLOS2007. Unlike Lilo, with Grub you can use names with spaces, so he could have used PCLOS 2007 if he chose.
root. This is the component that specifies where the boot kernel is. Is it in a shared /boot partition or is it in the /boot directory of the new install?
rootcomponent must then point to your shared /boot partition.
The format might look scary at first, but it isn't. In the true Unix fashion, it begins its numbering with 0 (zero). The first number indicates the harddrive number. So, hda is 0, hdb is 1, hdc is 2, and so on. So, more than likely your boot partition is located on hda and in which case 0 is the number you want there. Just remember it's N - 1.
The second number is the partition number. Again, hda1 is 0, hda2 is 1, and so on. So, say your /boot partition is located at sda5 you'd want to put a 4 there. So, your
root entry might look like so:
rootcomponent needs to point to the install partition. So, for example, say your new system is installed on hdb8, your
rootparameter should read:
kernel. This entry can contain lots of boot parameters but the most important is the correct name of the boot kernel. So,
lsthe /boot partition or directory to get that name.
kernelline is the root partition. This is in the more tradition partitioning scheme and points to the install partition. So, in our example, it should point to hdb8 like so:
root=/dev/hdb8 (or root=/dev/sdb8)
resume. If you wish to use some advanced powersaving features such as suspend to disk, then you'll want a resume parameter listed. This is your swap partition where the disk image is stored. Again, the format is the more commonly used /dev/hdxX pattern. In my case, my swap is /dev/sda6, so it should look like:
initrd. Not all boot kernels use or require an initrd, but most larger modern systems like openSUSE, Mandriva, and PCLOS do. This usually contains filesystem modules you might need to mount the system partition or the purdy boot splashes we like so much. You can tell if you need one by issuing
ls -tin /boot directory of the new system or in the shared /boot partition. -t tells it to list by time, so you can see your newest files first. If one doesn't exist in the /boot directory, or you can't find one that matches the boot kernel, then you can assume you don't need one.
If there is one listed, then you'll need to tell Grub about it. In "Tryst's" case, he does. So:
That's it, that should get you in. If you need to, you can temporarily edit any grub entry at boot time, usually by hitting the "e" key. You will probably have to hit "e" again when the edit the entry screen appears to edit the particular component. Then you can hit "b" to boot it. You'll need to edit the grub.conf (or menu.lst) to make it permanent.
As stated this is how I do it and there is a lot more to Grub than discussed here. But hopefully this will help one edit their grub.conf or menu.lst file to boot their new Linux partitions.
PS. Windows and Unix (bsd) use entries like so: