AndrewPearson.org

Andrew Pearson's Little Corner of the Internet...

Tuesday, January 10, 2012

Fedora Annoyance: Needs XX MB on the /boot filesystem

This post is quite a bit different from my other posts thus far on this blog (which have been about Android programming), but I decided to include it because I find this problem pretty irritating, and I think that yum should have some sort of option to deal with it automatically.

Fedora is known for keeping its packages very up to date. Though this is great for security and functionality, constant kernel updates can become irritating when one's /boot partition fills up. Sometimes, you might see yum spit out the following error during an update:

Transaction Check Error:
installing package kernel-3.1.0-7.fc16.x86_64 needs 9MB on the /boot filesystem

Error Summary
-------------
Disk Requirements:
At least 9MB more space needed on the /boot filesystem.


This means that your update has failed because you have run out of space to install the new kernel. (It is important to note that Fedora doesn't just replace old kernels, it keeps them so that you can boot into them should the new kernel give you any trouble. This is why GRUB (or whatever bootloader you use) will show a few kernels after you've updated a few times.)

Though / or /home might have a tremendous amount of free space, kernels are installed to the /boot filesystem. Since /boot is (almost) always on its own partition, the amount of space on / or /home is irrelevant: when /boot is full, you won't be able to update to a new kernel and your yum update will error out. The solution to this problem is simple: remove old, unused kernels from /boot to make room for new kernels.

First, check which version kernel you are currently running. At the command prompt, type:
uname -r

You should see something like this:
3.1.7-1.fc16.x86_64

The output from uname (uname is a utility to print system information; the -r flag tells uname to print the kernel release that you are running) says that I have the Fedora 16 package of the 3.1.7-1 version of the Linux kernel, compiled for x86_64 processors, installed.

Next, check which kernel versions you currently have installed. At the command prompt, type:
rpm -q kernel

You should see something like this:
kernel-3.1.4-1.fc16.x86_64
kernel-3.1.6-1.fc16.x86_64
kernel-3.1.7-1.fc16.x86_64


The output from rpm (RPM is a package manager; the -q flag queries the package manager for whatever term immediately follows the -q flag) says that three "kernel" packages are installed: 3.1.4, 3.1.6, and 3.1.7. The only thing left to do is to remove one of the kernels to make room for the new one.

It is very important to note that the previous command listed the kernel which uname told us was currently running. We do not want to remove that kernel. Generally, I would recommend removing the oldest kernel version that you have. To do so, simply type the following at the command prompt:

yum remove kernel-version.that.you.found.above
(kernel-version.that.you.found.above, of course, will be something like kernel-3.1.4-1.fc16.x86_64)

You can check to see that you removed the kernel version by querying rpm for "kernel" again.

Now, simply update (ie type in "yum update" at the command prompt) and your new kernel version will install because you have freed up space for it on /boot.

I have personally used this solution on both Fedora 15 and Fedora 16, and I cannot think of a reason why it would not work on other versions of Fedora.

3 comments:

  1. I have to admit I am very impressed with the quality of your blog. It is certainly a pleasure to read as I do enjoy your posts.

    ReplyDelete
  2. "constant kernel updates can become irritating when one's /boot partition fills up"

    "It is important to note that Fedora doesn't just replace old kernels, it keeps them"

    What? By default, Fedora only keeps around three kernels. Just as you happened to show in your examples. If you already have three, then when a new one comes around, the oldest gets removed. I'm staring at my F16 boot partition right now and there are only three, and I've had way more than kernel updates than that. It was the same in F15, and I think for a long while before then, though I paid less attention back then.

    This means you need enough space for three kernels, and whatever space it needs while setting up a fourth. The default sized boot partition comes with plenty of space for this. To run into this error you either have to have set up your own partitions and ignored Fedora's suggested size, or else you're running multiple distros out of the same /boot.

    Don't get me wrong, your posted fix is good information and useful. Your setup and justification includes a bit of a red herring though. This is not a normal problem for an standard out of the box fedora installation.

    ReplyDelete
  3. I have encountered this problem,
    Thank you very much presented visual examples:
    kernel-3.1.4-1.fc16.x86_64
    kernel-3.1.6-1.fc16.x86_64
    kernel-3.1.7-1.fc16.x86_64
    It is for these data, I realized that I had to deal with it.
    I found your article very useful and informative, thank you for sharing
    Richard Brown secure virtual data room

    ReplyDelete