Chris Geldenhuis
2008-Jan-13 07:55 UTC
[CentOS] LIMITING NUMBER OF KERNEL VERSIONS RETAINED
Hi Some time ago there was a discussion on the above subject. I have scanned the past few month's mailing list archives and cannot find the relevant mail(s). Could somebody please repost the solution or point me at the correct resource. I would also appreciate advice on how to do this on a RHEL4 server being updated with up2date. Is it safe just to delete the old kernel and initrd files from the boot partition and the grub conf file? TIA ChrisG
Robert - elists
2008-Jan-13 08:09 UTC
[CentOS] LIMITING NUMBER OF KERNEL VERSIONS RETAINED
> Subject: [CentOS] LIMITING NUMBER OF KERNEL VERSIONS RETAINED > > Hi > > Some time ago there was a discussion on the above subject. I have > scanned the past few month's mailing list archives and cannot find the > relevant mail(s). > > Could somebody please repost the solution or point me at the correct > resource. > > I would also appreciate advice on how to do this on a RHEL4 server being > updated with up2date. > > Is it safe just to delete the old kernel and initrd files from the boot > partition and the grub conf file? > > TIA > > ChrisGChris I dunno answer to limit kernels retained. No, simple deletion is not a good idea. What we do is this rpm -qa | grep kernel Then we use yum to remove the ones we do not need yum remove kernel-whatever-version-etc and/or other items as necessary - rh
Alfred von Campe
2008-Jan-13 13:14 UTC
[CentOS] LIMITING NUMBER OF KERNEL VERSIONS RETAINED
> Some time ago there was a discussion on the above subject. I have > scanned the past few month's mailing list archives and cannot find > the relevant mail(s). > > Could somebody please repost the solution or point me at the > correct resource.What you want is: # yum instal yum-utils followed by: # package-cleanup --oldkernels [--count=x] where x defaults to "2" (i.e., keep two older kernels). Alfred
> Could somebody please repost the solution or point me at the correct > resource. > > I would also appreciate advice on how to do this on a RHEL4 server being > updated with up2date. > > Is it safe just to delete the old kernel and initrd files from the boot > partition and the grub conf file?Unless you are really hurting for disk space on your boot partition, it is safe to leave the extra kernel images there. If the clutter on your grub menu bothers you, you can simply delete them from the grub.conf file so they don't show up. I generally keep 2-3 older kernel images around just in case newly installed ones won't boot for some reason. Alfred gave some good advice for keeping this neat 'n tidy with the yum-utils package-cleanup command.
Chris Geldenhuis napsal(a):> Hi > > Some time ago there was a discussion on the above subject. I have > scanned the past few month's mailing list archives and cannot find the > relevant mail(s). > > Could somebody please repost the solution or point me at the correct > resource. > > I would also appreciate advice on how to do this on a RHEL4 server being > updated with up2date. > > Is it safe just to delete the old kernel and initrd files from the boot > partition and the grub conf file? > > TIA > > ChrisGHi, I use this within my kikstart scripts: if [ $(rpm -q kernel | wc -l) -gt 1 ]; then rpm -e $(rpm -q kernel | sed '$d'); fi if [ $(rpm -q kernel-smp | wc -l) -gt 1 ]; then rpm -e $(rpm -q kernel-smp | sed '$d'); fi David Hrb??