apt在更新内核的时候不会移除旧版本内核。随着内核的不断更新,新的内核装进来,老的内核不会被删除,于是默认只有不到500MiB的 /boot 慢慢变得不堪重负,塞满了内核和initrd。终于有一天,你在愉快地 apt update && apt full-upgrade 的时候遇到了这样的错误:
1 2 3 4 5 6 7 8 9 10 |
gzip: stdout: No space left on device E: mkinitramfs failure cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-4.10.0-37-generic with 1. run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 dpkg: error processing package linux-image-extra-4.10.0-37-generic (--purge): subprocess installed post-removal script returned error exit status 1 Removing linux-image-extra-4.10.0-40-generic (4.10.0-40.44~16.04.1) ... run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic update-initramfs: Generating /boot/initrd.img-4.10.0-40-generic |
那么让我们试试修复这台服务器。