← Back to team overview

touch-packages team mailing list archive

[Bug 798414] Re: update-initramfs should produce a more helpful error when there isn't enough free space

 

The Ubuntu problem reporter now redirects to this bug whenever there's
not enough space on the /boot partition to install a new version of the
kernel. This has gotten much more common on systems set up since 2014,
because Ubuntu now creates a small, separate /boot partition by default.
On systems partitioned with earlier versions of Ubuntu /boot is part of
a much larger / partition, so you may never run into this.

I've included my workaround to this problem, which I'm now using every
couple of weeks when one or another of my Ubuntu systems gets into this
state.

But I also want to disagree with the resolution proposed by the title of
this bug. Even if the "fix" proposed in the title of this bug were
implemented, it wouldn't solve the problem or even make it easier for
less-technical users to get their systems working again.

Ubuntu must manage the set of kernels installed on the system. It must
set up a /boot partition capable of holding the number of kernels it
expects to see on a normal system. If /boot becomes full it must be able
to identify and remove some old kernels. Expecting the end user to
manage this means Ubuntu is unsuitable for non-technical users, and I
think that goes entirely against Ubuntu's founding principles. Moreover,
I don't know why even a technically-minded user would be satisfied with
the current state of affairs. There's no reason why the package manager
should get into a broken state every few weeks that requires human
intervention to fix. These old kernels serve no purpose for the great
majority of users, technical or not.

For those who are running into this for the first time, here's the
workaround I use to fix this problem. Be very careful doing this;
deleting the wrong thing can easily render your system unbootable. I use
aptitude for package management, so you'll need to install it before you
can do this (sudo apt-get install aptitude). At a command prompt:

$ aptitude search linux-image | grep ^i

This will produce a list of installed kernel images, which look like
this:

i   linux-image-3.19.0-28-generic   - Linux kernel image for version 3.19.0 on 686
i   linux-image-3.19.0-30-generic   - Linux kernel image for version 3.19.0 on 686

You can delete all of them, except the most recent one and the one
that's actually running, which may or may not be the same. The most
recent one will be the last numbered one on the list. You can find out
what's actually running by running this command:

$ uname -a
Linux gh-narcissus 3.19.0-30-generic #33-Ubuntu SMP Mon Sep 21 20:58:04 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

To delete the unused kernels, do this:

$ sudo aptitude purge linux-image-3.19.0-28-generic

You'll can list more than one image on this command line. Aptitude will
warn you that it's going to remove linux-image-extra- packages with the
same version numbers as the linux-image packages your purging. That's
ok, but make sure the list doesn't include linux-image-generic (which
will happen if you accidentally put the latest kernel version on the
list).

This will sometimes fail, if /boot is completely full. In that case, I
remove some of the boot files for the unused kernel images manually, and
then run the aptitude purge command again:

$ sudo rm /boot/initrd.img-3.19.0-28-generic

Usually removing one or two is enough that the package manager will be
able to run.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/798414

Title:
  update-initramfs should produce a more helpful error when there isn't
  enough  free space

Status in initramfs-tools:
  Confirmed
Status in Ubuntu:
  Fix Released
Status in initramfs-tools package in Ubuntu:
  Confirmed

Bug description:
  Binary package hint: initramfs-tools

  When generating a new initramfs there is no check for available free
  space, subsequently its possible for update-initramfs to fail due to a
  lack of free space.  This is resulting in package installation
  failures for initramfs-tools.  For example:

  Setting up initramfs-tools (0.98.8ubuntu3) ...
  update-initramfs: deferring update (trigger activated)
  Processing triggers for initramfs-tools ...
  update-initramfs: Generating /boot/initrd.img-2.6.38-8-generic

  gzip: stdout: No space left on device
  E: mkinitramfs failure cpio 141 gzip 1
  update-initramfs: failed for /boot/initrd.img-2.6.38-8-generic
  dpkg: error processing initramfs-tools (--configure):
   subprocess installed post-installation script returned error exit status 1

  WORKAROUND:

  Remove unused kernels using computer janitor or manually free space on
  your partition containing the /boot file system.

To manage notifications about this bug go to:
https://bugs.launchpad.net/initramfs-tools/+bug/798414/+subscriptions