boot partition getting full?

noimad1

Well-Known Member
Mar 27, 2003
626
0
166
On one of our servers the boot partition is getting full. I went in there to see what was going on and I didn't see anything out of the ordinary. I did see a lot of these files:

-rwxr-xr-x 1 root root 3498644 Jun 16 22:09 vmlinux-2.4.21-15.0.2.ELsmp
-rwxr-xr-x 1 root root 2884052 Jun 29 17:27 vmlinux-2.4.21-15.0.3.EL
-rwxr-xr-x 1 root root 3498644 Jun 29 17:16 vmlinux-2.4.21-15.0.3.ELsmp
-rwxr-xr-x 1 root root 2884052 Jul 31 00:39 vmlinux-2.4.21-15.0.4.EL
-rwxr-xr-x 1 root root 3502740 Jul 31 00:31 vmlinux-2.4.21-15.0.4.ELsmp
-rwxr-xr-x 1 root root 2884048 Apr 21 2004 vmlinux-2.4.21-15.EL
-rwxr-xr-x 1 root root 3498640 Apr 21 2004 vmlinux-2.4.21-15.ELsmp
-rwxr-xr-x 1 root root 2892244 Nov 24 19:50 vmlinux-2.4.21-20.0.1.EL
-rwxr-xr-x 1 root root 3523220 Nov 24 19:44 vmlinux-2.4.21-20.0.1.ELsmp
-rwxr-xr-x 1 root root 2892240 Aug 18 20:03 vmlinux-2.4.21-20.EL
-rwxr-xr-x 1 root root 3523216 Aug 18 19:57 vmlinux-2.4.21-20.ELsmp
-rwxr-xr-x 1 root root 2900384 Oct 23 2003 vmlinux-2.4.21-4.0.1.EL
-rwxr-xr-x 1 root root 3519072 Oct 23 2003 vmlinux-2.4.21-4.0.1.ELsmp
-rw-r--r-- 1 root root 1241330 Jun 16 22:23 vmlinuz-2.4.21-15.0.2.EL
-rw-r--r-- 1 root root 1343113 Jun 16 22:09 vmlinuz-2.4.21-15.0.2.ELsmp
-rw-r--r-- 1 root root 1241379 Jun 29 17:27 vmlinuz-2.4.21-15.0.3.EL
-rw-r--r-- 1 root root 1342372 Jun 29 17:15 vmlinuz-2.4.21-15.0.3.ELsmp
-rw-r--r-- 1 root root 1240137 Jul 31 00:39 vmlinuz-2.4.21-15.0.4.EL
-rw-r--r-- 1 root root 1343256 Jul 31 00:31 vmlinuz-2.4.21-15.0.4.ELsmp
-rw-r--r-- 1 root root 1241318 Apr 21 2004 vmlinuz-2.4.21-15.EL
-rw-r--r-- 1 root root 1342168 Apr 21 2004 vmlinuz-2.4.21-15.ELsmp
-rw-r--r-- 1 root root 1243818 Nov 24 19:49 vmlinuz-2.4.21-20.0.1.EL
-rw-r--r-- 1 root root 1353915 Nov 24 19:43 vmlinuz-2.4.21-20.0.1.ELsmp
-rw-r--r-- 1 root root 1243768 Aug 18 20:03 vmlinuz-2.4.21-20.EL
-rw-r--r-- 1 root root 1353783 Aug 18 19:56 vmlinuz-2.4.21-20.ELsmp
-rw-r--r-- 1 root root 1237061 Oct 23 2003 vmlinuz-2.4.21-4.0.1.EL
-rw-r--r-- 1 root root 1339556 Oct 23 2003 vmlinuz-2.4.21-4.0.1.ELsmp


which I think have something to do with the kernal......can i remove the old ones? Like the ones from June to Oct 2003
 

DigitalN

Well-Known Member
Sep 23, 2004
419
1
168
Hello,

rpm -qa | grep kernel-*

Will provide the names and versions of kernels installed.

