Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt-get upgrade on Ubuntu 20.04 box fails because there is not enough space in /boot #294

Open
evgeni opened this issue Jan 26, 2024 · 0 comments

Comments

@evgeni
Copy link
Contributor

evgeni commented Jan 26, 2024

Ohai,

I've tested this on the following boxes, but I think others could be affected too:

  • generic/ubuntu2004 (libvirt, 4.3.10)
  • generic/ubuntu2004 (libvirt, 4.3.12)

When you boot the machine, you see there are at least two kernels installed:

root@ubuntu2004:~# ls /boot/
config-5.4.0-169-generic  grub        initrd.img-5.4.0-169-generic      initrd.img-5.4.0-42-generic      initrd.img.old  System.map-5.4.0-169-generic  vmlinuz                    vmlinuz-5.4.0-42-generic
config-5.4.0-42-generic   initrd.img  initrd.img-5.4.0-169-generic.img  initrd.img-5.4.0-42-generic.img  lost+found      System.map-5.4.0-42-generic   vmlinuz-5.4.0-169-generic  vmlinuz.old

Additionally, the initrds are doubled: initrd.img-5.4.0-169-generic and initrd.img-5.4.0-169-generic.img (and same for -42-). However, the ones ending in .img are not referenced from the grub.cfg at all:

# grep img /boot/grub/grub.cfg 
	initrd	/initrd.img-5.4.0-169-generic
		initrd	/initrd.img-5.4.0-169-generic
		initrd	/initrd.img-5.4.0-169-generic
		initrd	/initrd.img-5.4.0-42-generic
		initrd	/initrd.img-5.4.0-42-generic

Calling apt-get update && apt-get upgrade results in:

Processing triggers for initramfs-tools (0.136ubuntu6.7) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-170-generic
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.4.0-170-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

Calling rm -f /boot/*-generic.img before doing the upgrade cleans up enough space to not break things.

I think two optimizations can be made:

  • Cleaning those .img files (wherever they come from)
  • Shipping the box only with one (latest at build-time) kernel installed
evgeni added a commit to evgeni/forklift that referenced this issue Jan 26, 2024
for some reason /boot contains both initrds with and without .img
even if the ones with are not used, however, as /boot space is limited
they prevent upgrades of packages, failing our pipelines

delete them

we don't really care about new kernels, or rebooting those VMs, but we
care about updated userland, and this prevents it

See lavabit/robox#294 for details
evgeni added a commit to theforeman/forklift that referenced this issue Jan 26, 2024
for some reason /boot contains both initrds with and without .img
even if the ones with are not used, however, as /boot space is limited
they prevent upgrades of packages, failing our pipelines

delete them

we don't really care about new kernels, or rebooting those VMs, but we
care about updated userland, and this prevents it

See lavabit/robox#294 for details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant