LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-18-2007, 10:35 AM   #1
apachenew
Member
 
Registered: Jul 2007
Posts: 30

Rep: Reputation: 15
Removing old kernels from /boot


Hello,

My boot partition is getting filled up after a number of kernel upgrades.
Is it okay to remove the old kernels from the /boot?
I see that the boot partition has config-..., initrd-..., System.map-..., and vmlinuz-...
Do I remove all 4 of them excluding the latest kernel?

Below is what my /boot looks like:
-rw-r--r-- 1 root root 49K Feb 24 2006 config-2.6.9-34.EL
-rw-r--r-- 1 root root 49K Feb 24 2006 config-2.6.9-34.ELsmp
-rw-r--r-- 1 root root 50K Feb 16 2007 config-2.6.9-42.0.10.EL
-rw-r--r-- 1 root root 49K Feb 16 2007 config-2.6.9-42.0.10.ELsmp
-rw-r--r-- 1 root root 50K Aug 17 2006 config-2.6.9-42.0.2.EL
-rw-r--r-- 1 root root 49K Aug 17 2006 config-2.6.9-42.0.2.ELsmp
-rw-r--r-- 1 root root 50K Sep 25 2006 config-2.6.9-42.0.3.EL
-rw-r--r-- 1 root root 49K Sep 25 2006 config-2.6.9-42.0.3.ELsmp
-rw-r--r-- 1 root root 50K Jan 23 2007 config-2.6.9-42.0.8.EL
-rw-r--r-- 1 root root 49K Jan 23 2007 config-2.6.9-42.0.8.ELsmp
-rw-r--r-- 1 root root 50K Jun 12 14:55 config-2.6.9-55.0.2.EL
-rw-r--r-- 1 root root 49K Jun 12 15:07 config-2.6.9-55.0.2.ELsmp
-rw-r--r-- 1 root root 50K Aug 23 08:08 config-2.6.9-55.0.6.EL
-rw-r--r-- 1 root root 49K Aug 23 08:19 config-2.6.9-55.0.6.ELsmp
drwxr-xr-x 2 root root 1.0K Sep 13 16:55 grub
-rw-r--r-- 1 root root 1.1M Aug 28 2006 initrd-2.6.9-34.EL.img
-rw-r--r-- 1 root root 1.1M Aug 28 2006 initrd-2.6.9-34.ELsmp.img
-rw-r--r-- 1 root root 1.1M Mar 6 2007 initrd-2.6.9-42.0.10.EL.img
-rw-r--r-- 1 root root 1.1M Mar 6 2007 initrd-2.6.9-42.0.10.ELsmp.img
-rw-r--r-- 1 root root 1.1M Sep 5 2006 initrd-2.6.9-42.0.2.EL.img
-rw-r--r-- 1 root root 1.1M Sep 5 2006 initrd-2.6.9-42.0.2.ELsmp.img
-rw-r--r-- 1 root root 1.1M Oct 13 2006 initrd-2.6.9-42.0.3.EL.img
-rw-r--r-- 1 root root 1.1M Oct 13 2006 initrd-2.6.9-42.0.3.ELsmp.img
-rw-rw-r-- 1 root root 1.1M Feb 16 2007 initrd-2.6.9-42.0.8.EL.img
-rw-rw-r-- 1 root root 1.1M Feb 16 2007 initrd-2.6.9-42.0.8.ELsmp.img
-rw-r--r-- 1 root root 1.3M Jul 3 18:25 initrd-2.6.9-55.0.2.EL.img
-rw-r--r-- 1 root root 1.3M Jul 3 18:27 initrd-2.6.9-55.0.2.ELsmp.img
-rw-r--r-- 1 root root 1.3M Sep 13 16:54 initrd-2.6.9-55.0.6.EL.img
-rw-r--r-- 1 root root 1.3M Sep 13 16:55 initrd-2.6.9-55.0.6.ELsmp.img
drwx------ 2 root root 12K Aug 28 2006 lost+found
-rw-r--r-- 1 root root 23K Aug 3 2005 message
-rw-r--r-- 1 root root 21K Aug 3 2005 message.ja
-rw-r--r-- 1 root root 717K Feb 24 2006 System.map-2.6.9-34.EL
-rw-r--r-- 1 root root 744K Feb 24 2006 System.map-2.6.9-34.ELsmp
-rw-r--r-- 1 root root 734K Feb 16 2007 System.map-2.6.9-42.0.10.EL
-rw-r--r-- 1 root root 750K Feb 16 2007 System.map-2.6.9-42.0.10.ELsmp
-rw-r--r-- 1 root root 732K Aug 17 2006 System.map-2.6.9-42.0.2.EL
-rw-r--r-- 1 root root 749K Aug 17 2006 System.map-2.6.9-42.0.2.ELsmp
-rw-r--r-- 1 root root 732K Sep 25 2006 System.map-2.6.9-42.0.3.EL
-rw-r--r-- 1 root root 749K Sep 25 2006 System.map-2.6.9-42.0.3.ELsmp
-rw-r--r-- 1 root root 734K Jan 23 2007 System.map-2.6.9-42.0.8.EL
-rw-r--r-- 1 root root 750K Jan 23 2007 System.map-2.6.9-42.0.8.ELsmp
-rw-r--r-- 1 root root 737K Jun 12 14:55 System.map-2.6.9-55.0.2.EL
-rw-r--r-- 1 root root 754K Jun 12 15:07 System.map-2.6.9-55.0.2.ELsmp
-rw-r--r-- 1 root root 738K Aug 23 08:08 System.map-2.6.9-55.0.6.EL
-rw-r--r-- 1 root root 754K Aug 23 08:19 System.map-2.6.9-55.0.6.ELsmp
-rw-r--r-- 1 root root 1.5M Feb 24 2006 vmlinuz-2.6.9-34.EL
-rw-r--r-- 1 root root 1.4M Feb 24 2006 vmlinuz-2.6.9-34.ELsmp
-rw-r--r-- 1 root root 1.5M Feb 16 2007 vmlinuz-2.6.9-42.0.10.EL
-rw-r--r-- 1 root root 1.4M Feb 16 2007 vmlinuz-2.6.9-42.0.10.ELsmp
-rw-r--r-- 1 root root 1.5M Aug 17 2006 vmlinuz-2.6.9-42.0.2.EL
-rw-r--r-- 1 root root 1.4M Aug 17 2006 vmlinuz-2.6.9-42.0.2.ELsmp
-rw-r--r-- 1 root root 1.5M Sep 25 2006 vmlinuz-2.6.9-42.0.3.EL
-rw-r--r-- 1 root root 1.4M Sep 25 2006 vmlinuz-2.6.9-42.0.3.ELsmp
-rw-r--r-- 1 root root 1.5M Jan 23 2007 vmlinuz-2.6.9-42.0.8.EL
-rw-r--r-- 1 root root 1.4M Jan 23 2007 vmlinuz-2.6.9-42.0.8.ELsmp
-rw-r--r-- 1 root root 1.5M Jun 12 14:55 vmlinuz-2.6.9-55.0.2.EL
-rw-r--r-- 1 root root 1.4M Jun 12 15:07 vmlinuz-2.6.9-55.0.2.ELsmp
-rw-r--r-- 1 root root 1.5M Aug 23 08:08 vmlinuz-2.6.9-55.0.6.EL
-rw-r--r-- 1 root root 1.4M Aug 23 08:19 vmlinuz-2.6.9-55.0.6.ELsmp
 
