[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: No space left when: update-initramfs: Generating /boot/initrd.img-5.10.0-5-amd64



Hallo,
* Marco Ippolito [Wed, Apr 07 2021, 09:20:46AM]:

> 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
>
> # df -h /boot
> Filesystem      Size  Used Avail Use% Mounted on
> /dev/nvme0n1p1  236M  233M     0 100% /boot

That's not much if you have more than a few kernels installed. They are
simply too fat nowadays, too many drivers included. And with the "most"
strategy (which you normally want to have a bootable system), they are
just too fat nowadays. I decided to let MY initramfs images go on diet
and added a little script which removes a few drivers that I certainly
don't need (checked with lsmod) and which contained lots of firmwares
and similar stuff.

So, one _might_ try that but only on your own risk, it could render your
system unbootable. I selected those three because they contributed most
to the overall usage (unpacked initramfs image with unmkinitramfs and
checking with "du|sort -n").

$ cat /etc/initramfs-tools/hooks/zz_drop_stuff
#!/bin/sh

if ! test "$DESTDIR"; then
        . /usr/share/initramfs-tools/hook-functions
fi

set -x

#experiments: radeon infiniband lpfc qla2xxx qla4xxx cxgb4 drbd nfs bfa f2fs xfs btrfs aic7xxx gma500

for nam in i915 amdgpu ethernet
do
        find ${DESTDIR} -name $nam | xargs --no-run-if-empty rm -rv
done

#USEDMODPAT=$(lsmod | grep -v " 0 " | sed -e "s, .*,,;s,_,.,g;s,$,.ko,")
#for pat in $USEDMODPAT
#do
#        find ${DESTDIR} | grep "/${pat}$" || echo "WARNING: $pat not found, essential module missing!"

That script probably should be set executable.

Best regards,
Eduard.


Reply to: