Safely removing unneeded Linux kernels
This mini howto is specifically for CentOS 5.x and RHEL 5.x but other OS'es have a similar ability.
Your boot partition is getting full of old unused Linux kernels from past kernel updates.
To see what percentage of your /boot partition is currently in use run the "df -h" command:
The safe way to manually remove unneeded kernels is by using yum.
First use "yum list" to find out what kernels are installed:
But, if I wanted to remove the oldest kernel, here's what to do...
The oldest kernel is the one with the lowest number. So in the example above that would be 2.6.18-8.1.15.el5. The newest kernel and the one I am currently using is 2.6.18-53.1.6.el5. Note that the order yum displays the kernels is NOT in order of oldest to newest! You have to look at each number.
Ok. To remove the oldest kernel in this example you would issue this command:
Fortunately, there is an automatic way to keep a fixed number of the latest kernels in /boot. There is a yum plugin called "installonlyn". Take a look at /etc/yum/pluginconf.d/installonlyn.conf
By enabling installonlyn as shown above, you will not have to manually remove kernels again. The next time you do a kernel update, yum will automatically remove the oldest kernel to keep you at the "tokeep" number you have set. NOTE- installonlyn will not remove your current working kernel so you don't have to worry about that. If you don't want any kernels to be removed you can set "tokeep=0".
I kinda have the opposite problem. When I install a new kernel the old one is automatically deleted. Tried everything to have yum leave the old kernel behind but it just don't happen. What am I doing wrong?
|All times are GMT +2. The time now is 15:42.|
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.