Yes you can delete old unused kernels and the smp kernels (if you don't have dual cpu's in your servers, you don't need the smp kernels)

rpm -e kernel-version-number

This will remove the kernel rpm packages from your system and clear out space, I would suggest that you keep at least 2 good kernels at all times however.
 

Sinewy

Well-Known Member
May 15, 2004
364
1
168
Sydney, Australia
cPanel Access Level
DataCenter Provider
do a rpm -qa |grep kernel

show us the results before you do any removing just in case you accidentally remove one you need.

also,

cat /etc/grub.conf, show us the result
cat /etc/lilo.conf, show us the result
 

noimad1

Well-Known Member
Mar 27, 2003
626
0
166
Sinewy said:
do a rpm -qa |grep kernel

show us the results before you do any removing just in case you accidentally remove one you need.

also,

cat /etc/grub.conf, show us the result
cat /etc/lilo.conf, show us the result
Thank you for the help.

Here is the rpm -qa |grep kernel:

PHP:
kernel-2.4.21-20.EL
kernel-pcmcia-cs-3.1.31-13
kernel-2.4.21-15.EL
kernel-utils-2.4-8.37.6
kernel-source-2.4.21-20.0.1.EL
kernel-smp-2.4.21-4.0.1.EL
kernel-smp-2.4.21-15.EL
kernel-2.4.21-15.0.2.EL
kernel-2.4.21-15.0.4.EL
kernel-smp-2.4.21-20.EL
kernel-smp-2.4.21-20.0.1.EL
kernel-2.4.21-4.0.1.EL
kernel-smp-2.4.21-15.0.2.EL
kernel-2.4.21-15.0.3.EL
kernel-smp-2.4.21-15.0.4.EL
kernel-2.4.21-20.0.1.EL
kernel-smp-2.4.21-15.0.3.EL
the cat /etc/grub.conf
PHP:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda3
#          initrd /initrd-version.img
#boot=/dev/hda
default=12
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Enterprise Linux ES (2.4.21-20.0.1.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-20.0.1.ELsmp ro root=/dev/hda3
        initrd /initrd-2.4.21-20.0.1.ELsmp.img
title Red Hat Enterprise Linux ES (2.4.21-20.0.1.EL)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-20.0.1.EL ro root=/dev/hda3
        initrd /initrd-2.4.21-20.0.1.EL.img
title Red Hat Enterprise Linux ES (2.4.21-20.EL)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-20.EL ro root=/dev/hda3
        initrd /initrd-2.4.21-20.EL.img
title Red Hat Enterprise Linux ES (2.4.21-20.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-20.ELsmp ro root=/dev/hda3
        initrd /initrd-2.4.21-20.ELsmp.img
title Red Hat Enterprise Linux ES (2.4.21-15.0.4.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-15.0.4.ELsmp ro root=/dev/hda3
        initrd /initrd-2.4.21-15.0.4.ELsmp.img
title Red Hat Enterprise Linux ES (2.4.21-15.0.4.EL)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-15.0.4.EL ro root=/dev/hda3
        initrd /initrd-2.4.21-15.0.4.EL.img
title Red Hat Enterprise Linux ES (2.4.21-15.0.3.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-15.0.3.ELsmp ro root=/dev/hda3
        initrd /initrd-2.4.21-15.0.3.ELsmp.img
        initrd /initrd-2.4.21-15.0.3.ELsmp.img
title Red Hat Enterprise Linux ES (2.4.21-15.0.3.EL)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-15.0.3.EL ro root=/dev/hda3
        initrd /initrd-2.4.21-15.0.3.EL.img
title Red Hat Enterprise Linux ES (2.4.21-15.0.2.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-15.0.2.ELsmp ro root=/dev/hda3
        initrd /initrd-2.4.21-15.0.2.ELsmp.img
title Red Hat Enterprise Linux ES (2.4.21-15.0.2.EL)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-15.0.2.EL ro root=/dev/hda3
        initrd /initrd-2.4.21-15.0.2.EL.img
title Red Hat Enterprise Linux ES (2.4.21-15.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-15.ELsmp ro root=/dev/hda3
        initrd /initrd-2.4.21-15.ELsmp.img
title Red Hat Enterprise Linux ES (2.4.21-15.EL)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-15.EL ro root=/dev/hda3
        initrd /initrd-2.4.21-15.EL.img
title Red Hat Enterprise Linux ES (2.4.21-4.0.1.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-4.0.1.ELsmp ro root=LABEL=/
        initrd /initrd-2.4.21-4.0.1.ELsmp.img
title Red Hat Enterprise Linux ES (2.4.21-4.0.1.EL)
        root (hd0,0)
        kernel /vmlinuz-2.4.21-4.0.1.EL ro root=LABEL=/
        initrd /initrd-2.4.21-4.0.1.EL.img
and the cat /etc/lilo.conf
PHP:
prompt
timeout=50
default=2.4.21-4.0.1.E1
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32

image=/boot/vmlinuz-2.4.21-20.0.1.ELsmp
	label=2.4.21-20.0.1.1
	initrd=/boot/initrd-2.4.21-20.0.1.ELsmp.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-20.0.1.EL
	label=2.4.21-20.0.1.E
	initrd=/boot/initrd-2.4.21-20.0.1.EL.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-20.EL
	label=2.4.21-20.EL
	initrd=/boot/initrd-2.4.21-20.EL.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-20.ELsmp
	label=2.4.21-20.ELsmp
	initrd=/boot/initrd-2.4.21-20.ELsmp.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-15.0.4.ELsmp
	label=2.4.21-15.0.4.1
	initrd=/boot/initrd-2.4.21-15.0.4.ELsmp.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-15.0.4.EL
	label=2.4.21-15.0.4.E
	initrd=/boot/initrd-2.4.21-15.0.4.EL.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-15.0.3.ELsmp
	label=2.4.21-15.0.3.1
	initrd=/boot/initrd-2.4.21-15.0.3.ELsmp.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-15.0.3.EL
	label=2.4.21-15.0.3.E
	initrd=/boot/initrd-2.4.21-15.0.3.EL.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-15.0.2.ELsmp
	label=2.4.21-15.0.2.1
	initrd=/boot/initrd-2.4.21-15.0.2.ELsmp.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-15.0.2.EL
	label=2.4.21-15.0.2.E
	initrd=/boot/initrd-2.4.21-15.0.2.EL.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-15.ELsmp
	label=2.4.21-15.ELsmp
	initrd=/boot/initrd-2.4.21-15.ELsmp.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-15.EL
	label=2.4.21-15.EL
	initrd=/boot/initrd-2.4.21-15.EL.img
	read-only
	append="root=/dev/hda3"

image=/boot/vmlinuz-2.4.21-4.0.1.ELsmp
	label=2.4.21-4.0.1.E1
	initrd=/boot/initrd-2.4.21-4.0.1.ELsmp.img
	read-only
	append="root=LABEL=/"

image=/boot/vmlinuz-2.4.21-4.0.1.EL
	label=2.4.21-4.0.1.EL
	initrd=/boot/initrd-2.4.21-4.0.1.EL.img
	read-only
	append="root=LABEL=/"
 

ukpro

Active Member
Aug 25, 2004
28
0
151
Thanks

Hey guys, just want to say that this helped me out too.

Thanks
Liam
 

eglwolf

Well-Known Member
Jan 1, 2004
190
0
166
I am having the same problem and I ran those commands, however where can I tell which kernels to keep?

kernel-smp-2.6.5-1.358
kernel-smp-2.6.8-1.521
kernel-2.6.8-1.521
kernel-2.6.9-1.11_FC2
kernel-smp-2.6.9-1.11_FC2
kernel-utils-2.4-9.1.131_FC2
kernel-2.6.10-1.9_FC2
kernel-2.6.10-1.12_FC2
kernel-2.6.10-1.770_FC2
kernel-2.6.10-1.771_FC2
kernel-2.6.5-1.358
kernel-smp-2.6.10-1.9_FC2
kernel-smp-2.6.10-1.12_FC2
kernel-2.6.10-1.14_FC2
kernel-smp-2.6.10-1.14_FC2
kernel-smp-2.6.10-1.770_FC2
kernel-smp-2.6.10-1.771_FC2
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
If you isse the following:

uname -a

It will tell you which kernel you are running. You can basically delete any that are older (though it might be a good idea to keep the one immediately preceeding it).
 

webignition

Well-Known Member
Jan 22, 2005
1,876
2
166
I too am trying to clear out some old unnecessary kernels and am running into some slight problems when using rpm -e to remove old kernels.

Firstly, if I run rpm -qa | grep kernel-* I get:

Code:
kernel-2.4.21-27.0.4.EL
kernel-smp-2.4.21-27.0.4.EL
kernel-2.4.21-32.EL
kernel-pcmcia-cs-3.1.31-13
kernel-smp-2.4.21-27.0.2.EL
kernel-smp-2.4.21-32.EL
kernel-2.4.21-32.0.1.EL
kernel-utils-2.4-8.37.12
kernel-smp-2.4.21-27.0.1.EL
kernel-smp-2.4.21-32.0.1.EL
kernel-2.4.21-27.0.2.EL
From looking at the file modification dates, I figured that kernel-2.4.21-27.0.2.EL is not needed and so tried to remove it with rpm -e kernel-2.4.21-27.0.2.EL, resulting in:

Code:
[email protected] [~]# rpm -e kernel-2.4.21-27.0.2.EL
stdin: is not a tty
Not that I know why, but I think that stdin: is not a tty is not a good thing.

When I subsequently run rpm -qa | grep kernel-*, rpm -e kernel-2.4.21-27.0.2.EL is no longer listed however not all the files that I would expect get deleted from /boot.

It seems that the relevant initrd-*.img is deleted, but the relevant vmlinux-*, System.map-*, config-* and vmlinuz-* files remain (which, quite unfairly, tend to be the ones that take up the most space).

Any ideas as to what I'm doing wrong?
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
No, the TTY error is normal and you can ignore it the rrpm -e would have completed. Not sure about the leftover files - are you sure they don't beling to the SMP version of the kernel that is still installed?
 

DigitalN

Well-Known Member
Sep 23, 2004
419
1
168
I'd say if you need to be asking these questions then you shouldn't be uninstalling any kernels.. not to be rude but getting someone in to do it, such as an experienced admin, on a live box seems like a good option to start off with. Ask them what they did afterwards.
Posting these types of How to's on forums often leads to confusions and mistakes.

You can always practice on a spare box or one at home first before making any mistakes on a live server that could lead to an unbootable machine. Your NOC will thank you too maybe :)