Clearing space on Linux /boot partition

This is kind of a “101” lesson, but it’s an issue that can really baffle Linux newbies. Ubuntu Linux, when configured to auto-update itself, will update its own kernel. That’s all fine, but the problem is that it retains the old kernel data, which can quickly build up in the standard /boot partition – a partition that is typically not very large.

DriveSlimIcon1Once /boot fills up, the system freaks out and becomes unstable. So, needless to say, it’s important to clear out those old kernel files every once in a while. Here’s how:

First, check to see what version of the Linux kernel is active:

uname -r

Next, do a directory listing of the contents of /boot:

ls -l /boot

You’ll notice that there are multiple files there w/ the same versions – don’t sweat that – the removal process will remove the corresponding files on a per-version basis.

Starting with the OLDEST version, run the following:

sudo apt-get purge linux-image-<oldest version number>

Repeat for each of the old kernels (but be sure not to accidentally attempt to delete the current, live kernel!).

Also, I typically keep the last version, as well – just in case.

Note that there are many tutorials on this topic, some of which provide a huge, complex-looking single line of code to do all of these steps at once. I’m not a big fan of this, as too many things can go wrong. Better to do this one step at a time, IMO.

Upgrading from Ubuntu Svr 11.04

I’ve been rehabilitating some of our older servers recently and came across an issue I’ve been banging my head on for a few days – namely, the inability to upgrade from Ubuntu Server 11.04.

Basically, apt-get couldn’t retrieve any update files, no matter what I did (do-release-upgrade didn’t work, adding the ‘-d’ flag didn’t work, editing my sources.list to change the subdomains to ‘old-releases’ didn’t work).

I finally found this article detailing, amongst other things, the option to download ubuntu-11.10-alternate.iso – an installer disc that should enable an upgrade from 11.04 to 11.10 without network access.

My hope is that this will succeed, then I can move on to upgrading to 12.04 LTS or 14.01 LTS…