/boot Partition suddenly get full

Asked by ramesh raman

My boot partition suddenly get full. Kindly advise me what can i do for this issue. We are running two production server.
Find the server disk space details What action can i take for this. I am using 10.04 LTS ubuntu server version.

jaiken@351967-app2:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg1-lv_root
                      7.4G 1.2G 5.8G 18% /
none 6.0G 200K 6.0G 1% /dev
tmpfs 6.0G 0 6.0G 0% /dev/shm
none 6.0G 116K 6.0G 1% /var/run
none 6.0G 0 6.0G 0% /var/lock
none 6.0G 0 6.0G 0% /lib/init/rw
/dev/mapper/vg1-lv_tmp
                      4.6G 410M 4.0G 10% /tmp
/dev/sda1 184M 170M 4.9M 98% /boot
/dev/mapper/vg1-lv_home
                       14G 2.2G 11G 17% /home
/dev/mapper/vg1-lv_usr
                      4.6G 1.8G 2.7G 40% /usr
/dev/mapper/vg1-lv_var
                       28G 18G 8.4G 68% /var
192.168.100.143:/localdatastore/backup/database
                      114G 50G 58G 47% /home/pharma/backup
/dev/sda3 158G 42G 108G 29% /database

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu ntp Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
ramesh raman (rbmramesh) said :
#1

Hi Team,

This is the details of kernel and /boot partition detail.

