Ubuntu – Boot partition filling up: Is this a bug in Ubuntu


I keep running into the issue of the /boot partition filling up with old kernel images, which causes obscure errors during upgrades (but now I know what they are…).

Note that I already know how to fix this thanks to Ask Ubuntu: here's my favorite answer.

My question is, why does Ubuntu keep doing this, and isn't this a serious design flaw?

In reading questions related to /boot filling up, I have seen comments like "This happens because you assigned a small space for the boot partition or you have UEFI and forgot to increment the space.". However, I have encountered this problem on at least three different Ubuntu installations, spanning versions from 12 to 15, and I have never used anything other than the default install options. I've always done a clean Ubuntu install using the entire disk (no dual-boot), although the drive has usually had something else on it before.

Am I doing something wrong in the install (i.e. an option I should select)? I always assume the default options will be the safest.

Also, even if the install was different (i.e. no /boot, or a larger /boot), wouldn't this still be an issue? (i.e. if old kernel images are never deleted, they are going to eat up the disk space, which seems like a design flaw even if there is plenty of free space).

Best Answer

  • why does Ubuntu keep doing this?

    Short version: safety.

    Long version: the kernel is the most important part of an OS. It handles communication between hardware and software, among other things that I won't cover in detail here.

    Changing the kernel might give you problems. Most of the time everything goes well, but the one time that something is screwed up you do want to have it working again quickly.

    Say you are researching materials for your thesis and the deadline is approaching... suddenly a kernel upgrade breaks your Wi-Fi. Do you prefer to postpone your graduation for saving 150 MB of disk space?

    I guess no, you don't want that. Here's why you reboot, select the previous kernel and go on with your work. Things like this don't happen often, but they may happen rarely and on some specific hardware, maybe only for one kernel release.

    I actually experienced seeing my parents' PC not accepting any keyboard input after a kernel upgrade (a simple keyboard, not a wireless one). Now, using a PC without a keyboard is not nice.

    isn't this a serious design flaw?

    Not that serious, since benefits outreach the downsides and nowadays hard drives are basically always bigger than 250 GB. Even with 10 different kernels you would occupy only like 2 GB. Yes it starts to be a waste of space after a while, but not that noticeable. Moreover you can uninstall them manually, they are not locked.

    Nevertheless, it's reasonable to say that only the last few kernels are needed. That's why Ubuntu 16.04 Xenial marks as "auto-removable" the old kernels, except the last 2.

    I always assume the default options will be the safest

    Indeed, your assumption is correct. Ubuntu won't never let you blindly overwrite your kernel without any backup solution.

  • Related Question