On several Ubuntu machines I am constantly facing the problem of a full boot partition although I always do remove all old kernels. The problem seems to occur, as many initrd
files are on the boot partition even though the related kernels are not actually installed. To give in example:
root@Jacobi:/boot# ls -lah
insgesamt 202M
drwxr-xr-x 3 root root 3,0K Jan 30 10:03 .
drwxr-xr-x 25 root root 4,0K Jan 30 10:03 ..
-rw-r--r-- 1 root root 1,2M Dez 11 15:36 abi-4.4.0-104-generic
-rw-r--r-- 1 root root 1,2M Jan 9 22:28 abi-4.4.0-109-generic
-rw-r--r-- 1 root root 1,2M Jan 19 14:06 abi-4.4.0-112-generic
-rw-r--r-- 1 root root 187K Dez 11 15:36 config-4.4.0-104-generic
-rw-r--r-- 1 root root 187K Jan 9 22:28 config-4.4.0-109-generic
-rw-r--r-- 1 root root 187K Jan 19 14:06 config-4.4.0-112-generic
drwxr-xr-x 5 root root 1,0K Jan 30 10:03 grub
-rw-r--r-- 1 root root 10M Jan 30 10:03 initrd.img-3.13.0-39-generic
-rw-r--r-- 1 root root 10M Jan 30 10:02 initrd.img-4.4.0-101-generic
-rw-r--r-- 1 root root 10M Jan 30 10:02 initrd.img-4.4.0-103-generic
-rw-r--r-- 1 root root 38M Jan 30 10:02 initrd.img-4.4.0-104-generic
-rw-r--r-- 1 root root 38M Jan 30 10:02 initrd.img-4.4.0-109-generic
-rw-r--r-- 1 root root 10M Jan 30 10:03 initrd.img-4.4.0-38-generic
-rw-r--r-- 1 root root 10M Jan 30 10:03 initrd.img-4.4.0-45-generic
-rw-r--r-- 1 root root 10M Jan 30 10:02 initrd.img-4.4.0-59-generic
-rw-r--r-- 1 root root 10M Jan 30 10:02 initrd.img-4.4.0-77-generic
-rw-r--r-- 1 root root 10M Jan 30 10:02 initrd.img-4.4.0-78-generic
-rw-r--r-- 1 root root 10M Jan 30 10:02 initrd.img-4.4.0-81-generic
-rw-r--r-- 1 root root 179K Jan 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 181K Jan 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 181K Jan 28 2016 memtest86+_multiboot.bin
-rw------- 1 root root 3,8M Dez 11 15:36 System.map-4.4.0-104-generic
-rw------- 1 root root 3,8M Jan 9 22:28 System.map-4.4.0-109-generic
-rw------- 1 root root 3,8M Jan 19 14:06 System.map-4.4.0-112-generic
-rw------- 1 root root 6,8M Dez 11 15:36 vmlinuz-4.4.0-104-generic
-rw------- 1 root root 6,8M Jan 9 22:28 vmlinuz-4.4.0-109-generic
-rw------- 1 root root 6,8M Jan 19 14:06 vmlinuz-4.4.0-112-generic
But only linux-image-4.4.0-104-generic and linux-image-4.4.0-109-generic are installed:
root@Jacobi:/boot# dpkg -l linux-image-\* | grep ^ii
ii linux-image-4.4.0-104-generic 4.4.0-104.127 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-109-generic 4.4.0-109.132 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-104-generic 4.4.0-104.127 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-109-generic 4.4.0-109.132 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
If I delete the unnecessary initrd files manually they will be generated again as soon as I try to do an upgrade.
What could be the cause of this issue and how can I get rid of those files permanently?
You should check partially removed kernels with
dpkg -l linux-image-\* | grep ^rc
and remove them with for example sudo apt-get purge linux-image-4.4.0-101-generic
.
Purging will remove initramfs generation rules from /var/lib/initramfs-tools/
.
If it does not help, you can remove them manually from initramfs list:
sudo rm /var/lib/initramfs-tools/3.13.0-39-generic
sudo rm /var/lib/initramfs-tools/4.4.0-101-generic
sudo rm /var/lib/initramfs-tools/4.4.0-103-generic
sudo rm /var/lib/initramfs-tools/4.4.0-38-generic
sudo rm /var/lib/initramfs-tools/4.4.0-45-generic
sudo rm /var/lib/initramfs-tools/4.4.0-59-generic
sudo rm /var/lib/initramfs-tools/4.4.0-77-generic
sudo rm /var/lib/initramfs-tools/4.4.0-78-generic
sudo rm /var/lib/initramfs-tools/4.4.0-81-generic
Usually I run purge-old-kernels
followed by sudo apt-get autoremove
to have only 2 recent kernels.
You can reinstall installed kernels with their initramfses:
sudo apt-get install --reinstall \
$(dpkg -l linux-image-\* | grep ^ii | awk '{print $2}')
No comments:
Post a Comment