jaiken@351967-app2:~$ uname -a
Linux 351967-app2 2.6.32-42-generic-pae #95-Ubuntu SMP Wed Jul 25 16:13:09
UTC 2012 i686 GNU/Linux
jaiken@351967-app2:~$ ll /boot/
total 166843
drwxr-xr-x 4 root root 5120 2013-05-15 06:29 ./
drwxr-xr-x 23 root root 4096 2013-05-15 06:29 ../
-rw-r--r-- 1 root root 655872 2011-12-03 02:29 abi-2.6.32-37-generic-pae
-rw-r--r-- 1 root root 655978 2012-01-04 14:39 abi-2.6.32-38-generic-pae
-rw-r--r-- 1 root root 656085 2012-02-14 02:16 abi-2.6.32-39-generic-pae
-rw-r--r-- 1 root root 656137 2012-03-06 00:56 abi-2.6.32-40-generic-pae
-rw-r--r-- 1 root root 656323 2012-06-13 13:51 abi-2.6.32-41-generic-pae
-rw-r--r-- 1 root root 656323 2012-08-15 21:03 abi-2.6.32-42-generic-pae
-rw-r--r-- 1 root root 656323 2012-09-05 18:55 abi-2.6.32-43-generic-pae
-rw-r--r-- 1 root root 656323 2012-09-24 19:39 abi-2.6.32-44-generic-pae
-rw-r--r-- 1 root root 656541 2013-02-19 22:28 abi-2.6.32-45-generic-pae
-rw-r--r-- 1 root root 656541 2013-04-11 18:07 abi-2.6.32-46-generic-pae
-rw-r--r-- 1 root root 656541 2013-05-07 04:15 abi-2.6.32-47-generic-pae
-rw-r--r-- 1 root root 116480 2011-12-03 02:29
config-2.6.32-37-generic-pae
-rw-r--r-- 1 root root 116469 2012-01-04 14:39
config-2.6.32-38-generic-pae
-rw-r--r-- 1 root root 116469 2012-02-14 02:16
config-2.6.32-39-generic-pae
-rw-r--r-- 1 root root 116469 2012-03-06 00:56
config-2.6.32-40-generic-pae
-rw-r--r-- 1 root root 116469 2012-06-13 13:51
config-2.6.32-41-generic-pae
-rw-r--r-- 1 root root 116469 2012-08-15 21:03
config-2.6.32-42-generic-pae
-rw-r--r-- 1 root root 116469 2012-09-05 18:55
config-2.6.32-43-generic-pae
-rw-r--r-- 1 root root 116469 2012-09-24 19:39
config-2.6.32-44-generic-pae
-rw-r--r-- 1 root root 116491 2013-02-19 22:28
config-2.6.32-45-generic-pae
-rw-r--r-- 1 root root 116491 2013-04-11 18:07
config-2.6.32-46-generic-pae
-rw-r--r-- 1 root root 116491 2013-05-07 04:15
config-2.6.32-47-generic-pae
drwxr-xr-x 3 root root 6144 2013-05-15 06:29 grub/
-rw-r--r-- 1 root root 8749276 2011-12-22 16:25
initrd.img-2.6.32-37-generic-pae
-rw-r--r-- 1 root root 8749369 2012-01-25 06:51
initrd.img-2.6.32-38-generic-pae
-rw-r--r-- 1 root root 8749320 2012-03-06 06:35
initrd.img-2.6.32-39-generic-pae
-rw-r--r-- 1 root root 8749037 2012-03-23 06:44
initrd.img-2.6.32-40-generic-pae
-rw-r--r-- 1 root root 8749850 2012-06-30 07:33
initrd.img-2.6.32-41-generic-pae
-rw-r--r-- 1 root root 8751033 2012-09-05 07:51
initrd.img-2.6.32-42-generic-pae
-rw-r--r-- 1 root root 8750751 2012-09-18 07:37
initrd.img-2.6.32-43-generic-pae
-rw-r--r-- 1 root root 8760727 2012-10-12 07:43
initrd.img-2.6.32-44-generic-pae
-rw-r--r-- 1 root root 8759033 2013-02-22 06:57
initrd.img-2.6.32-45-generic-pae
-rw-r--r-- 1 root root 8759069 2013-04-19 06:34
initrd.img-2.6.32-46-generic-pae
-rw-r--r-- 1 root root 8758785 2013-05-15 06:29
initrd.img-2.6.32-47-generic-pae
drwx------ 2 root root 12288 2011-12-22 12:32 lost+found/
-rw-r--r-- 1 root root 160280 2010-03-23 09:37 memtest86+.bin
-rw-r--r-- 1 root root 1732596 2011-12-03 02:29
System.map-2.6.32-37-generic-pae
-rw-r--r-- 1 root root 1733711 2012-01-04 14:39
System.map-2.6.32-38-generic-pae
-rw-r--r-- 1 root root 1734310 2012-02-14 02:16
System.map-2.6.32-39-generic-pae
-rw-r--r-- 1 root root 1734549 2012-03-06 00:56
System.map-2.6.32-40-generic-pae
-rw-r--r-- 1 root root 1735307 2012-06-13 13:51
System.map-2.6.32-41-generic-pae
-rw-r--r-- 1 root root 1735360 2012-08-15 21:03
System.map-2.6.32-42-generic-pae
-rw-r--r-- 1 root root 1735360 2012-09-05 18:55
System.map-2.6.32-43-generic-pae
-rw-r--r-- 1 root root 1735360 2012-09-24 19:39
System.map-2.6.32-44-generic-pae
-rw-r--r-- 1 root root 1736550 2013-02-19 22:28
System.map-2.6.32-45-generic-pae
-rw-r--r-- 1 root root 1736550 2013-04-11 18:07
System.map-2.6.32-46-generic-pae
-rw-r--r-- 1 root root 1736550 2013-05-07 04:15
System.map-2.6.32-47-generic-pae
-rw-r--r-- 1 root root 1200 2011-12-03 02:31
vmcoreinfo-2.6.32-37-generic-pae
-rw-r--r-- 1 root root 1200 2012-01-04 14:40
vmcoreinfo-2.6.32-38-generic-pae
-rw-r--r-- 1 root root 1200 2012-02-14 02:17
vmcoreinfo-2.6.32-39-generic-pae
-rw-r--r-- 1 root root 1200 2012-03-06 00:57
vmcoreinfo-2.6.32-40-generic-pae
-rw-r--r-- 1 root root 1200 2012-06-13 13:52
vmcoreinfo-2.6.32-41-generic-pae
-rw-r--r-- 1 root root 1200 2012-08-15 21:03
vmcoreinfo-2.6.32-42-generic-pae
-rw-r--r-- 1 root root 1200 2012-09-05 18:56
vmcoreinfo-2.6.32-43-generic-pae
-rw-r--r-- 1 root root 1200 2012-09-24 19:39
vmcoreinfo-2.6.32-44-generic-pae
-rw-r--r-- 1 root root 1200 2013-02-19 22:28
vmcoreinfo-2.6.32-45-generic-pae
-rw-r--r-- 1 root root 1200 2013-04-11 18:08
vmcoreinfo-2.6.32-46-generic-pae
-rw-r--r-- 1 root root 1200 2013-05-07 04:17
vmcoreinfo-2.6.32-47-generic-pae
-rw-r--r-- 1 root root 4174688 2011-12-03 02:29
vmlinuz-2.6.32-37-generic-pae
-rw-r--r-- 1 root root 4179712 2012-01-04 14:39
vmlinuz-2.6.32-38-generic-pae
-rw-r--r-- 1 root root 4181888 2012-02-14 02:16
vmlinuz-2.6.32-39-generic-pae
-rw-r--r-- 1 root root 4181984 2012-03-06 00:56
vmlinuz-2.6.32-40-generic-pae
-rw-r--r-- 1 root root 4184384 2012-06-13 13:51
vmlinuz-2.6.32-41-generic-pae
-rw-r--r-- 1 root root 4182912 2012-08-15 21:03
vmlinuz-2.6.32-42-generic-pae
-rw-r--r-- 1 root root 4183264 2012-09-05 18:55
vmlinuz-2.6.32-43-generic-pae
-rw-r--r-- 1 root root 4183008 2012-09-24 19:39
vmlinuz-2.6.32-44-generic-pae
-rw-r--r-- 1 root root 4186336 2013-02-19 22:28
vmlinuz-2.6.32-45-generic-pae
-rw-r--r-- 1 root root 4186528 2013-04-11 18:07
vmlinuz-2.6.32-46-generic-pae
-rw-r--r-- 1 root root 4186464 2013-05-07 04:15
vmlinuz-2.6.32-47-generic-pae
jaiken@351967-app2:~$

Hi team please give me some advise this is production server.

On Thu, May 16, 2013 at 3:31 PM, ramesh raman <
<email address hidden>> wrote:

> New question #229013 on ntp in Ubuntu:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> My boot partition suddenly get full. Kindly advise me what can i do for
> this issue. We are running two production server.
> Find the server disk space details What action can i take for this. I am
> using 10.04 LTS ubuntu server version.
>
> jaiken@351967-app2:~$ df -h
> Filesystem Size Used Avail Use% Mounted on
> /dev/mapper/vg1-lv_root
> 7.4G 1.2G 5.8G 18% /
> none 6.0G 200K 6.0G 1% /dev
> tmpfs 6.0G 0 6.0G 0% /dev/shm
> none 6.0G 116K 6.0G 1% /var/run
> none 6.0G 0 6.0G 0% /var/lock
> none 6.0G 0 6.0G 0% /lib/init/rw
> /dev/mapper/vg1-lv_tmp
> 4.6G 410M 4.0G 10% /tmp
> /dev/sda1 184M 170M 4.9M 98% /boot
> /dev/mapper/vg1-lv_home
> 14G 2.2G 11G 17% /home
> /dev/mapper/vg1-lv_usr
> 4.6G 1.8G 2.7G 40% /usr
> /dev/mapper/vg1-lv_var
> 28G 18G 8.4G 68% /var
> 192.168.100.143:/localdatastore/backup/database
> 114G 50G 58G 47% /home/pharma/backup
> /dev/sda3 158G 42G 108G 29% /database
>
> --
> You received this question notification because you asked the question.
>

--
Regards

Ramesh R

Revision history for this message
ramesh raman (rbmramesh) said :
#2

Hi Team,

I am expecting your valuable answers for this issue. I a waiting for your reply

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

What is the output of:

uname -a; lsb_release -a; dpkg -l | grep linux-image

Thanks

Revision history for this message
ramesh raman (rbmramesh) said :
#5

Hi Team,

Please find the output from two production servers.

