From: art@broomstick.com   
      
   AZ Nomad wrote:   
   > On Mon, 18 Jun 2007 20:22:08 -0600, ray wrote:   
   >   
   >   
   >> I find that my 10gb Gentoo partition has filled up. I find 1.8gb in   
   >> /var/tmp/ccache and 1.2gb in /usr/src. I've been looking at   
   >> gentoo.org in the docs section to find appropriate commands to clean   
   >> things out, but without luck, so far. Can someone tell me how to do   
   >> that or at least what is safe to delete.   
   >   
   >> thanks   
   >   
   > the only thing in /usr/src should be kernel and you can only get rid   
   > of   
   > it entirely if you won't be building any more packages that depend on   
   > it. What you can do is a 'make mrproper' in it to clean out all the   
   > object files. You can also get rid of all versions other than the   
   > current running version. Do a 'uname -r' to get that information.   
      
   Do not do "make mrproper" for the /current/ kernel, or you won't be able to   
   emerge 3rd party modules. In /usr/src/linux (which should be a symlink to   
   the current kernel), do "make clean; make modules_prepare" instead.   
      
   To get rid of all kernel versions except the latest you installed:   
      
   emerge --prune sys-kernel/gentoo-sources   
      
   (Substitute gentoo-sources with the kernel you use -- it could be   
   hardened-sources or vanilla or bsd or...)   
      
   After this, you can rm -r the directories for the versions you removed from   
   under /usr/src/   
      
   > You can also get rid of all the unused versions in /lib/modules.   
      
   Just don't get rid of them if there still are kernels using them under   
   /boot -- sometimes you want to be able to boot into an older kernel.   
      
   Another few space savers:   
      
   check /usr/portage/distfiles, and remove the older versions of any source   
   package which you have more than one version of. (Or zonk it all if you   
   want to, but then you'll have to re-download the packages if rebuilding   
   anything.)   
   If you have gentoolkit installed, you might want to clean out   
   /usr/portage/distfiles automatically by running "eclean-dist" (will only   
   remove packages that no longer have an ebuild) or "eclean-dist -d" (to   
   remove everything except what you need for a reinstall).   
      
   For ccache, you can do:   
   # if compiling something, wait until finished.   
   cd /var/tmp/ccache   
   rm -f tmp.*   
   find . -type f -mtime +360 | xargs rm   
   # adjust 360 to fit your needs - any files that old in days will be removed   
   ccache -c # this one will take a while   
      
   To get rid of left-over files from emerge compiles:   
   cd /var/tmp/portage   
   rm -rf *   
      
   If running apache:   
   rm -f /tmp/sess_*   
      
   If running mysql:   
   # Unless you're running replication:   
   mysql -e "purge master logs before '`date +%Y-%m-%d` 00:00:00'"   
   # In any case:   
   /usr/bin/mysqloptimize -As   
      
   If using xfs (not the X font server, but the file system), emerge xfsdump   
   and run:   
   xfs_fsr -v   
   # This will defragment all xfs hard drives, which can free up some space   
   too, due to getting rid of unnecessary extents.   
      
   Then there's /var/log/... I recommend using the logrotate package or   
   similar, and make sure that logs are rotated and compressed every now and   
   then.   
      
   Good luck cleaning!   
   --   
   *Art   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|