Routine system update failed (Ubuntu 22.04.4 LTS)

Keith keithw at caramail.com
Sat Sep 21 18:52:04 UTC 2024


On 9/20/24 16:16, Bo Berglund wrote:

[snipped]

> Updating /boot/grub/menu.lst ... done
> 
> /etc/kernel/postinst.d/zz-update-grub:
> Sourcing file `/etc/default/grub'
> Sourcing file `/etc/default/grub.d/init-select.cfg'
> Generating grub configuration file ...
> Found linux image: /boot/vmlinuz-5.15.0-122-generic
> Found initrd image: /boot/initrd.img-5.15.0-122-generic
> Found linux image: /boot/vmlinuz-5.15.0-117-generic
> Found initrd image: /boot/initrd.img-5.15.0-117-generic
> Found linux image: /boot/vmlinuz-5.15.0-107-generic
> Found initrd image: /boot/initrd.img-5.15.0-107-generic
> Warning: os-prober will not be executed to detect other bootable partitions.
> Systems on them will not be added to the GRUB boot configuration.
> Check GRUB_DISABLE_OS_PROBER documentation entry.
> done
> Processing triggers for initramfs-tools (0.140ubuntu13.4) ...
> update-initramfs: Generating /boot/initrd.img-5.15.0-122-generic
> zstd: error 25 : Write error : No space left on device (cannot write compressed
> block)
> E: mkinitramfs failure zstd -q -1 -T0 25  <== ERROR here!
> update-initramfs: failed for /boot/initrd.img-5.15.0-122-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
> needrestart is being skipped since dpkg has failed
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 
> So I checked the drive situation:
> 
> ~$ df -h
> Filesystem                         Size  Used Avail Use% Mounted on
> tmpfs                               96M  1.4M   95M   2% /run
> /dev/mapper/agivpnserver--vg-root   28G   19G  7.5G  72% /
> tmpfs                              479M     0  479M   0% /dev/shm
> tmpfs                              5.0M     0  5.0M   0% /run/lock
> /dev/sda1                          470M  394M   52M  89% /boot
> tmpfs                               96M   32K   96M   1% /run/user/1000
> 
> I cannot see where the disk space problem is located...
> There is 11% left on /boot, is that the problem and if so what to do about it?
> 

If you can't resize /boot to accommodate more kernels and initrd-img 
files, then there are a couple of settings within the 
/etc/initramfs-tools/initramfs.conf file that you can set to reduce the 
initrd size when generated.

The first is the MODULES= config item. Change it from "most" to "dep" 
This will make the biggest impact to reducing the size of the initrd-img 
file.

The second set of config items (COMPRESS= and COMPRESSLEVEL=) deals with 
the compression tool and the level of compression of the initrd-img. By 
default on 24.04, the compression tool is zstd and the compression level 
is set to 1. The max is 19.

Setting COMPRESS= to another compression tool may yield better 
compression though.

Here's an example

Default settings:
MODULES=most
COMPRESS=zstd
COMPRESSLEVEL=1

$ ls -sh -1 /boot/initrd.img-*
64M /boot/initrd.img-6.8.0-41-generic
64M /boot/initrd.img-6.8.0-45-generic

Here's with the changed settings in initramfs.conf:
MODULES=dep
COMPRESS=xz
COMPRESSLEVEL=6

$ ls -sh -1 /boot/initrd.img-*
64M /boot/initrd.img-6.8.0-41-generic
11M /boot/initrd.img-6.8.0-45-generic

As you can see the initrd image file is considerably smaller for the 
6.8.0-45 version. I used xz for compression here, but you may want to 
stick with zstd since its faster. The zstd compressed file was 13M so 
not a big difference between it and xz size wise.

I ran "sudo update-initramfs -u" to update only the initrd-img for the 
kernel the machine is currently booted in (6.8.0-45). To apply to all 
versions, run
$ sudo update-initramfs -u -k all

I'd recommend only changing one at first and rebooting to test if 
everything still works properly. If there's a problem, you can reboot 
and use the kernel that has the unmodified initrd-img file and then 
restore the defaults to initramfs.conf and generate a new initrd-img for 
the version that didn't work.

-- 
Keith





More information about the ubuntu-users mailing list