LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Removing old kernels (https://www.linuxquestions.org/questions/linux-newbie-8/removing-old-kernels-921237/)

xjx424 12-30-2011 11:02 AM

Removing old kernels
 
Hi,
I'm pretty sure I know what I need to do but want to double check first.
I am not able to upgrade because my boot disk is full. I need to remove the unused kernels.

Here is what is currently in there.

Code:

drwxr-xr-x  4 root root    3072 2011-12-30 11:36 .
drwxr-xr-x 26 root root    4096 2011-12-06 12:59 ..
-rw-r--r--  1 root root  420395 2010-09-30 17:10 abi-2.6.24-23-server
-rw-r--r--  1 root root  420589 2011-02-11 15:15 abi-2.6.24-28-server
-rw-r--r--  1 root root  420763 2011-10-11 14:19 abi-2.6.24-29-server
-rw-r--r--  1 root root  420763 2011-11-28 14:08 abi-2.6.24-30-server
-rw-r--r--  1 root root  74171 2010-09-30 17:10 config-2.6.24-23-server
-rw-r--r--  1 root root  74233 2011-02-11 15:15 config-2.6.24-28-server
-rw-r--r--  1 root root  74233 2011-10-11 14:19 config-2.6.24-29-server
-rw-r--r--  1 root root  74233 2011-11-28 14:08 config-2.6.24-30-server
drwxr-xr-x  2 root root    1024 2011-12-08 09:17 grub
-rw-r--r--  1 root root 7517119 2010-09-30 17:10 initrd.img-2.6.24-23-server
-rw-r--r--  1 root root 7236602 2010-09-30 17:10 initrd.img-2.6.24-23-server.bak
-rw-r--r--  1 root root 7777632 2011-03-01 14:01 initrd.img-2.6.24-28-server
-rw-r--r--  1 root root 7777058 2011-03-01 13:58 initrd.img-2.6.24-28-server.bak
-rw-r--r--  1 root root 7775708 2011-10-26 14:58 initrd.img-2.6.24-29-server
-rw-r--r--  1 root root 7776238 2011-10-20 09:01 initrd.img-2.6.24-29-server.bak
-rw-r--r--  1 root root 7776454 2011-12-06 12:59 initrd.img-2.6.24-30-server
-rw-r--r--  1 root root 7776448 2011-12-06 12:59 initrd.img-2.6.24-30-server.bak
drwx------  2 root root  12288 2010-09-30 17:08 lost+found
-rw-r--r--  1 root root  103204 2010-09-30 17:10 memtest86+.bin
-rw-r--r--  1 root root 1163432 2010-09-30 17:10 System.map-2.6.24-23-server
-rw-r--r--  1 root root 1165041 2011-02-11 15:15 System.map-2.6.24-28-server
-rw-r--r--  1 root root 1165699 2011-10-11 14:19 System.map-2.6.24-29-server
-rw-r--r--  1 root root 1165739 2011-11-28 14:08 System.map-2.6.24-30-server
-rw-r--r--  1 root root 1930136 2010-09-30 17:10 vmlinuz-2.6.24-23-server
-rw-r--r--  1 root root 1934360 2011-02-11 15:15 vmlinuz-2.6.24-28-server
-rw-r--r--  1 root root 1934392 2011-10-11 14:19 vmlinuz-2.6.24-29-server
-rw-r--r--  1 root root 1934424 2011-11-28 14:08 vmlinuz-2.6.24-30-server

I then ran uname -a and got this, which I am thinking is the kernel I should keep
Code:

Linux websvr 2.6.24-23-server #1 SMP Wed Apr 1 22:14:30 UTC 2009 x86_64 GNU/Linux
Is -23 the only kernel I am using?
Is it OK to delete anything not ending in -23? (aside from grub, lost+found, etc.)
Finally, does anyone know why this is happening?
Thanks

theNbomr 12-30-2011 12:01 PM

In principle, yes, you can 'delete anything not ending in -23'. The uname command you ran shows which kernel is presently running, which is not the most recent of the installed kernels. You will probably need to update the bootloader config file to make the newly installed/upgraded kernel the default, otherwise your upgrade is a waste of time, as it appears earlier upgrades have been.

--- rod.

repo 12-30-2011 12:03 PM

I would suggest to use the package manager from your distribution.

Kind regards

xjx424 12-30-2011 12:37 PM

On this version of Ubuntu 8.04.4 it still uses the config file menu.lst
In that file is this section
Code:

title Ubuntu (2.6.24-23-server)
        root (hd0,0)
        kernel /vmlinuz-2.6.24-23-server root=UUID=b92ad2dc-8713-4c49-a077-f2567e6ce8b0 ro quiet splash
        initrd /initrd.img-2.6.24-23-server
        quiet

Do I just need to update the version with the most recent and reboot?

theNbomr 12-30-2011 03:01 PM

If that is the only entry, then that should do the trick. In distros I've used, the package manager usually adds a new entry, then updates the 'default' setting to point to the entry for the newly installed version. The default value of 'default' is zero, meaning the 'first' entry (confused yet?). I suggest you use that model, keeping the entry for the presently working version, and add a new entry for the new version, and leave the default as the current version. When you've convinced yourself that the new version works, make it the default.

--- rod.

syg00 12-30-2011 06:30 PM

Certainly do it from Synaptic - and use the "totally remove" (or whatever, I don't have Ubuntu handy) option to get rid of modules and ancillary bits and pieces.
However I suspect you are on a losing cause. Later Ubuntu will require quite a bit more space in /boot; and will fail even if you have plenty but not what the installer has been programmed to determine "enough". And no, I can't recall what that was. But I'd just resize that partition.
Coming from a gentoo background I tended to have a merely adequate sized /boot. Now I just go with the ludicrous requirements of the various distros - Fedora demand half a Gig for example.

rng 12-30-2011 07:33 PM

Install and use 'ubuntu-tweak' program from synaptic. Go to 'package cleaner' > 'clean kernels'. It should work.

opensourcewj 12-31-2011 02:51 AM

for ubuntu: sudo apt-get remove "your old kernel name"

for fedora: rpm -qa | grep kernel;
and then yum remove "your old kernel name"

xjx424 01-03-2012 10:38 AM

Thanks for you replies everyone


All times are GMT -5. The time now is 06:02 AM.