Home » Questions » Computers [ Ask a new question ]

How to load previous kernel via ssh?

How to load previous kernel via ssh?

I work remotely on my work computer. I am also the root of the workstation that I am sharing with my colleague. Yesterday, I upgraded the kernel to 2.6.31-17 when asked by the update manager but refrained from restarting because I knew my NVIDIA and several other kernel modules wouldn't work. Unfortunately my colleague who is a linux noob restarted the machine and here I am :(

Asked by: Guest | Views: 300
Total answers/comments: 1
bert [Entry]

"You can't select it from SSH.

You could use SSH to

a) check the Grub settings to make sure your previous kernel is still an option in the Grub menu,
b) set Grub to automatically boot to that option,
c) and finally reboot the system.

This is very similar to a boot-once solution -- I wrote up instructions with Grub v1 in this answer on ServerFault.

If you're using Grub2, you'll have to do some investigating to find the right configuration -- apparently the grub-set-default command doesn't work in Karmic. See ""Grub 2 - 5 Common Tasks"" on UbuntuForums -- #2 deals with modifying the default entry; option 3 in that talks about modifying that through the Grub2 configuration files:

You can see the current ""menuentry"" items listed in the /boot/grub/grub.cfg
by running this command:

grep ""menuentry"" /boot/grub/grub.cfg


Counting starts with zero (0). The first ""menuentry"" item is ""0"", the
second is ""1"", etc. The third visible ""menuentry"" would be 2.

Determine the number you wish to make the default, and enter it
in /etc/default/grub. Make the change and save the file.

sudo nano /etc/default/grub


The user can also select ""saved"" as an option, which will use the
last successfully booted kernel/OS as the default selection.

# Example:
DEFAULT=""saved""


Save the file, then update the menu:

sudo update-grub

You'll need to locate the entry for your older kernel. Once you've changed the default entry to your older kernel and updated Grub, you should be able to reboot the system (sudo reboot now) -- after waiting for it to come back up, you should be running the old kernel."