4

I recently had the warning that /boot was running out of space and I found this solution. Having rebooted and confirmed that I didn't fubar my system, I'm looking at why it happened in the first place?

Okay so evidently there were a lot of kernels installed. That's not something I did manually (I don't even know what a kernel is!) so I guess there's an automatic update process that keeps my system in ship shape. I'm fine with that.

Looking at the Disks utility I see that the /boot partition is only 255MB out of my 128GB SSD. Again, I didn't configure this - it must be the default setting of the Ubuntu installer.

--> Why isn't the /boot partition bigger by default? It seems silly to create a partition that's less than 2% of the drive size. I know that increasing the partition would merely postpone the problem, so perhalps I should really be asking: Why can't Ubuntu solve this problem automatically? All it would need was to keep track of which kernels haven't been used for a long time, and auto-remove those?

1 Answers1

2

Okay, what is a kernel?

In computing, the kernel is a computer program that manages I/O requests from software, and translates them into data processing instructions for the central processing unit and other electronic components of a computer. The kernel is a fundamental part of a modern computer's operating system.

Source, Wikipedia

When does this update?

I think it is lumped in with the Ubuntu Base updates:

The base package is (a) ubuntu-desktop if it is installed, otherwise (b) the alphabetically first of any of the metapackages that are installed, for example, kubuntu-desktop or lubuntu-desktop.

It also seems to have the kernel as part of it - but of course there aren't always kernel updates.

It is normally the kernel that needs the restart when you update (although from 4.0+ it wont).

Source, Ubuntu Wiki

Now to your main question.

I have 6 kernels installed at the moment:

linux-image-3.13.0-32-generic
linux-image-3.13.0-46-generic
linux-image-3.13.0-48-generic
linux-image-3.13.0-49-generic
linux-image-3.13.0-51-generic
linux-image-3.13.0-53-generic

You can find out with this command:

dpkg --list | grep linux-image

Why doesn't ubuntu just remove them?

Well, I sometimes use a different kernel. For example, in the current one I have, linux-image-3.13.0-53-generic, there is a strange bug I got when I broke my xorg.conf file - I couldn't access tty easily. linux-image-3.13.0-51-generic fixed this for me, so I could undo my meddlings.

This is the same for lots of people - Ubuntu isn't in the business to remove packages you might need (even if you haven't used it for years, you may want it). I could do something different, with asking if it needs removing, but it doesn't.

Why is /boot so small?

Why does it need to be big? My current kernel is 5.6 MB:

-rw-------  1 root root 5.6M May 20 12:11 vmlinuz-3.13.0-53-generic

And the total "stuff" for the -53 version is 37.1 MB. You can fit 4 kernels in there, normally enough.

Also, note that the recommended size for /boot is now 500-600 MB.

Do I need it?

You don't - I don't have it. It's not compulsory, but there are some advantages:

  • as a rescue partition
  • rootfs is on a LVM, RAID, is encrypted, or unsupported by GRUB
  • maybe saves a few seconds of boot time

Source, Server Fault

Tim
  • 32,861
  • 27
  • 118
  • 178
  • What is the relation between ubuntu-desktop and kernel? – Pilot6 Jun 04 '15 at 20:24
  • @Pilot6 do the kernel updates not come in Ubuntu Base? – Tim Jun 04 '15 at 20:26
  • What do you mean? What is Ubuntu Base? Kernels are not related with DE at all. – Pilot6 Jun 04 '15 at 20:28
  • @Pilot6 the updates you see called Ubuntu Base, do they not contain Kernel updates? – Tim Jun 04 '15 at 20:30
  • I never met such term "Ubuntu Base". Kernel updates come from <release_name>-updates of "main" repository. My point that there are no dependencies between ubuntu-desktop and any kernel packages. – Pilot6 Jun 04 '15 at 20:33
  • So kernels do not "base" on desktop environment in any way. – Pilot6 Jun 04 '15 at 20:34
  • I see your screenshot, but that does not change anything. There is no relation between "Ubuntu Base" group of updates with an ubuntu-desktop meta package. It looks like updates are grouped some way. – Pilot6 Jun 04 '15 at 20:37
  • @Pilot6 yes, I know they're grouped. I think that kernel updates are put in with past updates - in that category. Do you think they stand alone? – Tim Jun 04 '15 at 20:38
  • I do not care of categories in that updater. They mean almost nothing. They are done just not to confuse people. So I suggest removing "ubuntu-desktop" from the great answer just not to look stupid. – Pilot6 Jun 04 '15 at 20:40
  • @Pilot6 I think it links, I got the info from the wiki. – Tim Jun 04 '15 at 20:43
  • Thank you for the educational background, that was helpful! So it would seem I chose to use LVM when I installed my system - I don't know, can't remember (and I'm not at the machine now so I can't look it up). Would it make sense to back up everything and reinstall from scratch? – Torben Gundtofte-Bruun Jun 05 '15 at 07:22
  • @TorbenGundtofte-Bruun not really, I'd just leave it. Just make sure you clean away the kernels reasonably often. – Tim Jun 05 '15 at 08:58
  • Very curious. Recommended, is 500Mb, default is 250Mb, my freshly installed Ubuntu 16.04 has run out of /boot space in 2 months. Not good at all. Am considering a reinstall. – Phil Lord Jul 05 '16 at 10:56
  • @PhilLord sudo apt-get autoremove – Tim Jul 06 '16 at 10:07
  • @Tim I know how to remove the kernels, but every 2 months? If I go back and repartion with a Gb, it was last several years. I cannot understand why the default is so slow, and wished I noticed it earlier. – Phil Lord Jul 06 '16 at 21:13
  • @PhilLord Because more is wasting the space - you can just run a command slightly more often. I run it every time I sudo apt-get upgrade. – Tim Jul 06 '16 at 21:14
  • @Tim Turns out that this has been reported as a bug and fixed. Sadly, for those of us already here, it means a /boot resize. Unfortunate. https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1465050 – Phil Lord Jul 07 '16 at 12:15