Saturday, October 20, 2007

editing GRUB

Two gripes before I get to the point of this post: firstly I can't believe the art/design team hasn't replaced that ugly 'Mark All Upgrades' icon in synaptic. This was first pointed out when Dapper was released, by Lauri Taumila who posted a much more attractive replacement icon at http://www.taimila.com/?q=node/3. Secondly - wake from suspend still doesn't work, at least not after the proprietary nVidia driver is installed.

OK, on to GRUB. I thought I'd do myself a favour by installing GrubED. It purported to make the process of editing GRUB nuch easier. For the tar file and instructions, go to http://ubuntuforums.org/showthread.php?t=228104. As recommended, I chose the backup option first. Then I reduced the number of kernels. Then I changed the default OS to Windows XP. Unfortunately, while the first two changes were recorded, the change of OS didn't take. Instead of changing 'default 0' to 'default 4', GrubEd changed the '0' to '-1' (note the hyphen). Any subsequent attempt to reset the default OS only added an additional hyphen. So I reset the default OS maually. See http://ubuntuguide.org/wiki/Ubuntu:Feisty#How_to_change_the_timeout_seconds_for_GRUB_menu_on_boot-up

First I opened the boot menu list by entering the following in a console:
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
gksudo gedit /boot/grub/menu.lst

Then I found the line:
default 0

and changed it to:
default 4

Now the boot menu works as I intended. Note - I may have to adjust the default number to '3' if one of the current kernels drops off the list. I'll watch for that.

Here's the full list of instructions if you're using a console for the lot:

How to change the timeout seconds for GRUB menu on boot-up

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
gksudo gedit /boot/grub/menu.lst

* Find this line

timeout 10

* Replace it with the following line, where X_seconds is a number representing the number of seconds before the menu should timeout.

timeout X_seconds

* Save the edited file

How to change default Operating System boot-up for GRUB menu

* Find this line

default 0

* Replace with the following line, where X_sequence is a number representing the number of the Grub menu item you want to be the default operating system.

default X_sequence

To figure out which number corresponds to the desired operating system, scroll to the bottom of the menu.lst file in gedit and look for lines that begin with the word title. The first "title" is 0, the second is 1, etc. Count "title" entries to find the number of the desired operating system and enter that number in place of X_sequence in the line above.

How to display only one kernel on GRUB menu

* Find this line

# howmany=all

* Replace with the following line

# howmany=1

Where 1 means to keep the last kernel, 2 to keep the last 2 kernels, etc. Do not delete the # symbol. The menu will be updated once a new kernel will be updated by the system, not before.

* Save the edited file

* Update /boot/grub/menu.lst

sudo update-grub

No comments: