Open evgeni opened 5 months ago
Ohai,
I've tested this on the following boxes, but I think others could be affected too:
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:
initrd.img-5.4.0-169-generic
initrd.img-5.4.0-169-generic.img
.img
grub.cfg
# 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:
apt-get update && apt-get upgrade
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.
rm -f /boot/*-generic.img
I think two optimizations can be made:
Ohai,
I've tested this on the following boxes, but I think others could be affected too:
When you boot the machine, you see there are at least two kernels installed:
Additionally, the initrds are doubled:
initrd.img-5.4.0-169-generic
andinitrd.img-5.4.0-169-generic.img
(and same for -42-). However, the ones ending in.img
are not referenced from thegrub.cfg
at all:Calling
apt-get update && apt-get upgrade
results in: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:
.img
files (wherever they come from)