kanotix.com

General Support - Dangerous command?

feffer777 - 23.07.2006, 03:54 Uhr
Titel: Dangerous command?
A few weeks ago, I updated my kernel to 2.6.17-kanotix-1 from 2.6.16.16. That seemed to work ok, but right afterwords, I wanted to remove the old kernel and used "remove-kernel-completely". I did this from memory, but it tab-completed so I thought it was right. However, the command wanted to remove the newer kernel, so I aborted, but on reboot some modules failed to load and I got fatal errors. I saw the message that the kernel source tree was damaged. So I rebooted again this time into the old kernel. That worked ok, so I went to the irc to ask for help, and it was suggested that I just try to reinstall the new kernel. I did that and once again 2.6.17.1 worked. I left both kernels alone this time.

Then again this morning, thinking all was stable enough, I tried "remove-kernels-completely" and ran into the same problem. Again, I aborted when the command issued an ominous warning. Still, it borked my system even though I didn't follow through on the command. I got it back by booting into CLI init 3 and again reinstalling the 2.6.17 kernel. Having been burned twice, I started reading. Verlegen The remove kernels command should have been "remove-all-kernels-completely". I had left out the "all" previously.

Now I realize this was my fault, but I'm wondering what happened here. Obviously, doing "remove-kernels-completely" was very dangerous and is too close to "remove-all-kernels-completely". I don't want to do this to my system a third time, but if anyone knows whats going on here or would like to try it on a test installation, I'd be curious if you got the same result.

Sorry for the flurry of posts. They were all related to issues I had today, but I thought it was better to separate them.

Regards,
Ron
jackiebrown - 23.07.2006, 04:16 Uhr
Titel: RE: Dangerous command?
can't you remove them via synaptic?
h2 - 23.07.2006, 05:03 Uhr
Titel: RE: Dangerous command?
remove-all-kernels-completely removes all except the default kernel.

I didn't know about the 'remove-kernels-completely' command, that is obviously a dangerous command, like you said.

remove-all-kernels-completely is also not one of the better named commands by the way, since it doesn't actually remove all kernels completely, it just removes all non-default kernels completely.

I havent' tested it completely to see if it's actually the default kernel alone that it preserves, but I think that's what it is.
Swynndla - 23.07.2006, 05:32 Uhr
Titel: RE: Dangerous command?
If you want more control in what's getting removed, you can do this the following way:

... I upgraded my 2.6.17.3 kernel to 2.6.17.6-slh-up-1 (as the later kernel fixes a couple of security issues). So I can remove the 2.6.17.3 kernel like this:

First I do:
Code:
dpkg -l | grep '2.6.17.3'

(you can do dpkg -l | grep '2.6.16')
and look at the packeges installed, and then I can do:
Code:
apt-get remove --purge linux-doc-2.6.17.3-slh-up-1 linux-headers-2.6.17.3-slh-up-1 linux-image-2.6.17.3-slh-up-1

... this will remove everything for you including the grub entries.
Now I just reboot.
Pretty easy.

I personally wouldn't use synaptic. It might pay to do it in init 3 just in case.
Kano - 23.07.2006, 13:37 Uhr
Titel: RE: Dangerous command?
Basically remove-all-kernels-completely is save, but not the remove-kernel-completely script, which I need to exchange the kernel on live cd.
mzilikazi - 23.07.2006, 15:34 Uhr
Titel: Re: Dangerous command?
feffer777 hat folgendes geschrieben::
A few weeks ago, I updated my kernel to 2.6.17-kanotix-1 from 2.6.16.16. That seemed to work ok, but right afterwords, I wanted to remove the old kernel and used "remove-kernel-completely".


There is absolutely nothing wrong with having multiple kernels installed simutaneously. In fact I never have less than 2 just in case there is a problem with one you can always boot back into the known working kernel and fix any issues you might have. The only situation (that I can think of) where you might want to keep only 1 kernel installed is lack of disk space. Just a suggestion. Winken
feffer777 - 23.07.2006, 19:57 Uhr
Titel: RE: Re: Dangerous command?
@mzilikazi: Thanks for the input, in the future, I probably will keep 2 kernels at least until, I'm pretty sure the newest is stable.

@Kano: I admit using "remove-kernel-completely" was my mistake. I should have followed my own notes. Just a suggestion: maybe one of these scripts could be renamed, to keep other users from getting into trouble.

Thanks for this great distro!
Ron
Alle Zeiten sind GMT + 1 Stunde
PNphpBB2 © 2003-2007