root@live:~# uname -a; lsb_release -a; dpkg -l | grep linux-image
Linux live.pharmalife.co.uk 2.6.32-42-generic-pae #95-Ubuntu SMP Wed Jul 25
16:13:09 UTC 2012 i686 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid
ii linux-image-2.6.32-37-generic-pae 2.6.32-37.81
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-38-generic-pae 2.6.32-38.83
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-39-generic-pae 2.6.32-39.86
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-40-generic-pae 2.6.32-40.87
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-41-generic-pae 2.6.32-41.91
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-42-generic-pae 2.6.32-42.96
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-43-generic-pae 2.6.32-43.97
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-44-generic-pae 2.6.32-44.98
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-45-generic-pae 2.6.32-45.104
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-46-generic-pae 2.6.32-46.108
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-47-generic-pae 2.6.32-47.109
Linux kernel image for version 2.6.32 on x86
ii linux-image-generic-pae 2.6.32.47.54
Generic Linux kernel image
root@live:~#

Another one server

jaiken@351967-app2:~$ uname -a; lsb_release -a; dpkg -l | grep linux-image
Linux 351967-app2 2.6.32-42-generic-pae #95-Ubuntu SMP Wed Jul 25 16:13:09
UTC 2012 i686 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid
ii linux-image-2.6.32-37-generic-pae 2.6.32-37.81
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-38-generic-pae 2.6.32-38.83
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-39-generic-pae 2.6.32-39.86
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-40-generic-pae 2.6.32-40.87
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-41-generic-pae 2.6.32-41.91
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-42-generic-pae 2.6.32-42.96
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-43-generic-pae 2.6.32-43.97
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-44-generic-pae 2.6.32-44.98
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-45-generic-pae 2.6.32-45.104
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-46-generic-pae 2.6.32-46.108
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-47-generic-pae 2.6.32-47.109
Linux kernel image for version 2.6.32 on x86
ii linux-image-generic-pae 2.6.32.47.54
Generic Linux kernel image
jaiken@351967-app2:~$

On Thu, May 16, 2013 at 5:21 PM, actionparsnip <
<email address hidden>> wrote:

> Your question #229013 on ntp in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> Status: Open => Needs information
>
> actionparsnip requested more information:
> What is the output of:
>
> uname -a; lsb_release -a; dpkg -l | grep linux-image
>
> Thanks
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> You received this question notification because you asked the question.
>

--
Regards

Ramesh R

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#6

The bash shell script below allows you to easily remove GNU/Linux kernels.

I suggest saving the script below as the file removekernel.bash and then making the file removekernel.bash executable:

#!/bin/bash
# TYPE: Bash script.
# PURPOSE: This bash shell script allows to easily remove GNU/Linux kernels.
# The script should be copied to /usr/bin/removekernel and set as executable.
# It is a poor man's alternative to Ubuntu Tweak.
# REQUIRES: bash, Ubuntu 10.04 LTS or newer
# REVISED: 20130302
# REVISED: 20130502
# AUTHOR: Mark Rijckenberg

if [[ $1 == "" ]]; then
echo "List of currently installed kernel .deb packages:"
dpkg --list | grep linux-image | egrep '^[r,i]i' | cut -d" " -f3
echo "No argument added after removekernel command"
echo "Please enter kernel package to uninstall from your pc (for example: linux-image-3.9.0-030900rc5-generic) "
read KERNELVERSION

echo "Removing kernel package $KERNELVERSION"
apt-cache search $KERNELVERSION|cut -d" " -f1|xargs sudo apt-get remove -y

else
echo "Removing kernel package $1"
apt-cache search $1|cut -d" " -f1|xargs sudo apt-get remove -y
fi

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

Lucid desktop is also EOL, I suggest you upgrade sooner rather than later to Precise which is LTS and supported til April 2017

Revision history for this message
ramesh raman (rbmramesh) said :
#8

Hi Mark,

Can i use this script in production servers(Now it is continuously
accessing by client).
Shall i do now. It may be affect the server performance or any other issues
will come.
Another one question. I already installed bash sh in the server . Is it
enough to run the script.

