Problems With GRUB 2

Now that GRUB 2 is being used as the boot loader for several OS versions, you can expect all kinds of problems with booting your system. Our favorite is that the system comes up with the BIOS splash screen, you may or may not see the GRUB startup screen (where you get to pick which image to boot), and then the screen goes blank until the OS is completely up and running and X-Windows has started. This works especially swell when the boot sequence decides to do an fsck and then prompts you for what to do next. Lots of luck figuring out what's going on and answering the prompts correctly.

The blame for this problem is placed on the video card. Apparently, according to the GRUB developers, certain video cards (e.g. nVidia) do not play well with GRUB2. We prefer to put the blame squarely on the shoulders of those who caused it. Prior to installing GRUB2 (i.e. for an OS that uses GRUB), the system booted fine, with no video card problems. The system boots fine with Knoppix, from the standalone CD. Other operating systems, which shall remain nameless, boot fine. Any number of install disks boot fine. Get the idea?

If your system eventually does come up and you can get logged in (either through the GUI, on the desktop, or via ssh or telnet), you may be able to fix the problem.

From the command shell, using your favorite text editor, remove the hash mark (#) from the front of the line in /etc/default/grub file that reads:

     #GRUB_GFXMODE=640x480

In other words, change it to read:

     GRUB_GFXMODE=640x480

Save the file and then update GRUB with the following commands:

     su
     update-grub

The next time that you boot the system, you may be able to see more of what is going on.

Further changes may be necessary to get GRUB to display the startup messages, especially with some nVidia graphics cards. Again, edit /etc/default/grub and change the line that reads:

     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to read:

     GRUB_CMDLINE_LINUX_DEFAULT="splash nomodeset"

Save the file and then update GRUB with the following commands:

     su
     update-grub

An alternative to editing the GRUB configuration file from a working system is to use a standalone system such as Knoppix. Boot the Knoppix CD, mount the file system and using the editor, change the /etc/default/grub file, as noted above, and save it. Unmount the file system and shut Knoppix down.

Another alternative is to convince GRUB to show the recovery menu at startup time. This is done by pressing the down arrow key once, followed by the enter key once, when the system boots. There is a very short window when you can do this, as soon as the BIOS hands control to GRUB. Typically, this is when the BIOS splash screen disappears, the display goes blank, or the "VGA Mode not support" (or whatever broken English is used) message is shown by your display. If you get it right, you'll see a square box with a list of recovery choices, in the center of the screen.

By picking the "root" or "netroot" choice, you'll get dropped into a root shell, either with or without networking enabled (we use "root", since there is no need for the network). You'll need to enter the root password to get into the shell. From there, you can run your favorite CURSES-based editor (e.g. emacs or vi) to edit /etc/default/grub. After you've made your changes and saved them, you can exit the root shell by pressing Ctrl-D.

Whether you edit /etc/default/grub using a standalone OS or via the root shell, you will need to update GRUB so that the changes you've made become permanent. After dropping out of the root shell or by following the steps above, you need to get back to the recovery choices. At that point, pick the "grub" choice to update GRUB. This will run grub-update to make your changes permanent. You can then pick "resume" to resume booting normally.

Incidentally, if you can see the splash screen, with its list of kernels to boot, you can use the "e" option to temporarily edit the GRUB boot options. Begin by selecting the kernel that you'd like to boot. Then, type "e". This will bring up an EMACS-like editor that let's you edit the boot options for that kernel.

You'll see a line that looks something like:

     linux /vmlinuz-3.2.0-24-generic root=UUID=1234abcd-fedc-1234-5678-\
       12345678abcd ro quiet splash vt.handoff=7

By altering that line, you can change the "quiet splash" to "splash nomodeset", for example. Once you've made your changes, press F10 to continue booting. Maybe this will let you get the system up an running long enough to edit the /etc/default/grub file with your regular text editor, as described above.

While your system is booting, you should be able to press Esc to see the boot messges. This should especially work if your system is waiting for you to answer a prompt from fsck or another system startup task.

Additional notes about changing GRUB2 boot options can be found at:

     http://ubuntuforums.org/showthread.php?t=1613132