update-initramfs should produce a more helpful error message when there isn't enough free space--or provide an automatic tool for removal of old files

Bug #798414 reported by Brian Murray
This bug affects 822 people
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

Binary package hint: initramfs-tools

When installing a kernel, /boot may become full during execution of post-installation script typically when update-initramfs is creating or updating an initrd.img file. This is resulting in kernel installation error. 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

Ideal behavior:

Give a more helpful error message when this unfortunate situation occurs so that user can fix the broken system and keep it going.

Workaround:

As the bug reporting system forwards user to this bug report, such instructions can be given here:
https://help.ubuntu.com/community/RemoveOldKernels

Related branches

description: updated
Revision history for this message
kireol (kireol) wrote :

df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 40G 13G 26G 33% /
none 1.6G 369k 1.6G 1% /dev
none 1.6G 46M 1.5G 3% /dev/shm
none 1.6G 390k 1.6G 1% /var/run
none 1.6G 0 1.6G 0% /var/lock
none 1.6G 0 1.6G 0% /lib/init/rw
/dev/sda1 96M 85M 5.7M 94% /boot
/dev/sda4 113G 71G 36G 67% /home
/home/me/.Private
                       113G 71G 36G 67% /home/me

Don't see how I'm even REMOTELY in the same bug as this one.

But since obviously nobody else cares and just randomly marks bugs as duplicate, I couldnt care less anymore either.

Why bother reporting stuff if people can't do the bare minimum.

Revision history for this message
Brian Murray (brian-murray) wrote :

Kireol - I selected your bug report as a duplicate of this one because of the following error message in your DpkgTerminalLog.txt file attached to your bug report.

"gzip: stdout: No space left on device
update-initramfs: failed for /boot/initrd.img-2.6.32-32-generic"

Looking at your df output /boot is on a separate partition and it in fact doesn't have much free space.

Revision history for this message
kireol (kireol) wrote : Re: [Bug 798414] Re: update-initramfs does not check for free space

I apologize. I'm having a bad day, #1. And #2 I had 2 tabs open and read
the wrong thread which was completely unrelated to mine. again, sorry.

On Thu, Jun 16, 2011 at 5:35 PM, Brian Murray <email address hidden> wrote:

> Kireol - I selected your bug report as a duplicate of this one because
> of the following error message in your DpkgTerminalLog.txt file attached
> to your bug report.
>
> "gzip: stdout: No space left on device
> update-initramfs: failed for /boot/initrd.img-2.6.32-32-generic"
>
> Looking at your df output /boot is on a separate partition and it in
> fact doesn't have much free space.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (797759).
> https://bugs.launchpad.net/bugs/798414
>
> Title:
> update-initramfs does not check for free space
>
> Status in “initramfs-tools” package in Ubuntu:
> New
>
> 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/ubuntu/+source/initramfs-tools/+bug/798414/+subscriptions
>

