Constipated Ibex

Tim Frost timfrost at xtra.co.nz
Sat Apr 11 09:07:57 UTC 2009


On Fri, 2009-04-10 at 18:02 -0400, Pete Clapham wrote:
> OK.  This seems to have showed something.  The constipated directory
> appears to be /lib/modules, of which there are the following
> directories:
> 
> drwxr-xr-x 2 root root 4096 2009-01-28 13:30 2.6.27-11-generic
> drwxr-xr-x 4 root root 4096 2009-04-09 07:37 2.6.27-11-server
> drwxr-xr-x 4 root root 4096 2009-01-25 15:35 2.6.27-7-server
> drwxr-xr-x 2 root root 4096 2009-01-25 15:01 2.6.27-9-generic
> drwxr-xr-x 4 root root 4096 2009-01-25 15:36 2.6.27-9-server
> 
> The numbers look like kernels to me, but I'm not sure.  Can I delete
> all of these?  Any of these?  Can you tell me what they are?

They are the directories of kernel modules for a number of installed
kernels.  Ubuntu does not automatically remove old kernels, or
associated packages.  You should remove those old packages, rather than
just removing these directories, because that will remove the kernel and
grub menu entries and do other clean-up work that is appropriate.

You can find out what kernel packages are installed with:
	dpkg -l linux* | awk '/^ii / {printf "%-40s %s\n", $2, $3}'
which will list package names and versions.  For my PC (Jaunty, 64-bit),
I currently get:
tim at zaphod:~$ dpkg -l linux* | awk '/^ii / {printf "%-40s %s\n", $2,
$3}'
linux-firmware                           1.11
linux-generic                            2.6.28.11.14
linux-headers-2.6.28-11                  2.6.28-11.41
linux-headers-2.6.28-11-generic          2.6.28-11.41
linux-headers-generic                    2.6.28.11.14
linux-image-2.6.28-11-generic            2.6.28-11.41
linux-image-generic                      2.6.28.11.14
linux-libc-dev                           2.6.28-11.41
linux-restricted-modules-2.6.28-11-generic 2.6.28-11.15
linux-restricted-modules-common          2.6.28-11.15
linux-restricted-modules-generic         2.6.28.11.14
linux-sound-base                         1.0.18.dfsg-1ubuntu8

You can tell the current version with 'uname -r':
tim at zaphod:~$ uname -r
2.6.28-11-generic


So I could remove any linux kernel packages for versions other than
2.6.28-11.

In your case, it should be safe to remove all of the following packages
that are installed (I assume that the system has been booted to the
2.6.27-11 kernel):
 linux-headers-2.6.27-7
 linux-image-2.6.27-7
 linux-headers-2.6.27-7-generic
 linux-image-2.6.27-7-generic
 linux-restricted-modules-2.6.27-7-generic
 linux-restricted-modules-2.6.27-7
 linux-headers-2.6.27-9
 linux-image-2.6.27-9
 linux-headers-2.6.27-9-generic
 linux-image-2.6.27-9-generic
 linux-restricted-modules-2.6.27-9-generic
 linux-restricted-modules-2.6.27-9
 linux-headers-2.6.27-9-server
 linux-image-2.6.27-9-server
 linux-restricted-modules-2.6.27-9-server
and any other kernel packages with either 2.6.27-7 or 2.6.27-9 in the
package name or version number.

> 
> Thanks.

You may be able to reclaim space with
	sudo apt-get autoclean
which removes obsolete packages from apt's cache.
>  

Other places to check (since you seem to have the entire OS environment
on one partition) are:
/tmp
/var/tmp
/var/cache/apt 
/home 
> 
> cheers,
> pete

What is the output of 
	sudo du -sk `ls -d /* | egrep -v '/proc|/dev|/lost
+found|/archive|/backup|/Major_Collections|/backup_Major_Collections'`
2>/dev/null |  sort -nr

(The above all as one line).  That command:
  1: lists  the direct contents of the root directory
  2: excludes the root of other file systems or mount points
(/proc, /dev, and the explicit other disks)


after the cleanup ( the first lines in that output will show the biggest
space hogs on the / disk).


It may also pay to unmount all of those extra disks, to check if there
is a hidden file/directory structure on the root disk for any of them,
as that will never be able to be seen or cleaned up while the disk is
mounted.

T
-- 
Tim Frost <timfrost at xtra.co.nz>





More information about the ubuntu-users mailing list