devnull.land

Miscellaneous bits and bobs from the tech world

Recovering from a full `/boot` partition

9/28/2021, 10:46:46 PM


I was running a system update when I ran into an odd error message that looked unfamiliar:

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.13.0-7614-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned e
rror exit status 1
Errors were encountered while processing:
 linux-firmware
E: Sub-process /usr/bin/dpkg returned an error code (1)

My immediate go-to was apt -f install, but that returned the same error.

The issue is hinted at with this line: Error 24 : Write error : cannot write compressed block . Web searching revealed that this was due to the destination disk being full.

julian@razorback:~$ df -h
Filesystem             Size  Used Avail Use% Mounted on
udev                   3.4G     0  3.4G   0% /dev
tmpfs                  690M  2.3M  687M   1% /run
/dev/mapper/data-root  224G   80G  134G  38% /
tmpfs                  3.4G   11M  3.4G   1% /dev/shm
tmpfs                  5.0M     0  5.0M   0% /run/lock
tmpfs                  3.4G     0  3.4G   0% /sys/fs/cgroup
/dev/nvme0n1p1         467M  363M   69M  85% /boot                <-- uh-oh
tmpfs                  690M   20K  690M   1% /run/user/110
tmpfs                  690M   32K  690M   1% /run/user/1000

With only 69mb, there wasn't enough free space in /boot to install the newer linux kernel.

Suggestions online recommend removing old kernel images. Find the kernel in use with uname -a, and list installed kernel images with dpkg -l | grep linux-image:

julian@razorback:~$ dpkg -l | grep linux-image
ii  linux-image-5.11.0-7614-generic                  5.11.0-7614.15~1622578982~20.04~383c0a9              amd64        Linux kernel image for version 5.11.0 on 64 bit x86 SMP
ii  linux-image-5.11.0-7620-generic                  5.11.0-7620.21~1626191760~20.04~55de9c3              amd64        Linux kernel image for version 5.11.0 on 64 bit x86 SMP
ii  linux-image-5.13.0-7614-generic                  5.13.0-7614.14~1631647151~20.04~930e87c              amd64        Linux kernel image for version 5.13.0 on 64 bit x86 SMP
ii  linux-image-generic                              5.13.0.7614.14~1631647151~20.04~930e87c              amd64        Generic Linux kernel image

Here, I have two superfluous images. apt remove --purge {image name} will remove the image from the system, and free up space in /boot.

If you are unable to remove the image via apt, go to /boot and move one of the larger files out. In my case, I moved /boot/initrd.img-5.11.0-7614-generic out of /boot and into ~, and the preceding apt commands then worked fine.