Making the -9 kernel default (was: Re: dist-upgrade installed new kernel = KERNEL PANIC [SOLVED])

Tim Frost timfrost at
Wed Nov 23 21:34:30 UTC 2005

On Wed, 2005-11-23 at 20:09 +0200, Gruneberg wrote:

> Anyway, borked my driverloader for my wireless card, reading this 
> thread, try reboot into grub menu - ahha - kernel -9 is still there,
> boot and all is good in the wireless world again.  So the question is 
> how do i get grub to boot into the 2.6.12-9-386 kernel by default
> rather than the new -10 image?  Without reborking thinks again...

Edit the grub menu.list, after saving a copy of it. (I use gedit, but
substitute your favourite text editor):
  sudo cp /boot/grub/menu.lst /boot/grub/
  sudo gedit /boot/grub/menu.lst

You have two choices:
1: Change the "default" entry to the number that matches the -9 image:
    Count the "Title" lines in the file (starting at 0).  
    Locate the line "default		0", and change the 0 to the 
    number corresponding to the -9 kernel (this is probably "2", as
    there are 2 entries for the -10 kernel - normal and rescue modes)

2: Move the stanza that defines the -9 kernel above the -10 kernel.
   This means moving all the lines from the title to the blank line 
   following the command "boot"

Save the file, check your changes, then reboot.  A minimal check that I
do is to run diff against the two versions of the file:
   diff -u /boot/grub/ /boot/grub/menu.lst
For option 1, you should see something similar to the following:

tim at marvin:~$ diff -u /boot/grub/ /boot/grub/menu.lst
--- /boot/grub/    2005-11-24 10:21:03.000000000 +1300
+++ /boot/grub/menu.lst 2005-11-24 10:21:22.000000000 +1300
@@ -9,7 +9,7 @@
 # You can specify 'saved' instead of a number. In this case, the
default entry
 # is the entry saved with the command 'savedefault'.
-default                0
+default                2

 ## timeout sec
 # Set a timeout, in SEC seconds, before automatically booting the
default entry

(Note that long lines have been wrapped by my mail program)

If you re-arrange the entries, the diff should show the entry for the -9
kernel (with leading '+' markers like the '+default 2'), before the -10
kernel, then with leading '-' in the original location.

When you are happy, reboot.

More information about the ubuntu-users mailing list