summary: - update-initramfs does not check for free space
+ update-initramfs should produce a more helpful error when there isn't
+ enough free space
Changed in initramfs-tools (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in initramfs-tools (Ubuntu):
assignee: nobody → Ubuntu Foundations Team (ubuntu-foundations-team)
Revision history for this message
BetaMax (betabel) wrote : Re: update-initramfs should produce a more helpful error when there isn't enough free space

In the computer Janitor isn't the option for clean up old kernels, please check it out for this problem

Revision history for this message
Luca Galliani (lucagallianimail) wrote :

before sudo aptitude autoremove

Revision history for this message
Christian Mertes (cmertes) wrote :

Luca, what's that command? It fails for me but then there isn't much of a sentence around it to explain what you mean exactly. Did it use to work but doesn't anymore?

In any case, a solution to remove old kernels is much needed. It's tedious for those who know how to do it and an impossible task for the average Windows convert.

Revision history for this message
Mr Mister (mstrerotic) wrote :

this is the result of choosing automatic partitioning at install time using the seperate /tmp /home /usr etc. partitions...
I was a bit nervous using this option when it didn't let me review the partition table afterward....
I definitiley would have increased my boot partition size from 333 Mb although that really should be big enough...
I manually removed all 3.2 kernel entries from the root shell in rescue mode and then reinstalled the 3.5 with synaptic...
all is well so far but I hope I don't have to do this again as it is a bit unnerving...

Revision history for this message
Mr Mister (mstrerotic) wrote :

oops I meant to say...
I manually removed all 3.2 kernel entries USING the root shell in rescue mode and then reinstalled the 3.5 with synaptic...

Revision history for this message
bunnyella79 (bunnyella79) wrote :
Download full text (3.5 KiB)

installArchives() failed: Vorkonfiguration der Pakete ...
Vorkonfiguration der Pakete ...
Vorkonfiguration der Pakete ...
Vorkonfiguration der Pakete ...
(Reading database ...
(Reading database ... 5%%
(Reading database ... 10%%
(Reading database ... 15%%
(Reading database ... 20%%
(Reading database ... 25%%
(Reading database ... 30%%
(Reading database ... 35%%
(Reading database ... 40%%
(Reading database ... 45%%
(Reading database ... 50%%
(Reading database ... 55%%
(Reading database ... 60%%
(Reading database ... 65%%
(Reading database ... 70%%
(Reading database ... 75%%
(Reading database ... 80%%
(Reading database ... 85%%
(Reading database ... 90%%
(Reading database ... 95%%
(Reading database ... 100%%
(Reading database ... 243333 files and directories currently installed.)
Preparing to replace linux-image-3.5.0-25-generic 3.5.0-25.38 (using .../linux-image-3.5.0-25-generic_3.5.0-25.39_amd64.deb) ...
Done.
Unpacking replacement linux-image-3.5.0-25-generic ...
dpkg: error processing /var/cache/apt/archives/linux-image-3.5.0-25-generic_3.5.0-25.39_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-3.5.0-25-generic' to '/boot/vmlinuz-3.5.0-25-generic.dpkg-new': failed to write (No space left on device)
No apport report written because MaxReports is reached already
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
Preparing to replace libssl1.0.0:i386 1.0.1c-3ubuntu2.1 (using .../libssl1.0.0_1.0.1c-3ubuntu2.2_i386.deb) ...
De-configuring libssl1.0.0:amd64 ...
Unpacking replacement libssl1.0.0:i386 ...
Preparing to replace libssl1.0.0:amd64 1.0.1c-3ubuntu2.1 (using .../libssl1.0.0_1.0.1c-3ubuntu2.2_amd64.deb) ...
Unpacking replacement libssl1.0.0:amd64 ...
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.5.0-25-generic_3.5.0-25.39_amd64.deb
Error in function:
Setting up libssl1.0.0:amd64 (1.0.1c-3ubuntu2.2) ...
Setting up libssl1.0.0:i386 (1.0.1c-3ubuntu2.2) ...
Setting up linux-image-extra-3.5.0-25-generic (3.5.0-25.39) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
update-initramfs: Generating /boot/initrd.img-3.5.0-25-generic

gzip: stdout: No space left on device
cpio: Fehler beim Schreiben: Datenbergabe unterbrochen (broken pipe)
E: mkinitramfs failure cpio 1 gzip 1
update-initramfs: failed for /boot/initrd.img-3.5.0-25-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-extra-3.5.0-25-generic.postinst line 1010.
dpkg: error processing linux-image-extra-3.5.0-25-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency prob...

Read more...

Changed in initramfs-tools (Ubuntu):
status: Triaged → Incomplete
Steve Langasek (vorlon)
Changed in initramfs-tools (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Andy Balaam (mail-artificialworlds) wrote :

Warning: removing kernel packages can be dangerous, and might even leave your system unable to boot, so please don't do this if you don't understand what is going on.

I fixed this on my system by removing some old kernels, that I am not using any more.

I checked what kernel I am using like this:

uname -r

This gave me a version number of a kernel I MUST NOT remove because I am using it.

Then I checked what kernels were installed like this:

sudo apt-get remove linux-<TAB>

I.e. I typed "sudo apt-get remove linux-" and pressed the TAB key twice to see a list of possible completions. I chose the linux-image-* and linux-image-extra-* packages that contained versions of the kernel that I was not running, and removed them like this:

sudo apt-get remove linux-image-3.5.0-17-generic linux-image-extra-3.5.0-17-generic linux-image-3.5.0-19-generic linux-image-extra-3.5.0-19-generic

The exact list of packages in the "remove" line might be different for you - I found it out by doing what I describe at the top.

Then I made sure the recently-downloaded kernel packages that failed to configure were ok by running:

sudo apt-get upgrade

Warning: removing kernel packages can be dangerous, and might even leave your system unable to boot, so please don't do this if you don't understand what is going on.

Changed in initramfs-tools (Ubuntu):
assignee: Ubuntu Foundations Team (ubuntu-foundations-team) → nobody
Revision history for this message
Redoubts (redoubts) wrote :

@Andy, #10
I had a very similar problem, and your solution worked for me. I do autoremove & autoclean somewhat frequently, and yet when I tried apt-get remove linux-<TAB>, I found the following on my system:

linux-firmware linux-image-3.5.0-23-generic
linux-generic linux-image-3.5.0-24-generic
linux-headers-3.5.0-23 linux-image-3.5.0-25-generic
linux-headers-3.5.0-23-generic linux-image-3.5.0-26-generic
linux-headers-3.5.0-24 linux-image-extra-3.5.0-21-generic
linux-headers-3.5.0-24-generic linux-image-extra-3.5.0-22-generic
linux-headers-3.5.0-25 linux-image-extra-3.5.0-23-generic
linux-headers-3.5.0-25-generic linux-image-extra-3.5.0-24-generic
linux-headers-3.5.0-26 linux-image-extra-3.5.0-25-generic
linux-headers-3.5.0-26-generic linux-image-extra-3.5.0-26-generic
linux-headers-generic linux-image-generic
linux-image-3.5.0-21-generic linux-libc-dev
linux-image-3.5.0-22-generic linux-sound-base

as well as 3.5.0-17 (but nothing in between that and -23), which I removed to make space.

Revision history for this message
Haw Loeung (hloeung) wrote :

Some other workarounds are:

1) change the compression from the default gzip. I personally use xz and the initrd image works out to be ~30% smaller.

2) change the modules included from "most" to "dep". This reduced the initrd image another 30%.

These options are changed in /etc/initramfs-tools/initramfs.conf.

Revision history for this message
Abhisek Mukherjee (abhisek) wrote :

One thing to suggest is from install media when kernel is loaded it uses lz compression, but when installed in HDD it uses gz compression, which is definitely bigger in size. xz or lz should be used in vmlinuz.

Revision history for this message
Redoubts (redoubts) wrote :

I'm link dropping a bug report into this thread since they're very related.

https://bugs.launchpad.net/ubuntu/+source/apt/+bug/923876

is attempting to prevent the /boot partition from getting this full to begin with.
As of today (2013-03-26), the status shows 'fix implemented' in Precise, but 'pending' in Quantal.

Revision history for this message
matl (mat.l) wrote :

I think my boot partition was to small, because I could not resize it, "sudo apt-get autremove" solved this problem for me.

Revision history for this message
baron_army (baron-army) wrote :

Is anything being done about this bug? I know we want to ensure responsible kernel hygiene but this is kind of annoying.

Revision history for this message
markling (markling) wrote :

This error is still occuring. It appears to be preventing me adding packages through the Ubuntu Software Centre. Tried to file crash report but it said "already filed" and sent me here. Boot partition 96 per cent full. It's only a few weeks since this last happened. Lucky I've got nothing better to do all day than tinker with Ubuntu errors like I was some sort of retired computer hobbyist who doesn't need to earn a living.

Lucky in fact, that Ubuntu is only an operating system for hobbyists who don't have to earn a living and so can spend all their time tinkering with errors like retired hobbyists. I can't wait to go back to the forums to learn all about removing discarded linux images from my boot partition again! I understand why people say Windows sucks. Linux is fun!

Revision history for this message
Fran Cool (francool50) wrote :

Solution from mat.l on 2013-05-31 seems simple but ... how can I open a term to use it ? Alt+F1 (Maj+Alt+F1) don't work (from the "bureau" [desktop] of Raring)

Revision history for this message
Fran Cool (francool50) wrote :

semms OK on Raring Ringtail :
opening terminal with ctrl+alt+T
then sudo apt-get autoremove

Revision history for this message
Tim Fisher (k2trf) wrote :

@Andy's workaround (https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/798414/comments/10) worked for me under Raring perfectly, though I also ran an update, upgrade and dist-upgrade before another autoremove, autoclean and check.

@Haw - thank you for the additional workarounds, gzip should not be the default for this by any means.

Revision history for this message
Enrique Latorres (enrique-7) wrote :

Most likely is that you have a separate boot partition because you are using lvm or an encrypted filesystem. Most kernel updates add a new kernel but do not erase old versions. This way boot partition gets full. The solution is simply to uninstall unused kernel images...
if possible install aptitude, run "sudo aptitude search ~ilinux-image". This will show you the installed kernels
Just remove the older versions, keep two of the newest.
Run "sudo apt-get autoremove linux-image-3.8.0-23-generic" for each of the older kernels. Put your version here.
This should free space on boot partition...

Revision history for this message
Ian Nicholson (imnichol) wrote : Re: [Bug 798414] Re: update-initramfs should produce a more helpful error when there isn't enough free space

On 07/29/2013 06:38 PM, Enrique Latorres wrote:
> Most likely is that you have a separate boot partition because you are using lvm or an encrypted filesystem. Most kernel updates add a new kernel but do not erase old versions. This way boot partition gets full. The solution is simply to uninstall unused kernel images...
> if possible install aptitude, run "sudo aptitude search ~ilinux-image". This will show you the installed kernels
> Just remove the older versions, keep two of the newest.
> Run "sudo apt-get autoremove linux-image-3.8.0-23-generic" for each of the older kernels. Put your version here.
> This should free space on boot partition...
>
That's definitely the reason, but it's not a long-term solution. It's
not 1995, we shouldn't expect users to have to manually remove packages
just because they want an encrypted FS.

Revision history for this message
Mark Russell (marrusl) wrote : Re: update-initramfs should produce a more helpful error when there isn't enough free space

@Ian,

One possible workaround for this issue is mentioned in LP bug 1062623. The suggestion is to use grub to boot the encrypted partition directly and then you don't need a separate /boot.

Revision history for this message
Massimo Manchi (massimo-manchi) wrote :

Hi.

I've an alert "/boot full" that is on sda1

df -H
File system Dim. Usati Dispon. Uso% Montato su
/dev/mapper/lubuntu--vg-root 57G 19G 36G 35% /
none 4,1k 0 4,1k 0% /sys/fs/cgroup
udev 1,1G 4,1k 1,1G 1% /dev
tmpfs 211M 1,1M 210M 1% /run
none 5,3M 0 5,3M 0% /run/lock
none 1,1G 1,1M 1,1G 1% /run/shm
none 105M 17k 105M 1% /run/user
/dev/sda1 239M 236M 0 100% /boot
/dev/sdb1 1,1T 717M 1,0T 1% /media/massimo/Seagate Expansion Drive

and this is the ls

ls /boot
abi-3.8.0-19-generic initrd.img-3.8.0-26-generic
abi-3.8.0-21-generic initrd.img-3.8.0-27-generic
abi-3.8.0-22-generic initrd.img-3.8.0-28-generic
abi-3.8.0-23-generic lost+found
abi-3.8.0-24-generic memtest86+.bin
abi-3.8.0-25-generic memtest86+_multiboot.bin
abi-3.8.0-26-generic System.map-3.8.0-19-generic
abi-3.8.0-27-generic System.map-3.8.0-21-generic
abi-3.8.0-28-generic System.map-3.8.0-22-generic
config-3.8.0-19-generic System.map-3.8.0-23-generic
config-3.8.0-21-generic System.map-3.8.0-24-generic
config-3.8.0-22-generic System.map-3.8.0-25-generic
config-3.8.0-23-generic System.map-3.8.0-26-generic
config-3.8.0-24-generic System.map-3.8.0-27-generic
config-3.8.0-25-generic System.map-3.8.0-28-generic
config-3.8.0-26-generic vmlinuz-3.8.0-19-generic
config-3.8.0-27-generic vmlinuz-3.8.0-21-generic
config-3.8.0-28-generic vmlinuz-3.8.0-22-generic
grub vmlinuz-3.8.0-23-generic
initrd.img-3.8.0-19-generic vmlinuz-3.8.0-24-generic
initrd.img-3.8.0-21-generic vmlinuz-3.8.0-25-generic
initrd.img-3.8.0-22-generic vmlinuz-3.8.0-26-generic
initrd.img-3.8.0-23-generic vmlinuz-3.8.0-27-generic
initrd.img-3.8.0-24-generic vmlinuz-3.8.0-28-generic
initrd.img-3.8.0-25-generic

Can I delete something to let free space or I must enlarge this space?

Macs

Revision history for this message
markling (markling) wrote :

Enrique:

"Most likely is that you have a separate boot partition because you are using lvm or an encrypted filesystem."

True on both counts.

LVM and encryption were offered as options in the Xubuntu installer-for-dummies. Granted, an insy bit of knowledge may be required to to summon the courage to choose such options in the installer. But there is a whole D-class of user who have been led, bovine-like, into such territory with the odd sign here and passing chatter there.

"Most kernel updates add a new kernel but do not erase old versions."

That is apparenlty so.

Software Updater is still periodically, as today, giving me the message: "The upgrade needs a total of 43.2 M free space on disk '/boot'. Please free at least an additional 1,147 k of disk space on '/boot'. Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'."

It is not beyond me to look the routine to solve this problem up on the forums again. I might even next time remember that you posted a workaround here. It is however a great inconvenience. The last thing I need from Xubuntu is any more minor glitches or loose ends that cause me to have to workaround or dowithout or getlostinforumhell. Linux seems at times like it is disappearing under a mound of minor glitches.

This one is more than an inconvenience because it stops kernel upgrades. It is as though, if your usual morning routine was, after running out of the front door with toast in your mouth and papers falling out of your sachel, to jump in your car and speed off, that every now and again when you switched the car on it would say you needed petrol but you couldn't fill up till you cleaned the carburetter. You would speed off to work, knowing that the car was faulty and wondering when you could find the mental energy to pull out the Haynes manual and go over the carburetter cleaning routine again. And all because the good person who gave you the carborettor didn't get round to quite finishing it. It's fair enough, I suppose. But it does rather limit the appeal of motor transport to people who have the time and energy to clean their carburetter periodically.

Revision history for this message
markling (markling) wrote :

Enrique:

I am sorry to report that your workaround does not appear to work. Looks like I may to to getlostinforumhell.

Here's what my computer said about your workaround:

user@comp:~$ sudo aptitude search ~ilinux-image
i linux-image-3.5.0-28-generic - Linux kernel image for version 3.5.0 on 64
i linux-image-3.8.0-23-generic - Linux kernel image for version 3.8.0 on 64
i linux-image-3.8.0-25-generic - Linux kernel image for version 3.8.0 on 64
i linux-image-3.8.0-26-generic - Linux kernel image for version 3.8.0 on 64
i linux-image-3.8.0-27-generic - Linux kernel image for version 3.8.0 on 64
i linux-image-extra-3.5.0-28-gene - Linux kernel image for version 3.5.0 on 64
i linux-image-extra-3.8.0-25-gene - Linux kernel image for version 3.8.0 on 64
i linux-image-extra-3.8.0-26-gene - Linux kernel image for version 3.8.0 on 64
i linux-image-extra-3.8.0-27-gene - Linux kernel image for version 3.8.0 on 64
i linux-image-generic - Generic Linux kernel image
user@comp:~$ sudo apt-get autoremove linux-image-3.5.0-23-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-image-3.5.0-23-generic
E: Couldn't find any package by regex 'linux-image-3.5.0-23-generic'
user@comp:~$ sudo apt-get autoremove linux-image-3.5.0-25-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-image-3.5.0-25-generic
E: Couldn't find any package by regex 'linux-image-3.5.0-25-generic'
user@comp:~$ sudo apt-get autoremove linux-image-3.5.0-26-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-image-3.5.0-26-generic
E: Couldn't find any package by regex 'linux-image-3.5.0-26-generic'
user@comp:~$ sudo aptitude search ~ilinux-image
i linux-image-3.5.0-28-generic - Linux kernel image for version 3.5.0 on 64 bi
i linux-image-3.8.0-23-generic - Linux kernel image for version 3.8.0 on 64 bi
i linux-image-3.8.0-25-generic - Linux kernel image for version 3.8.0 on 64 bi
i linux-image-3.8.0-26-generic - Linux kernel image for version 3.8.0 on 64 bi
i linux-image-3.8.0-27-generic - Linux kernel image for version 3.8.0 on 64 bi
i linux-image-extra-3.5.0-28-generic - Linux kernel image for version 3.5.0 on 64 bi
i linux-image-extra-3.8.0-25-generic - Linux kernel image for version 3.8.0 on 64 bi
i linux-image-extra-3.8.0-26-generic - Linux kernel image for version 3.8.0 on 64 bi
i linux-image-extra-3.8.0-27-generic - Linux kernel image for version 3.8.0 on 64 bi
i linux-image-generic - Generic Linux kernel image

It's a precarious operation to force on a user anyway (I say that of the situtation, not your good help). The most recent kernel comes at the top of the list. The list then progresses from oldest to second most recent. I nearly deleted the most recent kernel.

Revision history for this message
markling (markling) wrote :

To confuse matters, when I do 'uname -r' I get: 3.8.0-27-generic. Yet the list above suggests -28 is the latest. I might easily have deleted all but -28, effectively deleting the current kernel.

This really is a horrid state of affairs. As Andy Balaam wrote: "Warning: removing kernel packages can be dangerous, and might even leave your system unable to boot, so please don't do this if you don't understand what is going on". The problem with this error is you are left with no choice.

Revision history for this message
KevinMorse (kevin-j-morse) wrote :

This bug is the single most frustrating aspect of managing or helping others manage Ubuntu Server installations.

I've come across probably 20 or 30 default installations of Ubuntu Server that have this problem because the new packages seem to get automatically downloaded but the old ones don't get automatically cleaned out.

Can one setup a cron job to do apt-get autoremove every day or is this bad practice?

Revision history for this message
markling (markling) wrote :
Download full text (6.9 KiB)

This is still happening.

I can't stress enough what an incredible hinderance it is to the working day when your system starts crashing and you have to do the updates but the updates won't work because you have first to remove old kernel images your OS has not cleaned up.

So I go trapsing after the instructions to do this manually again.

It looks like I have to manually remove 19 kernel images before I can install my updates and get back on with my work.

Here's the kernel images Xubuntu has left me to clean up:

---------------------------------------------------------------------------------------------------------------------------------------

~$ dpkg --list | grep linux-image
rc linux-image-3.5.0-27-generic 3.5.0-27.46 amd64 Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc linux-image-3.5.0-28-generic 3.5.0-28.48 amd64 Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc linux-image-3.8.0-19-generic 3.8.0-19.30 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
rc linux-image-3.8.0-23-generic 3.8.0-23.34 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
rc linux-image-3.8.0-25-generic 3.8.0-25.37 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii linux-image-3.8.0-26-generic 3.8.0-26.38 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii linux-image-3.8.0-27-generic 3.8.0-27.40 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii linux-image-3.8.0-29-generic 3.8.0-29.42 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii linux-image-3.8.0-30-generic 3.8.0-30.44 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii linux-image-3.8.0-31-generic 3.8.0-31.46 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
rc linux-image-extra-3.5.0-27-generic 3.5.0-27.46 amd64 Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc linux-image-extra-3.5.0-28-generic 3.5.0-28.48 amd64 Linux kernel image for version 3.5.0 on 64 bit x86 SMP
rc linux-image-extra-3.8.0-19-generic 3.8.0-19.30 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
rc linux-image-extra-3.8.0-25-generic 3.8.0-25.37 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii linux-image-extra-3.8.0-26-generic 3.8.0-26.38 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii linux-image-extra-3.8.0-27-generic 3.8.0-27.40 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii linux-image-extra-3.8.0-29-generic 3.8.0-29.42 amd64 Linux kernel image for versio...

Read more...

Revision history for this message
markling (markling) wrote :

The name of this error is unhelpful.

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

It should be:

"software updater preventing installing updates by rubbish heap of old kernel images"

or

"ubuntu should clean up its discarded kernel images automatically because they stop software updates from working"

Revision history for this message
markling (markling) wrote :

So here's the scenario:

. Thunar crashed out again when I was in the middle of some work.
. Software upates have been waiting for a week because they won't install until I manually remove my operating system's discarded kernel images
. So I stop work to install the updates but there are 19 discarded kernel images
. I need to remove each of these 19 kernel images by hand
. Work is really pressured at the moment. I can't spare the time
. I don't have a choice because the updates won't install and Thunar keeps crashing.

Revision history for this message
PiG Pong (pig-c) wrote :

"sudo apt-get autoremove" works for me.

Thanks!

Revision history for this message
Redoubts (redoubts) wrote :

Note that the autoremove trick won't work for kernels installed before a fix was released.
https://bugs.launchpad.net/ubuntu/precise/+source/aptitude/+bug/923876/comments/45

You can make the tedium of manual removal slightly easier with curly-braces. The following would expand into several packages:
apt-get remove linux-image-extra-3.8.0-{19,23,24,25,etc.}-generic # please verify numbers before running

Also note that you have a few 3.5 kernels (eg 3.5.0-28-generic) along with your 3.8 kernels, which may appear to be newer, even thought they are less relevant now.

It's a shame they placed your carburetor behind the timing belt.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in wine (Ubuntu):
status: New → Confirmed
no longer affects: wine (Ubuntu)
affects: initramfs-tools (Ubuntu) → initramfs-tools-ubuntu-touch (Ubuntu)
affects: initramfs-tools-ubuntu-touch (Ubuntu) → initramfs-tools (Ubuntu)
Revision history for this message
David Burrows (d-m123) wrote :

I need help with Ubuntu and Skip ,downloads etc.

Revision history for this message
Andreas Kostyrka (andreas-kostyrka) wrote :

@Mark Russell:

Does booting via grub from an encrypted filesystem include handling lvm (including multiple PVs), raid devices, and so on?

Norbert (nrbrtx)
tags: added: precise trusty
Revision history for this message
Mick (4mer-sin-r) wrote :

I'm kinda new at this. Do I understand you to be saying that, in order to free up space on my hdd, I can safely delete such items from my /boot file as abi 3.11.0-17-generic and abi 3.11.0-19-generic if abi 3.11.0-24-generic has been installed?

Revision history for this message
T Gates (tgates-t) wrote :

Don't delete them all just a few of the oldest ones. It will only free space for your /boot ..
df- H will show /boot free space. Once you free up some room on the /boot you can run "sudo apt-get autoremove"

Changed in initramfs-tools (Ubuntu):
status: Triaged → Incomplete
Changed in initramfs-tools:
status: New → Incomplete
Changed in initramfs-tools (Ubuntu):
status: Incomplete → Triaged
Changed in initramfs-tools:
status: Incomplete → Confirmed
Kamal Wanas (kamalwanas)
Changed in initramfs-tools:
assignee: nobody → Kamal Wanas (kamalwanas)
status: Confirmed → Fix Committed
Changed in initramfs-tools (Ubuntu):
status: Triaged → Fix Committed
Richard Hansen (rhansen)
Changed in initramfs-tools:
assignee: Kamal Wanas (kamalwanas) → nobody
status: Fix Committed → Confirmed
Changed in initramfs-tools (Ubuntu):
status: Fix Committed → Confirmed
Revision history for this message
Bill Meier (wmeier) wrote :

I don't know which kernals are okayu to delete. I have had update problems before where I was told to delete old, or unused kernals. I would do this if I could tell which ones to delete.

Kamal Wanas (kamalwanas)
Changed in initramfs-tools:
status: Confirmed → Fix Released
Changed in initramfs-tools (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Jonathan Harker (jesusaurus) wrote :

Is there a reason update-initramfs can't calculate it's needed space and compare with available space before trying to make an initrd image?

felix (abnercontreras11)
affects: initramfs-tools (Ubuntu) → cloud-initramfs-tools (Ubuntu)
Richard Hansen (rhansen)
affects: cloud-initramfs-tools (Ubuntu) → initramfs-tools (Ubuntu)
Changed in initramfs-tools (Ubuntu):
status: Fix Released → Triaged
felix (abnercontreras11)
Changed in initramfs-tools (Ubuntu):
status: Triaged → Incomplete
status: Incomplete → Confirmed
status: Confirmed → Incomplete
William Grant (wgrant)
Changed in initramfs-tools (Ubuntu):
status: Incomplete → Triaged
vanvan (bartel-vanessa)
Changed in initramfs-tools:
assignee: nobody → vanvan (bartel-vanessa)
Richard Hansen (rhansen)
Changed in initramfs-tools:
assignee: vanvan (bartel-vanessa) → nobody
Javier Arias (jareche1)
Changed in initramfs-tools (Ubuntu):
assignee: nobody → Javier Arias (jareche1)
affects: initramfs-tools → ubuntu
Richard Hansen (rhansen)
affects: ubuntu → initramfs-tools
affects: initramfs-tools → null-and-void
Changed in initramfs-tools:
status: New → Confirmed
Changed in initramfs-tools (Ubuntu):
assignee: Javier Arias (jareche1) → nobody
aurelio76 (oskarbronski)
Changed in initramfs-tools (Ubuntu):
assignee: nobody → aurelio76 (oskarbronski)
Changed in initramfs-tools (Ubuntu):
assignee: aurelio76 (oskarbronski) → nobody
Lucy (lucy8711)
Changed in initramfs-tools (Ubuntu):
status: Triaged → Incomplete
Richard Hansen (rhansen)
Changed in initramfs-tools (Ubuntu):
status: Incomplete → Confirmed
omesalim (omesalim)
Changed in initramfs-tools (Ubuntu):
assignee: nobody → omesalim (omesalim)
Csaba (antalcsaba)
affects: null-and-void → ubuntu
Changed in ubuntu:
assignee: nobody → PcB (pc-t)
Taluk (terlukropuk23)
Changed in initramfs-tools:
assignee: nobody → Taluk (terlukropuk23)
Csaba (antalcsaba)
Changed in initramfs-tools:
assignee: Taluk (terlukropuk23) → nobody
Luke Faraone (lfaraone)
no longer affects: ubuntu
Changed in initramfs-tools (Ubuntu):
assignee: omesalim (omesalim) → nobody
Ads20000 (ads20000)
description: updated
Changed in initramfs-tools:
status: Confirmed → Fix Released
Changed in initramfs-tools (Ubuntu):
status: Confirmed → Fix Released
Changed in initramfs-tools (Ubuntu):
assignee: nobody → PIAOWAKA WINDWOLF (wayshowerwolf)
Changed in initramfs-tools (Ubuntu):
assignee: PIAOWAKA WINDWOLF (wayshowerwolf) → nobody
status: Fix Released → Triaged
Joe (jrhodgeneo74)
Changed in initramfs-tools:
assignee: nobody → Joe (jrhodgeneo74)
Richard Hansen (rhansen)
Changed in initramfs-tools:
assignee: Joe (jrhodgeneo74) → nobody
no longer affects: initramfs-tools
Changed in initramfs-tools:
status: New → Confirmed
Changed in initramfs-tools:
status: Confirmed → New
Changed in initramfs-tools (Ubuntu):
status: Triaged → Confirmed
Changed in initramfs-tools (Ubuntu):
assignee: nobody → Kishor Kansara (kansarakishor)
Changed in initramfs-tools (Ubuntu):
assignee: Kishor Kansara (kansarakishor) → nobody
status: Confirmed → Triaged
Changed in initramfs-tools (Ubuntu):
assignee: nobody → Kishor Kansara (kansarakishor)
Richard Hansen (rhansen)
Changed in initramfs-tools (Ubuntu):
assignee: Kishor Kansara (kansarakishor) → nobody
Changed in initramfs-tools:
status: New → Confirmed
Changed in initramfs-tools:
assignee: nobody → Timothy Ricks (timothy-ricks)
Luke Faraone (lfaraone)
Changed in initramfs-tools:
assignee: Timothy Ricks (timothy-ricks) → nobody
Luke Faraone (lfaraone)
Changed in initramfs-tools (Ubuntu):
assignee: nobody → Luke Faraone (lfaraone)
status: Triaged → In Progress
Changed in initramfs-tools (Ubuntu):
assignee: Luke Faraone (lfaraone) → Boguslav Vantola (b-vantola)
Jarno Suni (jarnos)
description: updated
Luke Faraone (lfaraone)
Changed in initramfs-tools (Ubuntu):
assignee: Boguslav Vantola (b-vantola) → Luke Faraone (lfaraone)
Changed in initramfs-tools:
assignee: nobody → Kishor Kansara (kansarakishor)
Changed in initramfs-tools:
assignee: Kishor Kansara (kansarakishor) → nobody
Changed in initramfs-tools (Ubuntu):
assignee: Luke Faraone (lfaraone) → nobody
sauro peña (sauropm)
Changed in initramfs-tools:
assignee: nobody → sauro peña (sauropm)
Luke Faraone (lfaraone)
Changed in initramfs-tools (Ubuntu):
assignee: nobody → Luke Faraone (lfaraone)
Changed in initramfs-tools:
assignee: sauro peña (sauropm) → nobody
Jarno Suni (jarnos)
description: updated
gintassi (gintassi)
Changed in initramfs-tools:
assignee: nobody → gintassi (gintassi)
Changed in initramfs-tools (Ubuntu):
assignee: Luke Faraone (lfaraone) → gintassi (gintassi)
Luke Faraone (lfaraone)
Changed in initramfs-tools:
assignee: gintassi (gintassi) → nobody
Changed in initramfs-tools (Ubuntu):
assignee: gintassi (gintassi) → Luke Faraone (lfaraone)
Changed in initramfs-tools:
status: Confirmed → Incomplete
status: Incomplete → Opinion
William Grant (wgrant)
Changed in initramfs-tools:
status: Opinion → Confirmed
Adam Conrad (adconrad)
Changed in dpkg (Ubuntu):
status: New → Invalid
Jarno Suni (jarnos)
description: updated
summary: - update-initramfs should produce a more helpful error when there isn't
- enough free space
+ update-initramfs should produce a more helpful error message when there
+ isn't enough free space
121 comments hidden view all 201 comments
Revision history for this message
rocky220 (rocky220) wrote : Re: update-initramfs should produce a more helpful error message when there isn't enough free space

yes I relize now my second partition was no large enough, thanks
  Tibor

Revision history for this message
Vonschutter (stephan-schutter) wrote :

This is a critical error as it will result in kernel security updates not being applied. Less than 1% of users are able to resolve this issue on their own and will likely continue to operate unprotected.

Revision history for this message
Sebastian Nohn (sebastian-nohn) wrote :

dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r | cut -d- -f-2) | xargs sudo apt-get -y purge

Revision history for this message
Jason Mast (jmast1) wrote :

While it is helpful for new users to have to google shell commands and identify solutions to problems, this simply occurs too often. The solution is the same every time. It is repetitive and annoying,

the script could store the new and old information in different locations to avoid the lack of space, the boot could be made larger by default, options could be presented to the user rather than simply failing, backup information for old kernals could be stored elsewhere (and only the most recent moved to boot for compatibility) ... etc.

a sample dialog would be
"there is not enough space for the boot information, there are too many items being retained in /boot, but it is strongly suggested that you maintain some backup kernals as updates can cause issues with new or old hardware. Please choose the number of old backups to maintain and the frequency with which they should be replaced"
then have a dialog that lists options like (daily weekly monthly yearly and no backups) and an option to store them tarred in another location that does not fill up ... also it should list the size of the individual groups of files (by date) ... and it should explain that this is a kernal backup not a file backup

also boot should be bigger

and there should be a semipermanent configuration change listed on the forum rather than the delete old kernals solution - which is just a bandaid in that you will just have to repeatedly do it, because sometimes i just want to turn the thing on and play minecraft (and my timesink of choice is not system administration)

Anyway,the point of "automatic updates" is they happen automatically, and you dont have to mess with them, this bug forces you to mess with them

Revision history for this message
Bill Meier (wmeier) wrote : Re: [Bug 798414] Re: update-initramfs should produce a more helpful error message when there isn't enough free space

I still think a simpler solution, one that all users, novice or newbie,
could use is a GUI that lists the pertinent information and allows
deletion of any older and unused kernels. This may offend some purists,
but to me, the idea is to make linux easy to use and maintain for those
that finally make the break from MicroSoft..

On 07/12/2017 02:14 PM, Jason Mast wrote:
> While it is helpful for new users to have to google shell commands and
> identify solutions to problems, this simply occurs too often. The
> solution is the same every time. It is repetitive and annoying,
>
> the script could store the new and old information in different
> locations to avoid the lack of space, the boot could be made larger by
> default, options could be presented to the user rather than simply
> failing, backup information for old kernals could be stored elsewhere
> (and only the most recent moved to boot for compatibility) ... etc.
>
> a sample dialog would be
> "there is not enough space for the boot information, there are too many items being retained in /boot, but it is strongly suggested that you maintain some backup kernals as updates can cause issues with new or old hardware. Please choose the number of old backups to maintain and the frequency with which they should be replaced"
> then have a dialog that lists options like (daily weekly monthly yearly and no backups) and an option to store them tarred in another location that does not fill up ... also it should list the size of the individual groups of files (by date) ... and it should explain that this is a kernal backup not a file backup
>
> also boot should be bigger
>
> and there should be a semipermanent configuration change listed on the
> forum rather than the delete old kernals solution - which is just a
> bandaid in that you will just have to repeatedly do it, because
> sometimes i just want to turn the thing on and play minecraft (and my
> timesink of choice is not system administration)
>
> Anyway,the point of "automatic updates" is they happen automatically,
> and you dont have to mess with them, this bug forces you to mess with
> them
>

Tikshala (tikshala917)
Changed in initramfs-tools (Ubuntu):
assignee: Luke Faraone (lfaraone) → nobody
status: In Progress → Incomplete
Changed in initramfs-tools (Ubuntu):
status: Incomplete → Confirmed
status: Confirmed → Incomplete
Steve Langasek (vorlon)
Changed in initramfs-tools (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Jarno Suni (jarnos) wrote : Re: update-initramfs should produce a more helpful error message when there isn't enough free space

I think the patch presented at https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1678187/comments/8
might give more helpful error message, since it avoids filling /boot as long as possible, thus the system is unlikely to run out of space while running mkinitramfs, but finds out, if the system lacks free space, and if it does, it tells the URL of the documentation page concerning removing old kernels.

P.S. The URL could be https://help.ubuntu.com/community/LowDiskOnBoot alternatively. (Luke W Faraone uses that in his merge proposal, and it redirects to the same document currently.)

Revision history for this message
Jarno Suni (jarnos) wrote :

Marked as invalid against Software Updater (i.e. update-manager) since there is a separate report for it: Bug #1460396

Changed in update-manager:
status: New → Invalid
Revision history for this message
Jarno Suni (jarnos) wrote :

Similarly, it would be great, if unattended-upgrade, apt and whatnot package tool software could predict that the requested install will not fit in system and act accordingly. Then the error in post-installation script would not happen then. The size could be hard to know in general case. If I have understood correctly, Software Updater uses information about older kernels as basis for calculating such a limit.

lizehao (lllwonder)
Changed in initramfs-tools (Ubuntu):
assignee: nobody → lizehao (lllwonder)
Revision history for this message
Jarno Suni (jarnos) wrote :

/boot may become full already in unpacking stage when installing a new kernel by dpkg. I think the error message could be more helpful in that case, too. The following video demonstrates such a case. It also demonstrates how the aforementioned linux-purge script can be used to fix system
https://youtu.be/gozw6A3qwCY

Revision history for this message
Jarno Suni (jarnos) wrote :

Another example where /boot gets full even before running update-initramfs:
https://askubuntu.com/q/946875/21005

affects: update-manager → software-center
Revision history for this message
Thomas Schweikle (tps) wrote :

Ubuntu keeps to many old kernel-images and initrd within /boot. Space is exausted and it fails to delete old unused kernels before creating a new initrd failing building an initrd for the newly installed kernel.

A workaround is to delete all old unused kernels and then try it again. It will succeed.

Deon Joubert (02deon-j)
Changed in initramfs-tools (Ubuntu):
assignee: lizehao (lllwonder) → Deon Joubert (02deon-j)
Revision history for this message
Said Bakr (said-fox) wrote :

The problem message stated that /boot has no enough free space and by checking the partition with Disk Usage Analyzer it states that free space is 6.6 MB only.

After using sudo apt-get autoremove --purge as suugested in https://help.ubuntu.com/community/RemoveOldKernels , it becomes 137.9 MB free.

Revision history for this message
Steve Holton (sph0lt0n) wrote :

IMPACT:

Some systems report the problem detected (requesting a bug report andtriggering a visit to this page) even when /boot has available free space:

sholton@sholton-VirtualBox:~$ df -H /boot
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 487M 127M 330M 28% /boot

sholton@sholton-VirtualBox:~$ sudo apt autoremove --purge
[sudo] password for sholton:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Is there a related bug which indicates a system problem even when the original problem has been corrected?

Revision history for this message
Timo Collinger (timo-collinger) wrote :

I am not up-to high level changes/updates , it's "Beyond" my capabilities.

Revision history for this message
Jarno Suni (jarnos) wrote :

Steve Holton, maybe you are using Ubuntu 14.04 and have some manually installed kernels, see Bug #1089195.
Do updated instructions at https://help.ubuntu.com/community/RemoveOldKernels help to fix your system? (I suggest trying linux-purge, which I have written.)

Changed in initramfs-tools:
status: Confirmed → Incomplete
status: Incomplete → Opinion
Colin Watson (cjwatson)
Changed in initramfs-tools:
status: Opinion → Confirmed
Changed in initramfs-tools (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Scott Alan Barker (barkerir) wrote : Re: [Bug 798414] Re: update-initramfs should produce a more helpful error message when there isn't enough free space

 UBUNTU I DON'T use that system anymore 4 or 5 years ago I'M TIRED of having headaches. Keep your BUGZILLA  & WORMS with you. HaHa    On Wednesday, December 27, 2017, 9:09:59 AM EST, <email address hidden> <email address hidden> wrote:

 ** Changed in: initramfs-tools (Ubuntu)
      Status: Confirmed => Fix Released

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/798414

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

Status in initramfs-tools:
  Confirmed
Status in Ubuntu Software Center:
  Invalid
Status in dpkg package in Ubuntu:
  Invalid
Status in initramfs-tools package in Ubuntu:
  Fix Released

Bug description:
  Binary package hint: initramfs-tools

  When installing a kernel, /boot may become full during execution of
  post-installation script typically when update-initramfs is creating
  or updating an initrd.img file. This is resulting in kernel
  installation error.  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

  Ideal behavior:

  Give a more helpful error message when this unfortunate situation
  occurs so that user can fix the broken system and keep it going.

  Workaround:

  As the bug reporting system forwards user to this bug report, such instructions can be given here:
  https://help.ubuntu.com/community/RemoveOldKernels

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

Revision history for this message
natalieaoneal (natalieaoneal) wrote : Re: update-initramfs should produce a more helpful error message when there isn't enough free space

/boot was full, so I moved one file 'initrd.img-4.10.0-27-generic' from /boot to /tmp and ran:

sudo apt autoremove

This prompted the crash that I reported.

Revision history for this message
natalieaoneal (natalieaoneal) wrote :

Added note: sudo apt install byobu;sudo purge-old-kernels
seems to be resolving the /boot space issue.

Revision history for this message
Thomas Schweikle (tps) wrote :

The boot space problem is not resolved by purge-old-kernels, since this command does not remove old initrd from kernels not installed any more. purge-old-kernels shall remove any initrd from kernels it removes!

Revision history for this message
liz Phillips (iamliz-phillips-z) wrote : Emails

Is there a way of unsubscribing from the emails ? I am afraid they are way
beyond my ability level, but I cannot unsubscribe from the emails.
Thank you in advance!
Liz Phillips

Revision history for this message
pwaring (launchpad-pwaring) wrote : Re: update-initramfs should produce a more helpful error message when there isn't enough free space

Liz: There are two options towards the top-right of the page, underneath the list of bug duplicates:

Mute bug mail - Click this to stop any emails from this bug (you'll remain subscribed so it will show in your list of bugs on Launchpad)

Edit bug mail - Click this to control which emails you get, e.g. you can stop getting comments but continue to be notified of changes to the bug status.

Revision history for this message
liz Phillips (iamliz-phillips-z) wrote : Re: [Bug 798414] Re: update-initramfs should produce a more helpful error message when there isn't enough free space

Many thanks!
Liz

On 27 Feb 2018 11:57, "pwaring" <email address hidden> wrote:

Liz: There are two options towards the top-right of the page, underneath
the list of bug duplicates:

Mute bug mail - Click this to stop any emails from this bug (you'll
remain subscribed so it will show in your list of bugs on Launchpad)

Edit bug mail - Click this to control which emails you get, e.g. you can
stop getting comments but continue to be notified of changes to the bug
status.

--
You received this bug notification because you are subscribed to a
duplicate bug report (733765).
https://bugs.launchpad.net/bugs/798414

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

Status in initramfs-tools:
  Confirmed
Status in Ubuntu Software Center:
  Invalid
Status in dpkg package in Ubuntu:
  Invalid
Status in initramfs-tools package in Ubuntu:
  Fix Released

Bug description:
  Binary package hint: initramfs-tools

  When installing a kernel, /boot may become full during execution of
  post-installation script typically when update-initramfs is creating
  or updating an initrd.img file. This is resulting in kernel
  installation error. 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

  Ideal behavior:

  Give a more helpful error message when this unfortunate situation
  occurs so that user can fix the broken system and keep it going.

  Workaround:

  As the bug reporting system forwards user to this bug report, such
instructions can be given here:
  https://help.ubuntu.com/community/RemoveOldKernels

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

Revision history for this message
Jarno Suni (jarnos) wrote : Re: update-initramfs should produce a more helpful error message when there isn't enough free space

natalieaoneal, in Artful purge-old-kernels simply runs "sudo apt-get autoremove". See Bug #1686138

Changed in initramfs-tools:
assignee: nobody → Raul Benalcazar (raulbenalcazar24)
Revision history for this message
M G (mgudarzi) wrote :

I just cleaned up my /boot (old kernels and stuff) and Baaaang! worked like a charm.

Revision history for this message
Jarno Suni (jarnos) wrote :

M G, which method you used?

Revision history for this message
Indraneel Basu Majumdar (indraneel-bm) wrote :

this is still too difficult for a newbie to linux with no programming expertise to understand and apply: can it be made simpler by version as to what commands do we need to execute and what steps do we need to take. Thank you for your understanding

Revision history for this message
M G (mgudarzi) wrote :

check /boot to see what are your old kernels that you're not necessarily using. the system keeps two latest kernels. so if you're upgrading your kernel to 4.13.0-38, you don't need 4.13.0-36 or older anymore( unless you want a specific kernel for testing or something ), so you can delete em.

/boot$[sudo] rm -rf *4.13.0-36 (or older ones, depending on what you have **don't delete the ones you use or need**)

after that:

sudo apt-get update && sudo apt-get dist-upgrade

sudo apt-get auto remove

these should do it.

please be careful with rm -rf(it can be pretty devastating if you type wrong things in there)

Revision history for this message
M G (mgudarzi) wrote :

oh, you the correct first command is :
/boot$[sudo] rm -rf *4.13.0-36*
(or older ones, depending on what you have **really, don't delete the ones you use or need**)

Lensmarket (lensmarket)
Changed in initramfs-tools (Ubuntu):
assignee: Deon Joubert (02deon-j) → nobody
Changed in initramfs-tools (Ubuntu):
assignee: nobody → Colin Underhill (daisybank)
Tex Arcana (tex.arcana)
summary: update-initramfs should produce a more helpful error message when there
- isn't enough free space
+ isn't enough free space--or provide an automatic tool for removal of
+ old files
Revision history for this message
Tex Arcana (tex.arcana) wrote :
Download full text (19.2 KiB)

I just ran into this bug, tried a suggestion from here (https://askubuntu.com/questions/89710/how-do-i-free-up-more-space-in-boot) which resulted in multiple errors, and me being sent here.

It seems to me that this should be taken care of automatically by the kernel with the upgrading process.

========================================================
Terminal output of the above suggested method:
========================================================

XXXXXXXXXX@XXXXXXXXXXX-System-Product-NameXXXXXXXXX-XXX:~$ uname -r
4.15.0-29-generic
XXXXXXXXXX@XXXXXXXXXXX-System-Product-NameXXXXXXXXXX-XXX:~$ dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]'
linux-headers-4.13.0-36
linux-headers-4.13.0-36-generic
linux-headers-4.13.0-38
linux-headers-4.13.0-38-generic
linux-headers-4.13.0-39
linux-headers-4.13.0-39-generic
linux-headers-4.13.0-45
linux-headers-4.13.0-45-generic
linux-headers-4.15.0-24
linux-headers-4.15.0-24-generic
linux-headers-4.15.0-30
linux-headers-4.15.0-30-generic
linux-image-4.13.0-36-generic
linux-image-4.13.0-38-generic
linux-image-4.13.0-39-generic
linux-image-4.13.0-45-generic
linux-image-4.15.0-24-generic
linux-image-4.15.0-30-generic
XXXXXXXXX@XXXXXXXXX-System-Product-NameXXXXXXXXXXXX-XXX:~$ dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge
[sudo] password for XXXXXXXXXXXXXXX:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool libllvm5.0 libllvm5.0:i386
  linux-modules-4.15.0-24-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  linux-generic-hwe-16.04* linux-headers-4.13.0-36*
  linux-headers-4.13.0-36-generic* linux-headers-4.13.0-38*
  linux-headers-4.13.0-38-generic* linux-headers-4.13.0-39*
  linux-headers-4.13.0-39-generic* linux-headers-4.13.0-45*
  linux-headers-4.13.0-45-generic* linux-headers-4.15.0-24*
  linux-headers-4.15.0-24-generic* linux-headers-4.15.0-30*
  linux-headers-4.15.0-30-generic* linux-headers-generic-hwe-16.04*
  linux-image-4.13.0-36-generic* linux-image-4.13.0-38-generic*
  linux-image-4.13.0-39-generic* linux-image-4.13.0-45-generic*
  linux-image-4.15.0-24-generic* linux-image-4.15.0-30-generic*
  linux-image-extra-4.13.0-36-generic* linux-image-extra-4.13.0-38-generic*
  linux-image-extra-4.13.0-39-generic* linux-image-extra-4.13.0-45-generic*
  linux-image-generic-hwe-16.04* linux-modules-extra-4.15.0-24-generic*
  linux-modules-extra-4.15.0-30-generic*
0 upgraded, 0 newly installed, 27 to remove and 13 not upgraded.
After this operation, 1,830 MB disk space will be freed.
(Reading database ... 424923 files and directories currently installed.)
Removing linux-generic-hwe-16.04 (4.15.0.30.52) ...
Removing linux-headers-4.13.0-36-generic (4.13.0-36.40~16.04.1) ...
Removing linux-headers-4.13.0-36 (4.13.0-36.40~16.04.1) ...
Removing linux-headers-4.13.0-38-generic (4.13.0-38.43~16.04.1) ...
Removing linux-...

Revision history for this message
Jarno Suni (jarnos) wrote :

Tex, the command you used failed because of Bug #1678187. However it succeeded to purge many kernels and related packages. But package linux-image-extra-4.13.0-36-generic was not successfully purged technically. What does command 'dpkg -l linux-image-extra-4.13.0-36-generic' print? Anyway, you can now purge the package by 'sudo dpkg --purge linux-image-extra-4.13.0-36-generic', right?

I suppose your original command purged too many packages, as it removed the linux-generic-hwe-16.04 package. You may reinstall it by 'sudo apt-get install --install-recommends linux-generic-hwe-16.04', if you want to continue to get newer kernels via updates. (https://wiki.ubuntu.com/Kernel/LTSEnablementStack#Ubuntu_16.04_LTS_-_Xenial_Xerus)

Changed in initramfs-tools:
status: Confirmed → Fix Released
affects: initramfs-tools → ubuntu
Changed in ubuntu:
assignee: Raul Benalcazar (raulbenalcazar24) → tim fiedler (8churchill1992)
Revision history for this message
C W (cwoooodruf) wrote :

The default boot partition size in Ubuntu 16 is way too small so having some way to remove the oldest kernel is required I think. Its very hard to change it once the disk is in use.

Julio Decima (j10a)
Changed in initramfs-tools (Ubuntu):
assignee: Colin Underhill (daisybank) → Julio Decima (j10a)
BlaWhickte (blawhickte)
Changed in initramfs-tools (Ubuntu):
assignee: Julio Decima (j10a) → BlaWhickte (blawhickte)
Revision history for this message
Jarno Suni (jarnos) wrote :

cwoooodruf, luckily, there are some ways.

Revision history for this message
BlaWhickte (blawhickte) wrote : Re: [Bug 798414] Re: update-initramfs should produce a more helpful error message when there isn't enough free space--or provide an automatic tool for removal of old files

THANKS FOR YOUR REPLIED. IT WAS FIXED

Jarno Suni <email address hidden> 于2019年1月1日周二 下午8:39写道:

> cwoooodruf, luckily, there are some ways.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/798414
>
> Title:
> update-initramfs should produce a more helpful error message when
> there isn't enough free space--or provide an automatic tool for
> removal of old files
>
> Status in initramfs-tools:
> New
> Status in Ubuntu Software Center:
> Invalid
> Status in Ubuntu:
> Fix Released
> Status in dpkg package in Ubuntu:
> Invalid
> Status in initramfs-tools package in Ubuntu:
> Fix Released
>
> Bug description:
> Binary package hint: initramfs-tools
>
> When installing a kernel, /boot may become full during execution of
> post-installation script typically when update-initramfs is creating
> or updating an initrd.img file. This is resulting in kernel
> installation error. 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
>
> Ideal behavior:
>
> Give a more helpful error message when this unfortunate situation
> occurs so that user can fix the broken system and keep it going.
>
> Workaround:
>
> As the bug reporting system forwards user to this bug report, such
> instructions can be given here:
> https://help.ubuntu.com/community/RemoveOldKernels
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/initramfs-tools/+bug/798414/+subscriptions
>

Revision history for this message
Mathew Hodson (mhodson) wrote :

A better fix for this issue is available in Bionic and later and also backported to Xenial with bug 1675079.

unattended-upgrades and update-manager will now remove unused kernel packages when there are other updates to be installed.

I'm closing this initramfs-tools task since a fix specifically for this initramfs-tools package isn't needed now.

Changed in initramfs-tools (Ubuntu):
assignee: BlaWhickte (blawhickte) → nobody
status: Fix Released → Won't Fix
no longer affects: dpkg (Ubuntu)
no longer affects: ubuntu
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
Mathew Hodson (mhodson)
affects: initramfs-tools → ubuntu
no longer affects: ubuntu
affects: software-center → ubuntu
no longer affects: ubuntu
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/798414

tags: added: iso-testing
1 comments hidden view all 201 comments
Revision history for this message
Raghvendra Giri (crusader5) wrote :

The solution is listed in ubuntu documentation.

first check space of /boot

>: df -h

>: sudo apt-get autoremove

this should freeup some space and 90% times this will resolve your issue.

if you have manually installed and still the old files are not purged follow the link below

https://help.ubuntu.com/community/RemoveOldKernels

this still works for ubunt 22.04 /boot folder issues resolution, cleaning /boot folder removing older files

Revision history for this message
Raghvendra Giri (crusader5) wrote :

If you are doing manual partitioning keep at least 1gb space for /boot partition.
update for above post

Displaying first 40 and last 40 comments. View all 201 comments or add a comment.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.