Old 09-18-2007, 11:23 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Yeah, you can remove the old kernels and associated files if you don't plan to use them. I always keep the kernel I've most recently compiled and at least one older, known working kernel (usually the one I had been using just before recompiling). Once you've used the new kernel for awhile and feel that it doesn't have any issues, you can remove the older one.

You may also want to delete the lines for the removed kernels from the menu.lst/grub.conf so they don't appear in the boot menu.
 
Old 09-18-2007, 11:35 AM   #3
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Code:
#rpm -qa | grep -i kernel
That will show a list of kernel related packages. Uninstall the kernels you do not need by doing
Code:
#rpm -e kernel-{VERSION}
That will also remove their entries from grub.
 
Old 09-19-2007, 11:21 AM   #4
apachenew
Member
 
Registered: Jul 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks for the info guys!
 
Old 09-19-2007, 09:01 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
To recap...

The /boot partition normally contains both (1) the boot-loader program .. these days usually Grub .. which loads the Linux kernel, and (2) the various kernel-image files themselves. This is, basically, how and where the "always-resident software known as 'the Linux kernel'" manages to get into the memory of your computer when you first turn it on.

Usually, you are given a choice of exactly which version of the kernel you want to run, when you start your machine. This is so that, if something's wrong with "the latest" one, you can easily fall-back to "the previous" one. Kernel updates, therefore, usually do not remove "the previous" version. And eventually the /boot partition begins to run out of room.

When you are using a package-based system such as rpm, it is important that you continue to use that package-based system when you want to "clean house." You should explicitly un-install the previous versions... don't just remove the files yourself. This will keep the package-system's database up-to-date as to what is actually present on your system and what is not. When you uninstall the older packages, you should see the older files disappear from /boot.
 
0 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Old Kernels carlosinfl Debian 7 03-03-2006 12:10 PM
Removing old kernels? carlosinfl Fedora 1 04-12-2005 09:58 AM
Removing old kernels mike270 Linux - Software 6 08-07-2004 09:05 PM
Removing old kernels dbzw Linux - Newbie 5 02-29-2004 12:01 PM
Re: Removing old kernels jong357 Linux - General 1 02-29-2004 07:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration