Advertisement
Promo

Become a member of the ZDNet UK community

J.A. Watson

View blog's RSS Feed

Jamie's Random Musings

Various thoughts and adventures, including but not limited to Linux, Windows XP and Widows Vista, and assorted bits of hardware new and old.

Friday 9 January 2009, 11:29 AM

A Few Notes about the GRUB Bootloader

Posted by J.A. Watson

Because of my multi-boot setup, and the fact that I am more or less continually reloading one distribution or another, I've had to look a bit deeper into setting up and configuring GRUB recently. Here are just a few random notes about things I have come across.

- Not all GRUBs are created equal. There is a version which knows how to do graphics while booting (developed at SUSE, if I am not mistaken), which is typically used to show a timeout countdown to a default boot. More entertainingly, it is also used for the openSUSE "winter penguin" boot graphic. Of the distributions I have installed, the graphic GRUB (grub-gfxboot) is used by openSUSE, Mandriva, PCLinuxOS and SimplyMEPIS; the non-graphical version is used by Ubuntu and Fedora.

- If you are multi-booting different Linux distributions, and installing a new one changes the GRUB configuration such that it boots from the new partition rather than whatever other one you want it to, you can fix it rather easily using the GRUB shell, either running on one of the installed partitions, or from one of the LiveCD systems:

grub> find /boot/grub/stage1
(hd0,4)
(hd0,5)
(hd0,7)
(hd0,8)

You have to know what partition you want to set GRUB to run from, in GRUB terms, which are not the same as Linux devices. Even if you think you know this, it's always good to use this "safety check" to be sure. If the partition you have in mind isn't listed by the find command, then you aren't going to be able to set GRUB to run from it.

grub> root (hd0,7)

This sets the partition that GRUB will be loaded from.

grub> setup (hd0)

This copies the GRUB files from the specified partition, and configures GRUB to boot from that partition.

grub> quit

You should now be ready to reboot.

- Regarding the graphic boot capability of GRUB, it is generally controlled by an entry in the /boot/grub/menu.lst file, on a line starting with gfxmenu. The file specified there should be a cpio archive, containing a number of files, including the graphics and masks to be displayed, and some configuration and control files as well. Experienced users can extract those files, modify or replace them, and create a new archive without too much difficulty. One interesting thing in particular that you can do on openSUSE is edit the gfxboot.cfg file to change how often the "winter penguin" boot screen is displayed.

- When multi-booting Linux partitions, if you are careful about what version of GRUB you are booting, and how your menu.lst files are written, you can get some sort of graphical boot background for all of the partitions, including even the ones which don't include the graphic capability in their own GRUB.

- At least some versions of GRUB have built-in translations of keywords for Linux and Windows systems, so when the menu.lst file only says "linux", the boot menu says "Mandriva 2009" or some such. This can lead to rather surprising results when you multi-boot from another version of GRUB, and then point it at a partition with one of these menu.lst files.

I don't expect any of this to be great revelations to many people. But I spent a fair amount of time figuring out and tracking down some of it, so maybe it will save someone else a bit of time and effort.

jw 9/1/2009

Comments on this post

Xwindowsjunkie

I have a dual-boot Linux system that has "hidden" one of the Linux boot partitions. This info will help me fix the "feature" I've run into.
Thanks.

Posted by Xwindowsjunkie on Jan 10, 2009 2:18 PM

J.A. Watson

I'm always pleased to hear that something I have posted has helped someone, but it is particularly nice when it helps someone as experienced and knowledgeable as you. Thanks for reading and commenting.

Oddly enough, this procedure saved me some trouble this morning as well. When I turned on the S2110, it failed to boot, GRUB just came up in command-line mode (grub>). Most likely because the last thing I did on Friday was fooling around trying to install Vector Linux, which wants to install LILO rather than GRUB, and blah blah blah... Anyway, the point is, from the GRUB command line I just used the exact three commands described above, and it reset GRUB to boot properly. Whew.

I'm going to write one more blog post about GRUB, mostly about the config file and graphical booting, because of a couple of other queries I have received. Hopefully today.

jw 12/1/2009

Updated by J.A. Watson on Jan 13, 2009 2:53 PM

J.A. Watson

This member is ranked #2 in our top 100

  • J.A. Watson
  • Applications Development, Subingen, Solothurn, Bern, Switzerland
  • Member since: November 2007

Site Activity Rating 6

Contacts' Latest Discussions

Number of Tracked Discussions: 2,607

ator1940 ator1940

Real security

Tuesday 1 December 2009, 4:21 PM

2 comments
ator1940 ator1940

Chrome-OS download

Monday 30 November 2009, 12:59 AM

6 comments
Indian-Art Indian-Art

Give it time, my friend!

Sunday 29 November 2009, 1:46 PM

12 comments
ator1940 ator1940

Chrome-OS download

Friday 27 November 2009, 3:30 PM

6 comments

Contacts' Latest Blogs

Number of Contacts Blogs: 15

Avatar Jake Rayson

How I create a blog entry

Thursday 26 November 2009, 1:00 PM

2 comments

Skip Sub Navigation Links to CNET Brand Links

Help

Become part of the ZDNet community.

Newsletters