How do I cleanup a boot partition that can't be cleaned up with package-cleanup?
0
votes
2
answers
4051
views
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 https://unix.stackexchange.com/questions/233597/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?
Asked by scottbb
(588 rep)
Jan 5, 2018, 09:48 PM
Last activity: Jan 5, 2018, 11:20 PM
Last activity: Jan 5, 2018, 11:20 PM