So I’ve been trying to update/upgrade my system/applications for the last few days and it has been erroring, I ignored it and now when I try to sudo apt upgrade it tells me that I have “Low Disk Space on “boot” The volume “boot” has only 0 bytes disk space remaining.”

What happens when I run sudo apt upgrade:

user@user:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.187.25) ...
update-initramfs: Generating /boot/initrd.img-5.11.0-43-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/data-swap)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.11.0-43-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
Setting up linux-image-5.11.0-44-generic (5.11.0-44.48~20.04.2) ...
I: /boot/initrd.img.old is now a symlink to initrd.img-5.11.0-44-generic
Setting up linux-image-5.11.0-46-generic (5.11.0-46.51~20.04.1) ...
I: /boot/initrd.img is now a symlink to initrd.img-5.11.0-46-generic
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.11.0-43-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/data-swap)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.11.0-43-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.11.0-44-generic (5.11.0-44.48~20.04.2) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.11.0-44-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/data-swap)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.11.0-44-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.11.0-44-generic (--configure):
 installed linux-image-5.11.0-44-generic package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.11.0-46-generic (5.11.0-46.51~20.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.11.0-46-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/data-swap)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.11.0-46-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.11.0-46-generic (--configure):
 installed linux-image-5.11.0-46-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-firmware
 initramfs-tools
 linux-image-5.11.0-44-generic
 linux-image-5.11.0-46-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Screenshot of /boot:

I am running elementary OS 6.1 Jólnir, built on Ubuntu 20.04.3 LTS using the Linux kernel 5.11.0-43-generic.

Kromonos
admin
link
15d

Have you tried apt autoremove to clean up old packages?

明-3 NOMAD
creator
link
05d

Yes, it gives an error very similar to running sudo apt upgrade, in fact running this command is what triggers the “Low Disk Space on “boot”” warning.

user@user:/$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.187.25) ...
update-initramfs: Generating /boot/initrd.img-5.11.0-43-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/data-swap)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.11.0-43-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
Setting up linux-image-5.11.0-44-generic (5.11.0-44.48~20.04.2) ...
I: /boot/initrd.img.old is now a symlink to initrd.img-5.11.0-44-generic
Setting up linux-image-5.11.0-46-generic (5.11.0-46.51~20.04.1) ...
I: /boot/initrd.img is now a symlink to initrd.img-5.11.0-46-generic
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.11.0-43-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/data-swap)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.11.0-43-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.11.0-44-generic (5.11.0-44.48~20.04.2) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.11.0-44-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/data-swap)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.11.0-44-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.11.0-44-generic (--configure):
 installed linux-image-5.11.0-44-generic package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.11.0-46-generic (5.11.0-46.51~20.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.11.0-46-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/data-swap)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.11.0-46-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.11.0-46-generic (--configure):
 installed linux-image-5.11.0-46-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-firmware
 initramfs-tools
 linux-image-5.11.0-44-generic
 linux-image-5.11.0-46-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Kromonos
admin
link
1
edit-2
5d

You could try apt remove linux-image-5.11.0-43-generic to delete an old kernel manually. Then upgrade and autoremove again.

明-3 NOMAD
creator
link
05d
Removing linux-image-5.11.0-43-generic 

You are running a kernel (version 5.11.0-43-generic) and attempting to remove the same version.                     

This can make the system unbootable as it will remove /boot/vmlinuz-5.11.0-43-generic and all modules under the 

This happens when I run that command, it scares me, will something break? Is it better to expand my boot partition?

@libinator@lemmy.ml
link
04d

What does uname -a output?

明-3 NOMAD
creator
link
14d

Linux device 5.11.0-43-generic #47~20.04.2-Ubuntu SMP Mon Dec 13 11:06:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

@libinator@lemmy.ml
link
2
edit-2
4d

This means you run version 5.11.0-43-generic Try removing linux-image-5.11.0-40-generic, which is the oldest version in your screenshot

明-3 NOMAD
creator
link
13d

Okay, but once I removed what do I do? Because otherwise I will have an OS without its kernel, which is not nice.

@libinator@lemmy.ml
link
32d

That’s not what will happen. Note the version number in my reply. Ubuntu based distros won’t remove old kernels after updating to newer kernels. This is probably what’s taking space in your /boot partition.

