E-Mail:
Get our new Windows 7 eBook (PDF) for $7 with 70+ Tips. Download Now!

Kernel Update Breaks Ubuntu?

  • No Related Post

If you are suffering a mouth breathing moment like I did today, happen to be using Ubuntu Edgy and found that after an update, that your GUI has suddenly left the building - don’t panic. Just try this.

First off, boot from a live CD on the problem PC. Now open up a terminal window and type the following:

sudo fdisk -l

Now understand, that is a lower case ‘L’, not an upper case ‘I’ on the end there. Depending on whether you are running with SATA drives or IDE, you’ll end up with something that looks something like this:

Disk /dev/sda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       36104   290005348+  83  Linux
/dev/sda2           36105       36481     3028252+   5  Extended
/dev/sda5           36105       36481     3028221   82  Linux swap / Solaris

Confused yet? Not to worry. All you need to do is look for the line that says ‘Linux’ and the number blocks that are larger than the rest. If you are dual-booting, then you would look for the large number again, but remember to watch for the line ‘Linux’ under the system label. Make a note of which device it is. In my case, it’s going to be /dev/sda1 .

Now from the same terminal window, let’s get this drive mounted so we can save this data in case recovery goes south, shall we? The next thing to pound out into the terminal window is the following:

mkdir /backup

This creates a directory that will soon be pointing to your actual hard drive, that we will be recovering. Now type this:

mount /dev/device-name-seen-above-here /backup

So in this instance, I would be mounting /dev/sda1 . You on the other hand, might be mounting something else, depending on the output of your fdisk output.

After hitting enter on that last line, you should see a new folder appearing on the desktop on the booted live CD. Click into it and see if you are able to view its contents. You will want to mainly navigate to /home/your-user-name .

Now make sure to goto view, then the show hidden files. This will enable you to save your email settings along with your Firefox settings as well. Firefox data saving is rather easy, just look for .firefox and save it to an external hard drive, which you should now plug into the PC itself. It will after a few seconds, show up on your desktop as well if it is formated in a Linux friendly file system. NTFS may show up, but it is hardly Linux friendly.

As for Evolution, this can be a little trickier. You will need to locate the following folders:

.evolution

.gconf/apps/evolution

.gnome2_private/Evolution

Each folder needs to be backed up and notes taken as to their perspective locations for being placed back if needed. Grab whatever else is critical from the Home folder and let’s see about getting that UI back up and running. Reboot your PC and remove the CD.

Immediately after the BIOS screen comes up, you will just for a second, see where it says in the upper left to ‘press Esc’ for more options. This is your hidden GRUB (boot) menu, press Esc and then select the third line down. This will allow you to boot into the kernel you were using previously.

Once you manage to get back into your Ubuntu PC, you will be feeling a lot better. You have your important data backed up and of course, you can now take steps to put this other kernel out to pasture. First, open up a terminal window and type the following to figure out which kernel you are running now which is working for you.

uname -r

Your output should look something like this:

2.6.17-11-generic

If this is the case, then it stands to reason that 2.6.17-12 is the problem kernel. Knowing this, goto System, Administration and choose Synaptic. Do a search for linux-image.

Remembering that we like -11 and want to kill off the -12 kernel (linux-image), you would look for two entries for this problem kernel.

-linux-image-2.6.17-12-386

and

-linux-image-2.6.17-12-generic

**Remember, the kernel numbers used are just examples and not to be taken as the exact ones to be removed. Knowing that the higher numbered entries are the two you are looking for however, go ahead and remove them both once you are sure, then reboot. If all went well, you have just rolled your kernel back to where it was before Ubuntu hosed your system! ;)

[tags]Linux,PC backup[/tags]

10 Comments

You make this much harder than it needs to be.

It’s really not necessary to back up dirs, you’re only changing kernels.

1) reboot, hit escape like you said.
2) one you’ve rebooted edit /boot/grub/menu.lst. The sections are grouped by kernel version and have blank lines separating them. Just delete the lines of the offending kernels.
Sample

title Ubuntu, kernel 2.6.20-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=97963222-a32b-4dad-bbda-abb1604df098 ro
quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=97963222-a32b-4dad-bbda-abb1604df098 ro
single
initrd /boot/initrd.img-2.6.20-16-generic

title Ubuntu, kernel 2.6.20-15-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=97963222-a32b-4dad-bbda-abb1604df098 ro
quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
============

Its pretty obvious what lines should be removed by the way they’re grouped. To remove 2.6.20-16 delete the sections which mention it.

