I recently reinstalled CentOS 7 on a lab/development machine. I wanted to keep the /home partition from the previous installation, so I manually configured the partitioning to allow me to do that. In the process, I accidentally also kept the previous installation's /boot partition.
After installation was successful, I have a very busy Grub2 boot screen. In addition to my "new" clean CentOS install, all of my old kernel images appear in the boot screen:
CentOS Linux (3.10.0-693.11.1.el7.x86_64) 7 (Core) CentOS Linux (3.10.0-693.5.2.el7.x86_64) 7 (Core) CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core) <--- this is the new/reinstalled OS CentOS Linux (3.10.0-693.11.1.el7.x86_64.debug) 7 (Core) CentOS Linux (0-rescue-7859fc0fbe934b91b11ea69046b5d787) 7 (Core) CentOS Linux (0-rescue-6c92bef5457049e5a42e5609c540d753) 7 (Core) CentOS Linux (0-rescue-e7a05dc4cdda4e778a344945ef1ed391) 7 (Core) Simply running package-cleanup won't work, because there is really only one kernel installed (as far as the new OS is concerned):
$ package-cleanup --oldkernels --count=1 No old kernels to remove $ uname -r 3.10.0-693.el7.x86_64 $ rpm -qa kernel* kernel-debug-devel-3.10.0-693.11.6.el7.x86_64 kernel-3.10.0-693.el7.x86_64 kernel-headers-3.10.0-693.11.6.el7.x86_64 kernel-tools-libs-3.10.0-693.el7.x86_64 kernel-tools-3.10.0-693.el7.x86_64 Thus, I don't believe this is a dupe of regular "how do I clean up my /boot partition?" questions (such as How do I safely delete old kernel versions in CentOS 7?)
Normally I'd be fine with just dealing with a messy Grub2 menu, but my /boot partition only has 11 MiB left, so I'm unable to update my kernel.
I'm not sure what is safe to delete from the /boot partition. How do I clean it up when package-cleanup won't?