Removing old kernels?

Place to discuss Fedora and/or Red Hat

Removing old kernels?

Postby ZiaTioN » Fri Jun 04, 2004 12:31 am

I am trying to remove some of my old kernels to clean up the place but when I try to do an rpm uninstall the system errors and appears to hang (not freeze just hang).

Here is the error (or what appears to be an error):

[root@Hackbox root]# rpm -e kernel-2.4.20-8
stty: standard input: Invalid argument


Now this is all it does and just sits there. I cannot break the operation in any fashion so I have to "accidentally" hit the power button. After the system comes back up I run an rpm query and this kernel is still listed.

[root@Hackbox root]# rpm -qa | grep kernel
kernel-pcmcia-cs-3.1.31-13
kernel-source-2.4.20-8
kernel-2.4.20-31.9
kernel-2.4.20-8
kernel-2.4.20-30.9


I checked the /boot directory and the vmlinuz-2.4.20-8 and the initrd-2.4.20-8.img are gone. I also cat the /etc/grub.conf file and the grub boot loader entry for this kernel is also gone. So if the kernel is truly gone as all these indications would point to, why does it still show up in an rpm query? Also why would it hang like it is? Am I just not giving it long enough? I am somewhat impatient so the longest I have given it is probably around 7 or 8 minutes. I believe this should be plenty of time but who knows, maybe it is not.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Fri Jun 04, 2004 8:33 am

Hitting the power button is not a good idea. Sometimes it take an rpm command a while to do everything it needs to do (there are like 30MB of kernel modules). Having said that, the "rpm" command can hang though. I even have a tip on what to do if this happens:

http://voidmain.is-a-geek.net/redhat/fe ... round.html

If you try and break out of the command before it finishes this is usually what causes the "rmp" command to start locking up. The tip above should solve that problem. Instead of hitting the power button, open another terminal window and kill the process that is hung as mentioned in the tip.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Fri Jun 04, 2004 9:31 am

I tried to kill the process numerous times but it would not die. LOL..

Serious I tried to kill it quiet a few times using the pid and even trying a killall on the app itself (rpmd). This, of course, was my first attempt to recover from the hung state. The only option I had left was a hard boot.

I guess I might not have given enough time to do it's dirty work. I ran it last night before I went to bed and I just checked and the process is still running. It also appears now that every process that has tried to run since then (like my cron jobs) have also hung and are still listed in the active processes list.

Edit:
I just tried the work around and it worked like a charm. It took like 3 seconds to uninstall the kernel now that the rpm binary is working properly.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Fri Jun 04, 2004 9:57 am

I'm guessing that you weren't using the "-9" param with either kill or killall which is why the process wasn't actually being killed. A "-9" tells the kill command to use any means possible to kill the process, even if it doesn't want to die with a plain old "kill". You generally don't want to use the "-9" as the first choice.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Griffin518 » Fri Jun 04, 2004 3:42 pm

Void Main wrote:I'm guessing that you weren't using the "-9" param with either kill or killall which is why the process wasn't actually being killed. A "-9" tells the kill command to use any means possible to kill the process, even if it doesn't want to die with a plain old "kill". You generally don't want to use the "-9" as the first choice.


:) Just use -3 for a "graceful" kill...

but I'm guilty of -9'ing it as well. ;)
Griffin518
user
user
 
Posts: 38
Joined: Tue Apr 06, 2004 8:43 pm


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 1 guest

cron