DevHeads.net

no space left on /boot

Hi there,

after many years of dutiful service one of my remote boxes stops to accept updates.

It complains that there is no space on /boot

But I can not delete any of the old kernels as the following dialogs show

how can I clean up things?

robert

root@salome ~ # uname -r
4.4.0-22-generic

root@salome ~ # apt-get purge vmlinuz-4.4.0-81
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vmlinuz-4.4.0-81
E: Couldn't find any package by glob 'vmlinuz-4.4.0-81'
E: Couldn't find any package by regex 'vmlinuz-4.4.0-81'

root@salome ~ # ls -l /boot/
total 488112
-rw-r--r-- 1 root root  1239612 Mai 13  2016 abi-4.4.0-22-generic
-rw-r--r-- 1 root root  1243479 Dez  2  2016 abi-4.4.0-53-generic
-rw-r--r-- 1 root root  1246311 Jun 14 14:24 abi-4.4.0-81-generic
-rw-r--r-- 1 root root  1246511 Jun 26 21:45 abi-4.4.0-83-generic
-rw-r--r-- 1 root root  1246670 Jul 18 17:00 abi-4.4.0-87-generic
-rw-r--r-- 1 root root  1246835 Aug  1 00:25 abi-4.4.0-89-generic
-rw-r--r-- 1 root root  1246835 Aug 10 13:02 abi-4.4.0-92-generic
-rw-r--r-- 1 root root  1247269 Aug 12 01:40 abi-4.4.0-93-generic
-rw-r--r-- 1 root root  1249161 Sep 12 19:59 abi-4.4.0-96-generic
-rw-r--r-- 1 root root  1249112 Sep 19 22:29 abi-4.4.0-97-generic
-rw-r--r-- 1 root root  1249237 Okt 10 18:19 abi-4.4.0-98-generic
-rw-r--r-- 1 root root   189520 Mai 13  2016 config-4.4.0-22-generic
-rw-r--r-- 1 root root   189877 Dez  2  2016 config-4.4.0-53-generic
-rw-r--r-- 1 root root   190356 Jun 14 14:24 config-4.4.0-81-generic
-rw-r--r-- 1 root root   190356 Jun 26 21:45 config-4.4.0-83-generic
-rw-r--r-- 1 root root   190356 Jul 18 17:00 config-4.4.0-87-generic
-rw-r--r-- 1 root root   190356 Aug  1 00:25 config-4.4.0-89-generic
-rw-r--r-- 1 root root   190356 Aug 10 13:02 config-4.4.0-92-generic
-rw-r--r-- 1 root root   190356 Aug 12 01:40 config-4.4.0-93-generic
-rw-r--r-- 1 root root   190517 Sep 12 19:59 config-4.4.0-96-generic
-rw-r--r-- 1 root root   190517 Sep 19 22:29 config-4.4.0-97-generic
-rw-r--r-- 1 root root   190517 Okt 10 18:19 config-4.4.0-98-generic
drwxr-xr-x 5 root root     1024 Nov 10 16:06 grub
-rw-r--r-- 1 root root 34995222 Sep  9 08:34 initrd.img-4.4.0-22-generic
-rw-r--r-- 1 root root 35525260 Sep  9 08:34 initrd.img-4.4.0-53-generic
-rw-r--r-- 1 root root  6479404 Sep  9 08:33 initrd.img-4.4.0-57-generic
-rw-r--r-- 1 root root 35522720 Sep  9 08:33 initrd.img-4.4.0-81-generic
-rw-r--r-- 1 root root 35524611 Sep  9 08:33 initrd.img-4.4.0-83-generic
-rw-r--r-- 1 root root 35522615 Sep  9 08:33 initrd.img-4.4.0-87-generic
-rw-r--r-- 1 root root 35529088 Sep  9 08:33 initrd.img-4.4.0-89-generic
-rw-r--r-- 1 root root 35530657 Sep  9 08:32 initrd.img-4.4.0-92-generic
-rw-r--r-- 1 root root 35535027 Sep  9 08:34 initrd.img-4.4.0-93-generic
-rw-r--r-- 1 root root 35530409 Sep 21 07:57 initrd.img-4.4.0-96-generic
-rw-r--r-- 1 root root 35611821 Okt 25 07:19 initrd.img-4.4.0-97-generic
drwx------ 2 root root    12288 Jul  7  2016 lost+found
-rw------- 1 root root  3855781 Mai 13  2016 System.map-4.4.0-22-generic
-rw------- 1 root root  3874377 Dez  2  2016 System.map-4.4.0-53-generic
-rw------- 1 root root  3883391 Jun 14 14:24 System.map-4.4.0-81-generic
-rw------- 1 root root  3883887 Jun 26 21:45 System.map-4.4.0-83-generic
-rw------- 1 root root  3884173 Jul 18 17:00 System.map-4.4.0-87-generic
-rw------- 1 root root  3884798 Aug  1 00:25 System.map-4.4.0-89-generic
-rw------- 1 root root  3884798 Aug 10 13:02 System.map-4.4.0-92-generic
-rw------- 1 root root  3885811 Aug 12 01:40 System.map-4.4.0-93-generic
-rw------- 1 root root  3886723 Sep 12 19:59 System.map-4.4.0-96-generic
-rw------- 1 root root  3886693 Sep 19 22:29 System.map-4.4.0-97-generic
-rw------- 1 root root  3887471 Okt 10 18:19 System.map-4.4.0-98-generic
-rw------- 1 root root  7015440 Mai 13  2016 vmlinuz-4.4.0-22-generic
-rw------- 1 root root  7065648 Dez  2  2016 vmlinuz-4.4.0-53-generic
-rw------- 1 root root  7092784 Jun 14 14:24 vmlinuz-4.4.0-81-generic
-rw------- 1 root root  7092720 Jun 26 21:45 vmlinuz-4.4.0-83-generic
-rw------- 1 root root  7095888 Jul 18 17:00 vmlinuz-4.4.0-87-generic
-rw------- 1 root root  7098096 Aug  1 00:25 vmlinuz-4.4.0-89-generic
-rw------- 1 root root  7098032 Aug 10 13:02 vmlinuz-4.4.0-92-generic
-rw------- 1 root root  7097296 Aug 12 01:40 vmlinuz-4.4.0-93-generic
-rw------- 1 root root  7101968 Sep 12 19:59 vmlinuz-4.4.0-96-generic
-rw------- 1 root root  7102864 Sep 19 22:29 vmlinuz-4.4.0-97-generic
-rw------- 1 root root  7103856 Okt 10 18:19 vmlinuz-4.4.0-98-generic

