X
Tech

Multi-boot Configuration with GRUB

I've gotten several comments and questions pertaining to my GRUB posting last week. The most common question was about graphical boot configuration but there were also one or two others, so I'm going to add a bit more here.
Written by J.A. Watson, Contributor

I've gotten several comments and questions pertaining to my GRUB posting last week. The most common question was about graphical boot configuration but there were also one or two others, so I'm going to add a bit more here. Once again, this information is really only of interest for multi-boot configurations, especially multi-Linux boots.

Through all of the following description, when I talk about the GRUB config file, I am referring to /boot/grub/menu.lst. I suppose that there could be some sort of setup where this is not the path to the config file, but I have yet to see one.

First, each time you install Linux on a system which already has other bootable partitions, all of the common/popular installers will attempt to look around, find and identify those partitions, and set up a GRUB config file with the appropriate contents. While most of them have gotten pretty good at finding the bootable partitions, at least, they still vary quite a bit in success at correctly identifying them. So, after you have finished the installation and booted it, you should review and correct the config file as necessary, and to your taste. A few things to look for, which I have seen recently:

- I have Windows XP Professional installed on the first partition of the disk, immediately followed by another NTFS partition where I keep all of my data. At least one of the Linux installers actually added both of those as bootable Windows paritions. I simply removed the entry for the NTFS data partition.

- Windows Vista sets up a separate relatively small partition for its own bootloader. Hmm, well, at least it always does this when I install Vista from the Fujitsu Lifebook Recovery DVD, and I am assuming that this is normal, standard practice, but I honestly don't know for certain about any other system. Anyway, most of the Linux installers I have used add both of these Vista partitions to the GRUB config file, so again I just go in and remove the unnecessary one.

- Since the identification of the contents is unreliable, it is best to keep notes about what you have installed where, and then correct the contents of the GRUB config file manually after it boots. One example of this misidentification is that MEPIS is often identified as just being Debian.

- The default GRUB config file usually has a timeout set to boot whatever the default entry is. If you want it to just wait for you to choose what to boot, simply comment out the line that starts with timeout (add '#' at the beginning)

- The latest Ubuntu distribution no longer puts a root line in its menu.lst entry. This can cause problems in multi-boot Linux setups, so the safest thing to do is just add that line to the Ubuntu config file. (Perhaps the new uuid entry they have added is supposed to take care of this, but for whatever reason, it doesn't work with all of the other GRUBs that I have tried.)

- There are two ways to configure GRUB to boot other Linux partitions, and I have seen installers set up both of these. One way is to include the explicit kernel/initrd/boot commands in the config file. This has the advantage of getting the boot done with one keystroke, but has a huge disadvantage that it might fail if you update the other partition and the names change. The alternative is to use the configfile specification for the other partition, in which case GRUB will read that file and act accordingly, usually presenting a new boot menu. This has the advantage that as long as each installation keeps its own GRUB config file up to date, it everything should work ok; the disadvantage is that you have to go through two menus, and probably at least two keystrokes, to boot another partition.

- Some Linux installers either can't identify other partitions, or don't even try. Fedora 10 is the most extreme example of this that I have seen, it sets up GRUB for its own partition and whatever Windows it may find, and that's it. Other Linux partitions are simply ignored. This is not a big deal, you simply have to edit the GRUB config file and add the other partitions yourself. The simple way to do this is by adding title, root and configfile entries, but if you have sufficient information and patience, you can of course copy (or cut and paste) the more explicit kernel entries.

Whew. As usual, this has gone on longer than I expected or intended. I'll post the graphic boot information later.

jw 12/1/2009

Editorial standards