Regads,.
Ramesh

On Thu, May 16, 2013 at 6:06 PM, actionparsnip <
<email address hidden>> wrote:

> Your question #229013 on ntp in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> actionparsnip proposed the following answer:
> Lucid desktop is also EOL, I suggest you upgrade sooner rather than
> later to Precise which is LTS and supported til April 2017
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013/+confirm?answer_id=6
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> You received this question notification because you asked the question.
>

--
Regards

Ramesh R

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#9

If you want to decrease any risks in production, I recommend running the script outside of office hours, when nobody is using the servers.

If bash is installed on the server, then you will be able to execute the script.

First make sure to set the script as executable by using this command:

sudo chmod +x removekernel.bash

if you saved the script using filename removekernel.bash

Revision history for this message
ramesh raman (rbmramesh) said :
#10

Hi Mark,
Sorry for the late response.
1.What are the images i need to remove from the server.
2.Do u suggest me reboot a production server once the image is removed.(I
need to reboot a server after removed images or before removing images).

Kindly advise me in this issue.
Thanks in advance

Ramesh

On Thu, May 16, 2013 at 7:21 PM, Mark Rijckenberg <
<email address hidden>> wrote:

> Your question #229013 on ntp in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> Status: Open => Answered
>
> Mark Rijckenberg proposed the following answer:
> If you want to decrease any risks in production, I recommend running the
> script outside of office hours, when nobody is using the servers.
>
> If bash is installed on the server, then you will be able to execute the
> script.
>
> First make sure to set the script as executable by using this command:
>
> sudo chmod +x removekernel.bash
>
> if you saved the script using filename removekernel.bash
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013/+confirm?answer_id=8
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> You received this question notification because you asked the question.
>

--
Regards

Ramesh R

Revision history for this message
samuel (samuel-h) said :
#11

A reeboot shouldn't be nesscarry as the images are not in use anymore. I'd just remove all non used images with this handy one-liner:
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#12

Be EXTREMELY careful with the command given by samuel.

I just tested the command on my laptop and it was ready to delete 1100 MB worth of packages (more than 144 packages) without asking.

You do not need to reboot after removing the kernel packages.

Remember: this is GNU/Linux, not Windows ;-)

I suggest deleting the old kernels that your servers are not using anymore.

Revision history for this message
ramesh raman (rbmramesh) said :
#13

Hi Mark,

Could you please explain how to execute the samuel command.
From the below details .How to remove unwanted kernel. Can you give me step
by step procedure.

Please find the output from two production servers.

root@live:~# uname -a; lsb_release -a; dpkg -l | grep linux-image
Linux live.pharmalife.co.uk 2.6.32-42-generic-pae #95-Ubuntu SMP Wed Jul 25
16:13:09 UTC 2012 i686 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid
ii linux-image-2.6.32-37-generic-
pae 2.6.32-37.81 Linux kernel image for version
2.6.32 on x86
ii linux-image-2.6.32-38-generic-pae 2.6.32-38.83
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-39-generic-pae 2.6.32-39.86
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-40-generic-pae 2.6.32-40.87
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-41-generic-pae 2.6.32-41.91
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-42-generic-pae 2.6.32-42.96
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-43-generic-pae 2.6.32-43.97
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-44-generic-pae 2.6.32-44.98
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-45-generic-pae 2.6.32-45.104
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-46-generic-pae 2.6.32-46.108
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-47-generic-pae 2.6.32-47.109
Linux kernel image for version 2.6.32 on x86
ii linux-image-generic-pae 2.6.32.47.54
Generic Linux kernel image
root@live:~#

Another one server

jaiken@351967-app2:~$ uname -a; lsb_release -a; dpkg -l | grep linux-image