Comments

Re: no space left on /boot

By Tommy Trussell at 12/06/2017 - 13:28

I see this happen all the time on older systems. I think it's due to a
missing step in the upgrade process -- Ideally before doing the upgrade you
would CAREFULLY do an

apt autoremove

to purge all the old linux packages, because in the upgrade process (from
Ubuntu 16.04 to 16.10 for instance) the upgrader deletes the kernel
packages but leaves the boot portions and libraries behind. I presume this
is because it's safer to assume it won't hurt anything and it could break
the boot if it picked the wrong things.

I wrote "carefully" because autoremove can occasionally remove things you
don't want it to.

I apologize that I cannot tell you the other places to look for the
libraries that get left behind. If you dig around you'll see them, and you
can free up a lot of space by deleting them. I'm sure other folks can
describe it better and maybe can describe exactly why the upgrade process
doesn't catch these files.

Re: no space left on /boot

By Volker Wysk at 12/06/2017 - 09:13

Am Mittwoch, 6. Dezember 2017, 09:10:27 CET schrieb robert:
Hi

I've had this problem. For me, it was just a matter of "apt-get autoremove", which is to remove - amongst other unneeded things - all but the last two kernels.

Hope this helps,

Volker

Re: no space left on /boot

By robert rottermann at 12/06/2017 - 11:53

thanks for all the answers I got

