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):
Filesystem | Size | Used | Avail | Use% | Mounted on | |
---|---|---|---|---|---|---|
before | /dev/sda1 | 234M | 150M | 73M | 67% | /boot |
after | /dev/sda1 | 234M | 135M | 88M | 61% | /boot |
And that should leave you with enough space for a second kernel.
By: G Hillenius