linux - Ubuntu: change kernel order

05
2014-04
  • Orlo

    How can I change the boot kernel order in Ubuntu server 13.10?

    grep menuentry /boot/grub/grub.cfg

    menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9e268fa1-53bd-4d32-a3b3-ae07362f89cb' {
    submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-9e268fa1-53bd-4d32-a3b3-ae07362f89cb' {
        menuentry 'Ubuntu, with Linux 3.11.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.0-12-generic-advanced-9e268fa1-53bd-4d32-a3b3-ae07362f89cb' {
        menuentry 'Ubuntu, with Linux 3.11.0-12-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.0-12-generic-recovery-9e268fa1-53bd-4d32-a3b3-ae07362f89cb' {
        menuentry 'Ubuntu, with Linux 3.4.7-030407-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.4.7-030407-generic-advanced-9e268fa1-53bd-4d32-a3b3-ae07362f89cb' {
        menuentry 'Ubuntu, with Linux 3.4.7-030407-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.4.7-030407-generic-recovery-9e268fa1-53bd-4d32-a3b3-ae07362f89cb' {
    menuentry 'Memory test (memtest86+)' {
    menuentry 'Memory test (memtest86+, serial console 115200)' {
    

    I want to set the default kernel menuentry 'Ubuntu, with Linux 3.4.7-030407-generic'

    In all the docs I've found on google, it's suggested to: changed GRUB_DEFAULT in /etc/default/grub and update-grub

    but GRUB_DEFAULT doesn't effect submenu where my kernel is located.

    for example, if I'm selecting GRUB_DEFAULT=2 than menuentry 'Memory test (memtest86+, serial console 115200)' would be chosen.

  • Answers
  • mpy

    From Submenu Designation Examples:

    GRUB_DEFAULT="1>2"
    

    The first entry specifies the main menu item (counted from 0 onwards), the second the sub menu item (also counted from 0).


  • Related Question

    linux - Install latest kernel to Ubuntu and have grub acknowledge the new installed kernel
  • Phuong Nguyen

    I have an installed Ubuntu Distro (Karmic 9.10) already.

    However, due to some problems with xorg ati driver, I cannot standby my computer. Some guy have suggested me to try the latest version of xorg driver which in turn requires a newer version of Linux kernel than the newest release available from Ubuntu Central Repository (2.6.33).

    I have searched though several articles on how to install a custom Linux kernel. However, these articles are so 2004/2005 and they were talking about lilo (???). Since then, I'm afraid that I cannot make the Grub Boot recognize the new Linux kernel properly (I'm just a newbie to Linux). I would love to know how to install the kernel into Ubuntu and have grub acknowledge the new installed kernel.


  • Related Answers
  • Xenofex

    Ubuntu 9.10 ships GRUB 2, which encourages automatic configuration. This can be done via

    sudo update-grub
    

    This can automatically detect your kernels, even dual boot with Windows.

    If you are upgraded from Ubuntu 9.04 or earlier version, it's probably that you are with GRUB 1.x. Edit /boot/grub/menu.lst with root privilege manually. The structure of that file is easy to read. Just copy/paste and modify a little, nothing complicated.

  • alfplayer

    On Ubuntu 9.10, it happens automatically. To be clear: when you install the new kernel Grub 2's configuration files are automatically edited to add the new kernel as an option on Grub 2's boot menu.

    This also works if you install Lucid's kernels on 9.10.

  • spowers

    One starting place would be to open a terminal window and enter info grub This will bring up the grub documentation. That should give you a better understanding of how grub works as well as how to configure it properly to load your new kernel.

  • oylenshpeegul

    Note that a fresh install of Ubuntu 9.10 will include grub2, whereas an upgrade to 9.10 from 9.04 will leave the earlier grub you already have. I am in the latter situation myself

    $ grub-install -v
    grub-install (GNU GRUB 0.97)
    

    but I think for grub2, you would want to add a custom menu entry very similar to the first sample shown.