On 06.12.2017 14:13, Volker Wysk wrote:
then apt-get autoremove -f

the -f installed missing libraries, which have not been installed due to
too little space
robert

Re: no space left on /boot

By Frank at 12/06/2017 - 06:25

Try

dpkg --get-selections | grep linux-

to get the list of all installed kernels.

After that, uninstall all the old kernels 

sudo apt-get purge 'oldest-kernel'

For example

apt-get purge linux-image-X.Y.ZZ-WW-generic

Re: no space left on /boot

By Phil Dobbin at 12/06/2017 - 08:36

you could always use Ubuntu Tweak (search for it in Google, etc,
whatever). It does a good job of removing old kernels.

Cheers,

Phil.

Re: no space left on /boot

By oxy via ubuntu-users at 12/06/2017 - 09:22

06 December 2017 at 12:36, Phil Dobbin wrote:
Re: no space left on /boot (at least in part)

or use the script

rm-kernels

it gives a GUI with all (but the latest) kernels, just check mark the ones you
want to remove and you're off

Re: no space left on /boot

By Tom H at 12/06/2017 - 05:55

On Wed, Dec 6, 2017 at 3:10 AM, robert < ... at redcor dot ch> wrote:
"vmlinuz-4.4.0-81" isn't the package name. Run "dpkg -S" on it to
determine the package to which it belongs.

Does "/etc/kernel/postinst.d/apt-auto-removal" exist on your system?

What's the output of "cat /etc/apt/apt.conf.d/01autoremove-kernels"?

Re: no space left on /boot

By Liam Proven at 12/06/2017 - 05:06

On 6 December 2017 at 09:10, robert < ... at redcor dot ch> wrote:
Can you try

apt clean
apt purge

That might make some room? Ah, but mainly on / and /var not on /boot...

Then try

apt remove linux-image-4.4.0-22*

Re: no space left on /boot

By robert rottermann at 12/06/2017 - 05:27

On 06.12.2017 10:06, Liam Proven wrote:
uname -r

prints 4.4.0-22-generic

does this not mean, that 4.4.0-22 is still needed?

robert

Re: no space left on /boot

By silver.bullet at 12/06/2017 - 04:33

On Wed, 6 Dec 2017 09:10:27 +0100, robert wrote:
The package names are linux-image-x.y.p-q-generic .

Re: no space left on /boot

By robert rottermann at 12/06/2017 - 05:24

On 06.12.2017 09:33, Ralf Mardorf wrote:
root@salome ~ # apt-get purge linux-image-4.4.0-81-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libperl5.22 : Depends: perl-modules-5.22 (>= 5.22.1-9ubuntu0.2) but 5.22.1-9
is to be installed
 linux-image-extra-4.4.0-101-generic : Depends: linux-image-4.4.0-101-generic
but it is not going to be installed
 linux-image-extra-4.4.0-81-generic : Depends: linux-image-4.4.0-81-generic but
it is not going to be installed
 linux-image-generic : Depends: linux-image-4.4.0-101-generic but it is not
going to be installed
                       Recommends: thermald but it is not going to be installed
 perl : Depends: perl-modules-5.22 (>= 5.22.1-9ubuntu0.2) but 5.22.1-9 is to be
installed
        Recommends: rename but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a
solution).

can I just make space by deleting some of these files?

robert

Re: no space left on /boot

By Xen at 12/06/2017 - 10:47

Yes, even if you uninstall the packages later it won't complain.

In fact the initrds don't belong to any package so you can delete them
safely.

Don't delete the one from your running kernel though.

update-initramfs -u should not recreate all of them either....

Re: no space left on /boot

By Colin Law at 12/06/2017 - 05:36

On 6 December 2017 at 09:24, robert < ... at redcor dot ch> wrote:
To get around this problem in the past I have used the technique of
deleting some of the old kernel files in /boot, using something like
sudo rm /boot/*-a.b.c-dd*
then
sudo apt-get install -f
sudo apt-get install linux-generic

You might want to try ls rather rm initially just to check it finds
the right files.

Colin