NO SPACE LEFT ON DISC /BOOT. PLEASE FREE AT LEAST…

Paweł Grzesiecki
2 min readJun 22, 2018

--

A common problem during Linux kernel upgrade is not enough space on the boot partition (if present). There are two solutions to solve this:

  1. resize boot partition what is tricky because in most cases boot is the first partition on the hard drive and you probably have to resize the partition next to boot to make some space for resizing,
  2. free space on the boot partition by removing old unused Linux kernels
The upgrade needs a total of 18.1 M free space on disk `/boot`.
Please free at least an additional 18.1 M of disk space on `/boot`.Empty your trash and remove temporary packages of former installations
using `sudo apt-get clean`.

Here I focus on the second solution which is much more accessible and fast to apply.

To remove unused kernels, we must be sure what kernel is currently used. I’m using 4.4.0–66-generic and uname confirmed that:

szarik@szarik:~$ uname -aLinux szarik 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Now we can check all available linux kernels in system to realize which can be safely removed. Note that the 4.4.0–66-generic kernel is also displayed:

szarik@szarik:~$ dpkg -l linux-image-\* | grep ^iiii  linux-image-4.4.0-64-generic       4.4.0-64.85         amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMPii  linux-image-4.4.0-66-generic       4.4.0-66.87         amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMPii  linux-image-extra-4.4.0-64-generic 4.4.0-64.85         amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMPii  linux-image-extra-4.4.0-66-generic 4.4.0-66.87         amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMPii  linux-image-generic                4.4.0.66.70         amd64        Generic Linux kernel image

A good practice is to have two compilations of the kernel. Currently used and one back in case of problems. However, sometimes that one other version takes too much disk space. Then you can use autoremove:

szarik@szarik:~$ sudo apt-get autoremove

if this way does not remove redundant compilation, we can remove them directly using:

szarik@szarik:~$ sudo apt-get purge  linux-image-4.4.0-64-genericThe following packages will be REMOVEDlinux-image-4.4.0-64-generic* linux-image-extra-4.4.0-64-generic* linux-signed-image-4.4.0-64-generic*

after that we can successfully upgrade system without missing space on /boot.

--

--

Paweł Grzesiecki
Paweł Grzesiecki

Written by Paweł Grzesiecki

0 Followers

I’m a staunch believer in the proof of concept methodology and simple but effective solutions. Worked with NodeJS, PHP, Python, GoLang and Elixir.

No responses yet