I don't really need to keep 6 kernels (and ancilliary files) around
but what's the recommended/safe procedure to remove them?
In addition to /boot, is there any other place in the / partition
to look for unnecessary files?
Next time a set up a RH server, should I create a huge /boot
partition in order to solve this problem?
TIA,
-Ramon F. Herrera
ps: this is what one of the /boot partitions looks like:
total 29372
-rw-r--r-- 1 root root 5824 Jun 24 2001 boot.b
-rw-r--r-- 1 root root 612 Jun 24 2001 chain.b
-rw-r--r-- 1 root root 40600 Aug 7 2002
config-2.4.18-10
-rw-r--r-- 1 root root 40598 Aug 7 2002
config-2.4.18-10smp
-rw-r--r-- 1 root root 42268 Nov 13 2002
config-2.4.18-18.7.x
-rw-r--r-- 1 root root 42266 Nov 13 2002
config-2.4.18-18.7.xsmp
-rw-r--r-- 1 root root 39947 Apr 18 2002
config-2.4.18-3
-rw-r--r-- 1 root root 39945 Apr 18 2002
config-2.4.18-3smp
drwxr-xr-x 2 root root 1024 Nov 29 2002 grub
-rw-r--r-- 1 root root 267159 Oct 13 2002
initrd-2.4.18-10.img
-rw-r--r-- 1 root root 271848 Oct 13 2002
initrd-2.4.18-10smp.img
-rw-r--r-- 1 root root 263791 Nov 29 2002
initrd-2.4.18-18.7.x.img
-rw-r--r-- 1 root root 273241 Nov 29 2002
initrd-2.4.18-18.7.xsmp.img
-rw-r--r-- 1 root root 262840 Oct 13 2002
initrd-2.4.18-3.img
-rw-r--r-- 1 root root 268067 Oct 13 2002
initrd-2.4.18-3smp.img
-rw-r--r-- 1 root root 477 Oct 13 2002 kernel.h
-rw-r--r-- 1 root root 23108 Jun 24 2001 message
lrwxrwxrwx 1 root root 25 Nov 29 2002 module-info ->
module-info-2.4.18-18.7.x
-rw-r--r-- 1 root root 14431 Aug 7 2002
module-info-2.4.18-10
-rw-r--r-- 1 root root 14431 Aug 7 2002
module-info-2.4.18-10smp
-rw-r--r-- 1 root root 15436 Nov 13 2002
module-info-2.4.18-18.7.x
-rw-r--r-- 1 root root 15436 Nov 13 2002
module-info-2.4.18-18.7.xsmp
-rw-r--r-- 1 root root 14431 Apr 18 2002
module-info-2.4.18-3
-rw-r--r-- 1 root root 14431 Apr 18 2002
module-info-2.4.18-3smp
-rw-r--r-- 1 root root 640 Jun 24 2001 os2_d.b
lrwxrwxrwx 1 root root 27 Nov 29 2002 System.map ->
System.map-2.4.18-18.7.xsmp
-rw-r--r-- 1 root root 476852 Aug 7 2002
System.map-2.4.18-10
-rw-r--r-- 1 root root 501549 Aug 7 2002
System.map-2.4.18-10smp
-rw-r--r-- 1 root root 490460 Nov 13 2002
System.map-2.4.18-18.7.x
-rw-r--r-- 1 root root 518197 Nov 13 2002
System.map-2.4.18-18.7.xsmp
-rw-r--r-- 1 root root 465966 Apr 18 2002
System.map-2.4.18-3
-rw-r--r-- 1 root root 490685 Apr 18 2002
System.map-2.4.18-3smp
-rwxr-xr-x 1 root root 2872539 Aug 7 2002
vmlinux-2.4.18-10
-rwxr-xr-x 1 root root 3221932 Aug 7 2002
vmlinux-2.4.18-10smp
-rwxr-xr-x 1 root root 2983920 Nov 13 2002
vmlinux-2.4.18-18.7.x
-rwxr-xr-x 1 root root 3376911 Nov 13 2002
vmlinux-2.4.18-18.7.xsmp
-rwxr-xr-x 1 root root 2835238 Apr 18 2002
vmlinux-2.4.18-3
-rwxr-xr-x 1 root root 3176626 Apr 18 2002
vmlinux-2.4.18-3smp
lrwxrwxrwx 1 root root 21 Nov 29 2002 vmlinuz ->
vmlinuz-2.4.18-18.7.x
-rw-r--r-- 1 root root 1040447 Aug 7 2002
vmlinuz-2.4.18-10
-rw-r--r-- 1 root root 1117511 Aug 7 2002
vmlinuz-2.4.18-10smp
-rw-r--r-- 1 root root 1064284 Nov 13 2002
vmlinuz-2.4.18-18.7.x
-rw-r--r-- 1 root root 1154364 Nov 13 2002
vmlinuz-2.4.18-18.7.xsmp
-rw-r--r-- 1 root root 1030147 Apr 18 2002
vmlinuz-2.4.18-3
-rw-r--r-- 1 root root 1108097 Apr 18 2002
vmlinuz-2.4.18-3smp
>I don't really need to keep 6 kernels (and ancilliary files) around
>but what's the recommended/safe procedure to remove them?
The current kernel is usally in /usr/src/linux. It may be a link to the actual
kernel like I do it.
linux -> linux-2.4.22
If you don't need the other kernels then you can safely delete all of them you
don't need. You also should look into /lib/modules and remove the module
directories for the kernels you don't need. If you accidently delete other
modules in that directory it's not that bad but you have to recompile the
kernel and then this directory will be recreated.
I don't know if you compiled your kernels yourself. If not then I would
strongly recommedn, before doing any deletion, you should probably recompile
the kernel you want to keep and install it to see if everything works.
>Next time a set up a RH server, should I create a huge /boot
>partition in order to solve this problem?
I don't know, but I never had the need to have so many kernels. I keep two
kernels and delete the other ones.
--
Gerhard Gruber
Maintainer of
SoftICE for Linux - http://sourceforge.net/projects/pice
Fast application launcher - http://sourceforge.net/projects/launchmenu
> I have several servers registered to the RHN, and I have been
> connecting and upgrading them periodically. When I first
> install RedHat I figure that a 300-500 kB root partition
> is large enough, but it turns out that I cannot upgrade
> some servers, because of lack of space in the root partition.
>
> I don't really need to keep 6 kernels (and ancilliary files) around
> but what's the recommended/safe procedure to remove them?
>
Unlike most rpms, kernels tend to be installed rather than
upgraded. So you need to uninstall the ones you are no longer
using. I usually leave the last known good set of kernel
and kernel-smp rpms
Use uname -a to make sure you are actually running the
latest kernel - you may need to edit /etc/grub.conf and
reboot...
Issue rpm -qa | grep kernel and then rpm -e to remove
unwanted kernels.
HTH,
Dave
--
Dave Abbott, UNIX SysAdmin |
Department of Computer Science | http://www.dcs.shef.ac.uk/
The University of Sheffield |
Use rpm -e kernel-<version> to remove the old kernels. _Don't_ try to
remove the files manually.
--
Markku Kolkka
markku...@iki.fi
On a related note I've never installed a kernel using rpm, I always
download the source and compile the kernel by hand. Can I now just
download a kernel rpm and install it?
Thanks Nick
OT, but linking /usr/src/linux to the current kernel directory has been
deprecated for the last some years. For instance, Linus Torvalds says:
http://www.ussg.iu.edu/hypermail/linux/kernel/0007.3/0587.html
--
Ambarish
Well, he doesn't say that having /usr/src/linux symlinked to your kernel
source is a bad thing in and of itself. If that's your take on the message,
perhaps you should re-read it.
What he's saying is that your /usr/include/linux (and although he doesn't
mention it, /usr/src/asm) directories should *NOT* be symlinked into
/usr/src/linux.
Now, he does suggest leaving /usr/src/linux alone, and says that his still
has some old version. However, if you look a bit before that, you'll see
that's because his distribution (and most others) have
/usr/include/(linux|asm) linked into /usr/src/linux.
However, if things are done properly (and as he suggests), and
/usr/include/(linux|asm) have had the kernel headers *copied* into them when
glibc was compiled, then /usr/src/linux is just another directory, and you
can mess with it all you want.
On a side note, things have changed somewhat since then. RH 9.0 doesn't
have those symlinks any more, I'm not sure about the 7.x or 8.x series. And
the LFS instructions walk you through setting it up correctly, which means
that the LSB should therefore be correct as well.
steve
Yeah, I didn't mean to put it quite that way. It's better that
/usr/src/linux not be symlinked just to prevent mishaps. In any case, I
thought that the link explained the situation well enough, and didn't want
to repeat what Torvalds said. Thanks for clearing up any confusion.
<rest of message snipped>
--
Ambarish
On torsdag 4. desember 2003, 07:28 Ramon F Herrera tried to express an opinion:
> Next time a set up a RH server, should I create a huge /boot
> partition in order to solve this problem?
Personally I always create a 50 MB /boot partition.
As for the root partition, it depends on the other partitions,
and what dir's are stored on them.
And in case you wondered,
here are my partition sizes on my mandrake 9.1 installation.
=========
54M /boot
1,9G /
17G /home
1.0G /tmp
9,8G /usr
3,9G /var
=========
Some friends say my /usr is TO LARGE.. heh..
I remember thinking on the install:
"Why not have a large part for programs,
so I don't easy run out of space"
Hehe..
Next disk wil have a smaller /usr :-)=
And maybe a smaler /tmp :-)=
On my old Redhat 7.1 server, I have a 6GB disk
I have a 23MB /boot and the rest is /
(Default partitioning in the RH7.1 install)
- --
Solbu - http://www.solbu.net
Remove 'ugyldig' for email
PGP key ID: 0xFA687324
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/0VLeT1rWTfpocyQRAplbAKCIRHC0EPsYMO5UCrCXsOgdvU0cfwCfUpdd
yySfheW5bNp3g4AKxu2AxLA=
=FwNa
-----END PGP SIGNATURE-----
You probably did not wonder, but mine is:
valinux:jdbeyer[~/stocks/setup]$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda2 5365176 2800508 2292132 55% /
/dev/sda1 49558 19638 27361 42% /boot
/dev/sdb1 5780400 1257900 4228872 23% /home
/dev/sda5 1007880 277172 679512 29% /opt
/dev/sda6 190387 4372 176186 3% /tmp
/dev/sda7 192352 65072 117348 36% /var
Were I to separate out /usr, I would find it requires
2625612 1-K blocks. Now I am going to replace IBM's DB2 V6.1 in a few
months, and the new version may be 4x larger (at least, the download
image is), and it must go in /usr/IBMdb2. How big /usr needs to be
depends (no surprise) on what must be in there.
As far as /tmp goes, it is normally just about empty, but sometimes I
cannot deal with certain spreadsheet operations on large data files
because it runs out of space in /tmp. I also cannot download big files
(600 Megabyte) using Mozilla because it needs more /tmp space. And some
of those files cannot be downloaded with ftp because to access the page
containing it, one must go through a web browser to pass the security
checks and manage the cookies.
DB2 also creates, sometimes (when joining large tables under some
conditions) uses more space in /var than is available. Fortunately I put
a symlink in there into /home and that works for now. /var also
overflows when running Red Hat's up2date program if there are too many
rpms to download at once. You can work around that, too, but more /var
space is also a good thing (if you have it).
My new machine will have 80GBytes on a 7200rpm IDE drive, and 4 18GByte
SCSI drives, so there I will have much larger partitions for various things.
>
> Some friends say my /usr is TO LARGE.. heh..
> I remember thinking on the install:
> "Why not have a large part for programs,
> so I don't easy run out of space"
>
> Hehe..
> Next disk wil have a smaller /usr :-)=
> And maybe a smaler /tmp :-)=
>
>
> On my old Redhat 7.1 server, I have a 6GB disk
> I have a 23MB /boot and the rest is /
> (Default partitioning in the RH7.1 install)
>
> - --
> Solbu - http://www.solbu.net
> Remove 'ugyldig' for email
> PGP key ID: 0xFA687324
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2 (GNU/Linux)
>
> iD8DBQE/0VLeT1rWTfpocyQRAplbAKCIRHC0EPsYMO5UCrCXsOgdvU0cfwCfUpdd
> yySfheW5bNp3g4AKxu2AxLA=
> =FwNa
> -----END PGP SIGNATURE-----
--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ Registered Machine 73926.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 8:05am up 3 days, 20:51, 3 users, load average: 2.15, 2.15, 2.15