In the screenshot you posted, there are 5 kernels:

  • vmlinuz-5.11.0-40-generic
  • vmlinuz-5.11.0-41-generic
  • vmlinuz-5.11.0-43-generic
  • vmlinuz-5.11.0-44-generic
  • vmlinuz-5.11.0-46-generic

But there are only three initramfs images:

  • initrd.img-5.11.0-40-generic
  • initrd.img-5.11.0-41-generic
  • initrd.img-5.11.0-43-generic

It is likely that your boot partition doesn’t have enough space to store the initramfs image for booting kernels 5.11.0-44 and 5.11.0-46. To make enough space, you can remove the old kernels. According to your uname -a output, you are currently running kernel 5.11.0-43. And I assume you have no problem with the current kernel. If that is the case, there is no need for kernel 5.11.0-40 and 5.11.0-41.

So, you can remove the two kernels. Old kernels are probably not removed by default so that you can boot to the previous kernel if the latest kernel has issues. After doing so, reboot to ensure nothing has gone wrong. Now, try sudo apt upgrade again, which should hopefully install the latest kernel and generate its initrd file. Reboot to the newly installed kernel and try sudo apt autoremove to remove any remaining pacakges as @kromonos@fapsi.be suggested

Okay, I ran sudo apt remove linux-image-5.11.0-40 and then it started doing some stuff, from what I remember reading it did something like trying to uninstall kernel 40 but also wanting to reinstall it as soon as it did that, and complain about dependencies. Now my PC is bricked, I try to boot it and it doesn’t let me decrypt my machine so it stays in boot menu frozen even though it gives me two choices. Before that I can choose advanced settings from where I can choose which kernel to run my machine, but it just gives me this error:

krolden
link
12d

You didn’t make the new initrd so its trying to look for a kernel that isn’t there. Boot to a lived and unlock the disk with cryptsetup and mount, then chroot into your install and rerun update-initramfs and clear out your old kernels in /boot. If that doesn’t work, backup all your files and reinstall unless you wanna continue down this rabbit hole of recovering a broke install.

You won’t like hearing this but breaking your install is just another step in learning what not to do when running a linux system. Its how I learned and how everyone I know learned. Break it and fix it, if it isn’t broke then break it and fix it anyway.

Could you tell me how to chroot? I think I can manage to do the rest by myself. uwu

krolden
link
12d

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

Rule of thumb is to read the docs first, ask questions last.

Okay, I managed to chroot, now I don’t understand the part where I reinstall initramfs and clear the old kernels in /boot. Am I supossed to run sudo apt update initramfs and then delete all the kernel files in /boot that are previous to the linux-image-5.11.0-43 which is the one I’m using?

@libinator@lemmy.ml
link
11d

sudo update-initramfs

Don’t delete any kernels (vmlinuz-*) or initrd images (initrd.img-*), just to ensure nothing bad happens again. And, after updating the initramfs, run sudo update-grub. If you can boot into a livecd, could you post a screenshot of everything in /boot like you did in the original post?

I dont have a backup of my passwords so now im on another pc with another lemmy ccount

@libinator@lemmy.ml
link
24d

sudo apt remove linux-image-5.11.0-40-generic

I don’t use a debian based distro now, so you should probably wait until someone else says doing this is safe

krolden
link
05d

Yep either this or expand your boot partition.

Ive sometimes had to boot into a livecd and then delete the old kernel images cos the system wouldn’t boot

明-3 NOMAD
creator
link
05d
Removing linux-image-5.11.0-43-generic 

You are running a kernel (version 5.11.0-43-generic) and attempting to remove the same version.                     

This can make the system unbootable as it will remove /boot/vmlinuz-5.11.0-43-generic and all modules under the 

This happens when I run that command, it scares me, will something break? Is it better to expand my boot partition?

Kromonos
admin
link
1
edit-2
5d

linux-image-5.11.0-43-generic

I’ve seen linux-image-5.11.0-40-generic and linux-image-5.11.0-41-generic too. You could try with these one first

krolden
link
1
edit-2
5d

You should be OK as long as you rerun apt upgrade and/or update-initramfs so it properly installs the new kernel.

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

  • 0 users online
  • 33 users / day
  • 76 users / week
  • 180 users / month
  • 440 users / 6 months
  • 4 subscribers
  • 773 Posts
  • 2.47K Comments
  • Modlog