Kernel Despair

Mark Knecht markknecht at gmail.com
Wed Apr 20 20:50:29 UTC 2005


On 4/20/05, Scott Mertens <smertens at mho.com> wrote:
> After editing my grub.conf file a few hours ago,to give me a chance to
> select a kernel. I found 6 kernels that I was being offered the chance
> to boot to.  I am currently trying to get sound going on a beta kernal,
> and I want to keep the supported kernel.  How can I remove the other 4
> kernels?
> 
> [root at RHServer01 ~]# cat /proc/version
> Linux version 2.6.9-6.37.ELsmp (bhcompile at decompose.build.redhat.com)
> (gcc version 3.4.3 20050227 (Red Hat 3.4.3-22)) #1 SMP Tue Mar 29
> 15:43:19 EST 2005
> [root at RHServer01 ~]#
> 
> Thanks

Scott,
   There really isn't any reason to remove them other than disk space
issues. I would recommend going slowly at first. They won't hurt
anythign sitting there for a few more days.

   With that preface out of the way it would go something like this.
(A bit distro specific and since I don't use RHEL or anything in that
product line go carefully:

1) Edit grub.conf to remove the kernels that you are interested in.
Reboot the machine at least once to make sure that you have the one
you want showing up.

2) Mount /boot and remove the kernel image file. It may be called
kernel-xxx, bzImage.xxx, vmImage-xxx or anything along those lines.
Also remove any files like initrd-xxx, config-xxx, etc. that match up
with the kernel you are removing.

3) Look under /lib/modules for the direcorties that match the kernels
you want to get right of. rm -rf those directories. Make sure you do
not remove any directories for the kernels you want to keep.

4) Take a trip over to /usr/src and see what you have there. First
make sure that if there is a link for /usr/src/linux that it points to
the kernel you want to run. If you need to set it up then

ls -s /usr/src/linux-KEEP_VERSION   linux 

from the /usr/src directory will do that for you.

5) After the link is properly checked and set up you will then remove
any kernel source code trees for kernels you don't want any more.

rm -rf linux-xxx

That's about it.

That process is full of places wher you can hurt you machine and be
almost forced into a total reinstall so please be careful!!

Cheers,
Mark




More information about the Redhat-install-list mailing list