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 :(

I am thinking of changing the symlinks /initrd.img and /vmlinuz to the previous kernel image and use kexec. Please tell some better way to load the 2.6.31-16 release of kernel from ssh and not the grub boot menu. I am using Ubuntu Karmic.


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: 

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.

  • 1
    Odd question, great answer. How can you select anything from ssh? – DaveParillo Jan 8 '10 at 16:25

I found out there is also a GUI editor for Grub2 in universe repository called startupmanager. I used it actually.

  • It was/is for GRUB1, too. Just has less features at the moment on GRUB2. – Nathaniel Jan 8 '10 at 18:25
  • this was mentioned in the UbuntuForums post i linked to, but i described the commandline alternative since you asked about SSH. still, obviously X forwarding via SSH makes this a good solution too. – quack quixote Jan 8 '10 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.