June 14

Linux: Error with update-initramfs’ “No space left on device”

Modules=DEP; a remedy for update-initramfs’ “No space left on device”

The fix? Add MODULES=dep to /etc/initramfs-tools/conf.d/modules, followed up by update-initramfs.

My most recent Debian install created a /boot partition of 234 M.

Starting with Debian’s linux-image-5.10.0-4-amd, somewhere in March this year, update-initramfs began reporting problems installing a new kernel next to the current one.

Errors look like this:

update-initramfs: Generating /boot/initrd.img-5.14.0-1-amd64

gzip: stdout: No space left on device
E: mkinitramfs failure gzip 1
update-initramfs: failed for /boot/initrd.img-5.14.0-1-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1

The fix – Debian Bug report logs – #929424: initramfs-tools: update-initramfs should not store temporary files on /boot, which I found after reading Debian Bug report logs – #972396: initramfs-tools: Installation fails (no space left on device).

As root, create a file entitled modules in /etc/initramfs-tools/conf.d/modules with just this one line:

MODULES=dep

And then redo, as root,

update-initramfs -u

or

update-initramfs -k all -u

The result (with currently just a single kernel installed):

FilesystemSizeUsedAvailUse%Mounted on
before/dev/sda1234M150M73M67%/boot
after/dev/sda1234M135M88M61%/boot

And that should leave you with enough space for a second kernel.

By: G Hillenius


Copyright 2021. All rights reserved.

Posted June 14, 2022 by Timothy Conrad in category "Linux

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B