Click to See Complete Forum and Search --> : A question on removing spare kernels
satimis
01-09-2005, 10:58 AM
Hi folks,
FC2
I have following kernels running on my OS
$ rpm -qa | grep kernel
kernel-2.6.6-1.435.2.3
kernel-source-2.6.5-1.358
kernel-2.6.8-1.521
kernel-2.6.9-1.3_FC2
kernel-2.6.5-1.358
kernel-2.6.7-1.494.2.2
kernel-2.6.9-1.6_FC2
kernel-utils-2.4-9.1.131
kernel-2.6.9-1.11_FC2
I am going to remove all following spare kernels
kernel-2.6.6-1.435.2.3
kernel-2.6.8-1.521
kernel-2.6.9-1.3_FC2
kernel-2.6.5-1.358
kernel-2.6.7-1.494.2.2
kernel-2.6.9-1.6_FC2
only retaining
kernel-2.6.9-1.11_FC2
kernel-source-2.6.5-1.358
kernel-utils-2.4-9.1.131
Kindly advise which of following methods will be more appropriate
1) yum remove kernel-2.6.6-1.435.2.3/kernel-2.6.8-1.521/kernel-2.6.9-1.3_FC2
kernel-2.6.5-1.358/kernel-2.6.7-1.494.2.2/kernel-2.6.9-1.6_FC2
OR
2) rpm -e kernel-2.6.6-1.435.2.3/kernel-2.6.8-1.521/kernel-2.6.9-1.3_FC2
kernel-2.6.5-1.358/kernel-2.6.7-1.494.2.2/kernel-2.6.9-1.6_FC2
TIA
B.R.
satimis
Icarus
01-09-2005, 01:17 PM
It's been a while since I've used an RPM based distro (been meaning to setup a SUSE machine for some testing) but your #2 looks right, except replace the / with spaces between the packages
soulestream
01-09-2005, 01:36 PM
one note with my 2 cents. instead of removiing all of them at once, its always a good idea to remove one at a time. so if something does get screwed then its easier to track down.
soule
bwkaz
01-09-2005, 03:42 PM
Originally posted by satimis
only retaining
kernel-2.6.9-1.11_FC2
kernel-source-2.6.5-1.358
kernel-utils-2.4-9.1.131 This might cause some issues. kernel-utils probably doesn't matter (at least, I don't think it does, but I'm not sure what it is either). But your kernel-source, if you need it installed at all, should match your running kernel if possible. Having only kernel 2.6.9 (plus Fedora updates) alongside a kernel 2.6.5 (plus Fedora updates) source tree will cause problems if you use that kernel source tree.
However, given that you haven't upgraded the kernel source yet either, I'd guess that you aren't doing anything that would require the sources. So maybe it would make more sense to remove them, and save a few hundred megs of disk space.
satimis
01-09-2005, 11:11 PM
Hi Icarus and soulestream,
Your advice noted with thanks.
B.R.
satimis
satimis
01-09-2005, 11:18 PM
Hi bwkaz,
....
However, given that you haven't upgraded the kernel source yet either, I'd guess that you aren't doing anything that would require the sources. So maybe it would make more sense to remove them, and save a few hundred megs of disk space. You are right.
Sometimes ago I was prepared to recompile the kernel. It was there then. So I'll remove it.
What about kernel-utils-2.4-9.1.131 ? Do I need to upgrade it or remove it as well?
Tks.
B.R.
satimis
bwkaz
01-10-2005, 07:29 PM
I don't know what that is. But it supposedly has a /usr/share/doc subdirectory with a README in it (at least, some 2.4 version did), so you might consult that to figure out what it is.
The 2.4 version that I found only contained ksymoops, which is no longer required with kernel 2.6 anyway, but before you delete it you'll want to find out what your version actually does contain.
Actually, this page does say that it has other utilities than ksymoops in it:
http://rpmfind.net//linux/RPM/fedora/2/i386/kernel-utils-2.4-9.1.131.i386.html
so you'll probably still want to keep it. You won't have to upgrade it with the kernel, though.
soulestream
01-10-2005, 10:06 PM
not trting to steal the thread,but..
bwkaz...if you manually compile the kernel could you do it on a network drive, then just copy over SystemMap and bzImage, then delete the share to save space. i know this would not allow a recompile. just wondering while reading this. my laptop only has a 5 gig drive.
this would also save satimis some space
soule
bwkaz
01-10-2005, 11:15 PM
In theory, yes. You'd be using the native compiler, so you wouldn't have to worry about cross-compiling it (or even fake-cross-compiling it, like you have to do if you're building a kernel for a Pentium on an Athlon XP machine). You might have to worry about NFS sharing, though (I seem to remember Googling something else and finding some posts to LKML about issues compiling the kernel as root while the sources were on an NFS share -- shouldn't be a problem though unless you compile as root).
But yeah, it should be possible.
soulestream
01-10-2005, 11:38 PM
im going to get yelled at by somebody, but on my linux network i use a w2k server. i have to have one for study/work stuff. i quess samba would have same/if any restrictions as NFS.
soule
bwkaz
01-11-2005, 08:47 PM
Well, no, not really. That's because NFS does permission checks on the server, and it blindly trusts the user ID of the client.
This means that (if you don't use root_squash), root on any NFS client maps to root on the NFS server. This means that if an attacker can get NFS access to your server from a machine that he has the root password on (for example, a machine he owns), then he has full root access over NFS to your machine also.
So NFS has a root_squash option, which means that root on the NFS client maps to "nobody" on the NFS server instead of root.
This caused problems with somebody when they compiled their server as root, because there was some directory in the kernel source that wasn't writable by "nobody", so the installation failed.
Samba doesn't do this, because (by default anyway) it doesn't map remote users to anybody on the server.
But it does have the 2 gig file-size limit, if you don't use smbclient. That shouldn't affect kernel compiles, though, because AFAIK no file in the kernel source ever gets to be 2 gigs.
satimis
01-12-2005, 11:36 AM
Hi bwkaz,
........
so you'll probably still want to keep it. You won't have to upgrade it with the kernel, though. Yes. I keep it.
I have removed other kernels leaving only
$ rpm -qa | grep kernel
kernel-2.6.9-1.3_FC2
kernel-2.6.9-1.6_FC2
kernel-utils-2.4-9.1.131
kernel-2.6.9-1.11_FC2
# yum remove kernel-xxxx
did not work for me. I have to use
# rpm -e kernel-xxxx
each time following info appeared
# yum remove kernel-2.6.7-1.494.2.2
Gathering header information file(s) from server(s)
Server: Fedora Core 2 - i386 - Base
Server: Fedora.us Extras (Stable)
Server: Fedora.us Extras (Testing)
Server: Fedora.us Extras (Unstable)
Server: Livna.org - Fedora Compatible Packages (stable)
Server: Livna.org - Fedora Compatible Packages (unstable)
Server: macromedia.mplug.org - Flash Plugin
Server: Fedora Core 2 - i386 - Released Updates
Finding updated packages
Downloading needed headers
Erase: No matches for kernel-2.6.7-1.494.2.2
No actions to takeI could not resolve its reason.
B.R.
satimis