Linux 351967-app2 2.6.32-42-generic-pae #95-Ubuntu SMP Wed Jul 25 16:13:09
UTC 2012 i686 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid
ii linux-image-2.6.32-37-generic-
pae 2.6.32-37.81 Linux kernel image for version
2.6.32 on x86
ii linux-image-2.6.32-38-generic-pae 2.6.32-38.83
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-39-generic-pae 2.6.32-39.86
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-40-generic-pae 2.6.32-40.87
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-41-generic-pae 2.6.32-41.91
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-42-generic-pae 2.6.32-42.96
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-43-generic-pae 2.6.32-43.97
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-44-generic-pae 2.6.32-44.98
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-45-generic-pae 2.6.32-45.104
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-46-generic-pae 2.6.32-46.108
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-47-generic-pae 2.6.32-47.109
Linux kernel image for version 2.6.32 on x86
ii linux-image-generic-pae 2.6.32.47.54
Generic Linux kernel image
jaiken@351967-app2:~$

Thanks in advance

On Thu, May 16, 2013 at 10:36 PM, Mark Rijckenberg <
<email address hidden>> wrote:

> Your question #229013 on ntp in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> Mark Rijckenberg proposed the following answer:
> Be EXTREMELY careful with the command given by samuel.
>
> I just tested the command on my laptop and it was ready to delete 1100
> MB worth of packages (more than 144 packages) without asking.
>
> You do not need to reboot after removing the kernel packages.
>
> Remember: this is GNU/Linux, not Windows ;-)
>
> I suggest deleting the old kernels that your servers are not using
> anymore.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013/+confirm?answer_id=11
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> You received this question notification because you asked the question.
>

--
Regards

Ramesh R

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#14

I discovered the following safer form of the command:

sudo dpkg -l 'linux-*' | grep -v libc | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

How to access the Terminal:

In Gnome (classic)

If you are using the Gnome interface, via "Applications->Accessories->Terminal"

In Unity

If you are using the Unity interface, the easiest way to open the Terminal is to use the 'search' function on the dash. Or you can click on the 'More Apps' button, click on the 'See more results' by the installed section, and find it in that list of applications. A third way, available after you click on the 'More Apps' button, is to go to the search bar, and see that the far right end of it says 'All Applications'. You then click on that, and you'll see the full list. Then you can go to Accessories > Terminal after that. So, the methods in Unity are:

Press CTRL-ALT-T key combination.

Dash > Search for Terminal

Dash > More Apps > 'See More Results' > Terminal

Dash > More Apps > Accessories > Terminal

Please copy-paste the command above into the Terminal to remove all previous kernels.

Tip: If you have a wheel mouse or 3 button mouse you do not need to type commands into the Terminal. Highlight the command on the page using the mouse. Move your cursor anywhere in the Terminal and press the wheel or middle button to paste the command.

Hit the <enter> key after copy-pasting into the Terminal.

Revision history for this message
ramesh raman (rbmramesh) said :
#15

Hi Mark,

We have gone through the below link,
http://markmcb.com/2013/02/04/cleanup-unused-linux-kernels-in-ubuntu/

Please note the article says *"Only run this if you’ve rebooted after
installing a new kernel*".

The Server is updated with new kernel, is it advisable to remove the old
kernel image without installing and rebooting the new kernel? please advice.

Thanks in Advance.

On Fri, May 17, 2013 at 12:41 AM, Mark Rijckenberg <
<email address hidden>> wrote:

> Your question #229013 on ntp in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> Status: Open => Answered
>
> Mark Rijckenberg proposed the following answer:
> I discovered the following safer form of the command:
>
> sudo dpkg -l 'linux-*' | grep -v libc | sed '/^ii/!d;/'"$(uname -r | sed
> "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^
> ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
>
> How to access the Terminal:
>
> In Gnome (classic)
>
> If you are using the Gnome interface, via
> "Applications->Accessories->Terminal"
>
> In Unity
>
> If you are using the Unity interface, the easiest way to open the
> Terminal is to use the 'search' function on the dash. Or you can click
> on the 'More Apps' button, click on the 'See more results' by the
> installed section, and find it in that list of applications. A third
> way, available after you click on the 'More Apps' button, is to go to
> the search bar, and see that the far right end of it says 'All
> Applications'. You then click on that, and you'll see the full list.
> Then you can go to Accessories > Terminal after that. So, the methods in
> Unity are:
>
> Press CTRL-ALT-T key combination.
>
> Dash > Search for Terminal
>
> Dash > More Apps > 'See More Results' > Terminal
>
> Dash > More Apps > Accessories > Terminal
>
> Please copy-paste the command above into the Terminal to remove all
> previous kernels.
>
> Tip: If you have a wheel mouse or 3 button mouse you do not need to type
> commands into the Terminal. Highlight the command on the page using the
> mouse. Move your cursor anywhere in the Terminal and press the wheel or
> middle button to paste the command.
>
> Hit the <enter> key after copy-pasting into the Terminal.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013/+confirm?answer_id=13
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> You received this question notification because you asked the question.
>