An even easier method is to change the default variable. Its normally 0. In the case you mentioned, change it to 2 (indexed from 0). This would make grub choose the 3rd kernel listed.
Change:
default 0
to:
default 2

I’m pretty sure that if you delete them, they will be reloaded next time you do an update (using synaptic, etc).

Anon: Thanks for the feedback. For intermediate users who can easily edit GRUB or their conf files to make twin view a reality, among other needs, sure, you are totally right.

You put that in front of any typical Windows user and they are going to run back to Redmond at full speed. See, the problem is that to you and I, your solution is not so bad. But despite the name of this site, this content is largely targeting people who just want the kernel gone, without any ’suprises’.

As for backing things up, this was a subtle way to ensure that a recent backup was made as many new Linux users are so stuck in learning mode, that they forget. ;)

With that said, yes, your solution is *much faster* and easier, should anyone reading it have any idea what to do with the file in question.

Good advice though, thanks for the alternative. :)

Almost forgot. If you were to not bother with backing up, the process I described take *roughly* two minutes. ;)

Well you ‘mkdir /backup’ but you mount to ‘/mnt/backup’ !

I think there is an error with your directoy names:

You create a backup directory in root folder:
“mkdir /backup”

Then you mount the described partition to /mnt/backup:
“mount /dev/device-name-seen-above-here /mnt/backup”

I think that should be:
“mount /dev/device-name-seen-above-here /backup”

Jeez, never knew Ubuntu could be so complex. I run MEPIS, and when you install a new kernel, the previous kernel is linked to a, that’s right, ‘Previous Kernel’ entry in the boot menu…. Now I understand why the call it SimplyMEPIS….

Felix: Fixed it, thanks. :)

CeVO: Um, Simply Mepis is basically Kubuntu with Mepis features considering it’s core is in fact, Ubuntu. As for the previous kernel entry, I did mention this as stated:

Immediately after the BIOS screen comes up, you will just for a second, see where it says in the upper left to ‘press Esc’ for more options. This is your hidden GRUB (boot) menu, press Esc and then select the third line down. This will allow you to boot into the kernel you were using previously.

Because while labeling may be different, it is offered EXACTLY the same way. ;)

Matt,
If you’re a true Ubuntu fan, why are you still using Edgy? It’s last year’s edition.
They may have taken something from SimplyMepis on the GRUB screen, but every time that (K)Ubuntu upgrades the kernel, you’re given the choice of the new or old version to boot into. And I have never ran into any problems, nor do I have have hit the ‘ESC’ key.
True, upgrading to Feisty wasn’t easy, I had to do a total reinstall. You have a valid point, that it should be easier. In my experience, going from Win98 to WinXP, was an achey-breaky heart ordeal. WinXP to Vista, HA.

If only we all can get along, then maybe Linux will be a true contender against Micro$oft.

temarc

Timothy: I am a fan of what I can ‘do with it’, but am careful not to get caught up into any Ubuntu is wonderful type of hype. :)

Feisty is fine, on the desktop. But there is a lot of half-truths being passed around with Feisty with regard to wireless support. Unless you have one of those lucky wifi cards that work (NDISWrapper or not), Feisty is then driving people back to Windows in herds.

Previously supported cards, even with modules intact, were kicked to the curb in the name of the all-mighty zeroconf goodness of that POS known as network-manager.

I am working like mad to get people into using Wicd, as it does not care what card you use - so long as it can be . I have RC 5 for Gutsy, hoping to see what they have done with it in the wireless world. I have studied this issue closely since Dapper and have watched it actually get worse with each release - why? I have some theories, but nothing to write home about.

I am remaining hopeful that I can use a script I am working on to actually back-up my current software database will make a clean install a little less painful with Gutsy, which I will do as Feisty just provided me with little compelling reason to bother.

A great example was the success of the following script I cobbled together thanks to Feisty and its bugs:

#! /bin/sh -f
sudo cp /home/$USER/wifi-radar-ra0.conf /etc/wifi-radar.conf
sudo ifconfig ra1 down
sudo ifconfig ra1 up
sudo wifi-radar

Because RT2500 cards were no longer being initialized on some machines while strangely working on others, I had to create the following - until discovering Wicd, that is.

I am in this for the long haul - have been for a long time:

http://tinyurl.com/3ydkru

;)

Hope this clears my position up a little better. I am not a friend to purist users by any stretch - I want Linux to grow into what I believe it potentially can with the right kind of mindset for mass adoption.

To upgrade to the new kernel in feisty follow this howto upgrade to the latest kernel

What Do You Think?

 
33 queries / 0.384 seconds.