# git/ad1810-doc/debian/linux-kernel-and-diskspace.txt linux kernel and diskspace - a mini-howto by Joost van Baal-Ilić December 2025 How to deal with lack of diskspace when upgrading the Linux kernel: tweak the way your initrd is generated. Tested on Debian GNU/Linux 13 (trixie), december 2025. since our /boot is mounted on a physical disk partition ( /dev/nvme0n1p2 ) and not in some LVM logical volume or zfs pool, incrementing the size of this partition is not trivial. therefore we deal with this by settling for smaller initrd's. i was running root@dazbog:~# uname -a Linux dazbog 6.12.43+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.43-1 (2025-08-27) x86_64 GNU/Linux i did root@dazbog:~# apt --update -V full-upgrade this failed since it tried to install linux-image-6.12.57+deb13-amd64: it failed with 'no space left on device' : my /boot partition is too small: a mere 235 MB. i did root@dazbog:~# dpkg --purge linux-image-6.12.43+deb13-amd64 . was asked if i was sure. i replied: yes, sure, purge my running kernel. then: root@dazbog:~# vi /etc/initramfs-tools/initramfs.conf this file has: # MODULES: [ most | netboot | dep | list ] # # most - Add most filesystem and all harddrive drivers. # dep - Try and guess which modules to load. # netboot - Add the base modules, network modules, but skip block devices. # list - Only include modules from the 'additional modules' list i changed MODULES=most into MODULES=dep . at one point the situation was: root@dazbog:~# df -h /boot Filesystem Size Used Avail Use% Mounted on /dev/nvme0n1p2 235M 127M 96M 57% /boot i reinstalled my running kernel: root@dazbog:~# apt -V install linux-image-6.12.43+deb13-amd64 (it said: Warning: More space needed in /boot than available: 130 MB > 101 MB, installation may fail ) after reinstalling the running kernel, and generating its (minimized) initrd.img: root@dazbog:~# df -h /boot Filesystem Size Used Avail Use% Mounted on /dev/nvme0n1p2 235M 164M 59M 74% /boot . the new kernel still had it's big initrd.img: root@dazbog:~# ls -lh /boot/initrd.img-6.12.* -rw-r--r-- 1 root root 26M дец 24 06:23 /boot/initrd.img-6.12.43+deb13-amd64 -rw-r--r-- 1 root root 101M дец 24 06:19 /boot/initrd.img-6.12.57+deb13-amd64 lets minimized that one too: root@dazbog:~# update-initramfs -u result: root@dazbog:~# ls -lh /boot/initrd.img-6.12.* -rw-r--r-- 1 root root 26M дец 24 06:23 /boot/initrd.img-6.12.43+deb13-amd64 -rw-r--r-- 1 root root 26M дец 24 06:25 /boot/initrd.img-6.12.57+deb13-amd64 and: root@dazbog:~# df -h /boot Filesystem Size Used Avail Use% Mounted on /dev/nvme0n1p2 235M 89M 134M 40% /boot . one more issue: symlinks are mixed up now, old points to new and vice versa root@dazbog:~# ls -l /initrd.img* /vmlinuz* lrw[..]6:23 /initrd.img -> boot/initrd.img-6.12.43+deb13-amd64 lrw[..]6:19 /initrd.img.old -> boot/initrd.img-6.12.57+deb13-amd64 lrw[..]6:23 /vmlinuz -> boot/vmlinuz-6.12.43+deb13-amd64 lrw[..]6:19 /vmlinuz.old -> boot/vmlinuz-6.12.57+deb13-amd64 . lets fix that manually: root@dazbog:~# cd / root@dazbog:/# rm initrd.img* vmlinuz* root@dazbog:/# ln -s boot/initrd.img-6.12.43+deb13-amd64 initrd.img.old ; \ ln -s boot/initrd.img-6.12.57+deb13-amd64 initrd.img root@dazbog:/# ln -s boot/vmlinuz-6.12.43+deb13-amd64 vmlinuz.old ; \ ln -s boot/vmlinuz-6.12.57+deb13-amd64 vmlinuz this looks better: root@dazbog:/# ls -l /initrd.img* /vmlinuz* lrw[..]6:36 /initrd.img -> boot/initrd.img-6.12.57+deb13-amd64 lrw[..]6:36 /initrd.img.old -> boot/initrd.img-6.12.43+deb13-amd64 lrw[..]6:37 /vmlinuz -> boot/vmlinuz-6.12.57+deb13-amd64 lrw[..]6:37 /vmlinuz.old -> boot/vmlinuz-6.12.43+deb13-amd64 : guess we're good now for future kernel updates. Copyright (C) 2025 Joost van Baal-Ilić This work is licensed under CC-BY 4.0 "Attribution 4.0 International", see https://creativecommons.org/licenses/by/4.0/ for conditions.