--
Regards

Ramesh R

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#16

No, you need to reboot into the newest Linux kernel and thoroughly test it before uninstalling the old kernels.

That is my humble opinion.

Revision history for this message
ramesh raman (rbmramesh) said :
#17

Hi MArk,
I tested in my UAT server. But it is not working. Please see the output
report .

root@gims-we-testbed2:/boot# uname -a; lsb_release -a; dpkg -l | grep
linux-image
Linux gims-we-testbed2 2.6.32-47-generic-pae #109-Ubuntu SMP Tue May 7
02:19:47 UTC 2013 i686 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.4 LTS
Release: 10.04
Codename: lucid
rc linux-image-2.6.32-33-generic-pae 2.6.32-33.72
Linux kernel image for version 2.6.32 on x86
rc linux-image-2.6.32-38-generic-pae 2.6.32-38.83
Linux kernel image for version 2.6.32 on x86
rc linux-image-2.6.32-39-generic-pae 2.6.32-39.86
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-40-generic-pae 2.6.32-40.87
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-41-generic-pae 2.6.32-41.94
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-42-generic-pae 2.6.32-42.96
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-45-generic-pae 2.6.32-45.104
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-46-generic-pae 2.6.32-46.108
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-47-generic-pae 2.6.32-47.109
Linux kernel image for version 2.6.32 on x86
ii linux-image-generic-pae 2.6.32.47.54
Generic Linux kernel image
root@gims-we-testbed2:/boot# sudo dpkg -l 'linux-*' | grep -v libc | sed
'/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^
]* \([^]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
sed: -e expression #1, char 68: unterminated `s' command
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer
required:
  linux-headers-2.6.32-45 linux-headers-2.6.32-46
linux-headers-2.6.32-45-generic-pae linux-headers-2.6.32-46-generic-pae
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
root@gims-we-testbed2:/boot# cd /boot/
root@gims-we-testbed2:/boot# du -shm * | sort -nr |
head
8 initrd.img-2.6.32-47-generic-pae
8 initrd.img-2.6.32-46-generic-pae
8 initrd.img-2.6.32-45-generic-pae
8 initrd.img-2.6.32-42-generic-pae
8 initrd.img-2.6.32-41-generic-pae
8 initrd.img-2.6.32-40-generic-pae
5 grub
4 vmlinuz-2.6.32-47-generic-pae
4 vmlinuz-2.6.32-46-generic-pae
4 vmlinuz-2.6.32-45-generic-pae

But i tried ur remove script it is working fine .Please what can do next.
Kindly advise me.

Thanks in advance

On Fri, May 17, 2013 at 2:46 PM, Mark Rijckenberg <
<email address hidden>> wrote:

> Your question #229013 on ntp in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> Status: Open => Answered
>
> Mark Rijckenberg proposed the following answer:
> No, you need to reboot into the newest Linux kernel and thoroughly test
> it before uninstalling the old kernels.
>
> That is my humble opinion.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013/+confirm?answer_id=15
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> You received this question notification because you asked the question.
>

--
Regards

Ramesh R

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#18

I have created the following kernel removal script which might be a bit more user-friendly.

I have no further suggestions to make.

#!/bin/bash
# TYPE: Bash script.
# PURPOSE: This bash shell script allows to easily remove GNU/Linux kernels.
# The script should be copied to /usr/bin/removekernel.bash and set as executable.
# It is a poor man's alternative to Ubuntu Tweak.
# REQUIRES: bash, Ubuntu 10.04 LTS or newer
# REVISED: 20130517
# AUTHOR: Mark Rijckenberg

   echo "Please press one of the 4 numbers below and then hit the <ENTER> key to execute"

select CHOICE in list-installed-kernels remove-a-specific-kernel remove-all-previous-kernels quit
   do
case "$CHOICE" in

     list-installed-kernels)

     echo "List of currently installed Linux kernels"
     dpkg --list | grep linux-image | egrep '^[r,i]i' | cut -d" " -f3

     ;;
     remove-a-specific-kernel)

     echo "List of currently installed Linux kernels"
     dpkg --list | grep linux-image | egrep '^[r,i]i' | cut -d" " -f3
     echo "Please enter kernel package to uninstall from your pc (for example: linux-image-3.9.0-030900rc5-generic) "
     read KERNELVERSION
     apt-cache search $KERNELVERSION|cut -d" " -f1|xargs sudo apt-get remove -y

     ;;
     remove-all-previous-kernels)

     echo "Will now purge all the following kernel packages:"
     dpkg -l 'linux-*' | grep -v libc| sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
     dpkg -l 'linux-*' | grep -v libc| sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

     ;;
     quit)

     exit

     ;;
        esac

done

Revision history for this message
ramesh raman (rbmramesh) said :
#19

Hi Mark,

Thanks for your support. I will try with this script.

Regards,
Ramesh R

On Fri, May 17, 2013 at 4:01 PM, Mark Rijckenberg <
<email address hidden>> wrote:

> Your question #229013 on ntp in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> Status: Open => Answered
>
> Mark Rijckenberg proposed the following answer:
> I have created the following kernel removal script which might be a bit
> more user-friendly.
>
> I have no further suggestions to make.
>
> #!/bin/bash
> # TYPE: Bash script.
> # PURPOSE: This bash shell script allows to easily remove GNU/Linux
> kernels.
> # The script should be copied to /usr/bin/removekernel.bash and set as
> executable.
> # It is a poor man's alternative to Ubuntu Tweak.
> # REQUIRES: bash, Ubuntu 10.04 LTS or newer
> # REVISED: 20130517
> # AUTHOR: Mark Rijckenberg
>
> echo "Please press one of the 4 numbers below and then hit the
> <ENTER> key to execute"
>
> select CHOICE in list-installed-kernels remove-a-specific-kernel
> remove-all-previous-kernels quit
> do
> case "$CHOICE" in
>
> list-installed-kernels)
>
> echo "List of currently installed Linux kernels"
> dpkg --list | grep linux-image | egrep '^[r,i]i' | cut -d" " -f3
>
> ;;
> remove-a-specific-kernel)
>
> echo "List of currently installed Linux kernels"
> dpkg --list | grep linux-image | egrep '^[r,i]i' | cut -d" " -f3
> echo "Please enter kernel package to uninstall from your pc (for
> example: linux-image-3.9.0-030900rc5-generic) "
> read KERNELVERSION
> apt-cache search $KERNELVERSION|cut -d" " -f1|xargs sudo apt-get
> remove -y
>
> ;;
> remove-all-previous-kernels)
>
> echo "Will now purge all the following kernel packages:"
> dpkg -l 'linux-*' | grep -v libc| sed '/^ii/!d;/'"$(uname -r | sed
> "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
> dpkg -l 'linux-*' | grep -v libc| sed '/^ii/!d;/'"$(uname -r | sed
> "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
> | xargs sudo apt-get -y purge
>
> ;;
> quit)
>
> exit
>
> ;;
> esac
>
> done
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013/+confirm?answer_id=17
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/ntp/+question/229013
>
> You received this question notification because you asked the question.
>

--
Regards

Ramesh R

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#20

Setting thread status back to "answered", because there are no open questions in this thread.

Please use the "just add a comment" button when you are not asking a question, but just giving remarks.

Can you help with this problem?

Provide an answer of your own, or ask ramesh raman for more information if necessary.

To post a message you must log in.