Joined: 16 Apr 2002
|Posted: Thu Jan 16, 2003 3:55 pm Post subject: SA1: Running out of disk space
|Navigation: [System Administration] [Table of Contents]
Safe to delete:
which can get filled if emerges are aborted (or crash?).
- Unused kernel sources under /usr/src
"du -h --max-depth=1 /usr/src" will report how much space is being used.
- Unused modules under /lib/modules
Delete only those modules associated with old kernels you are no longer using.
Delete with caution:
*Above all else, please respect the donated hardware and bandwidth that is provided for Gentoo users.
Deleting all files in this directory should only be done if you are having serious issues with disk space. Do not think downloading isn't a problem because you have "plenty of bandwidth."* Consider using a script to delete only the files that aren't needed. More scripts are available here. Note that eclean is included in gentoolkit.
If you keep old kernels installed, you may be able to free up some disk space by removing them. /usr/src/linux is a link to the currently used kernel, so be careful what you delete. Also, a minor amount of diskspace can be restored from removing unused "arch"es in /usr/src/<kernel version>/arch/.
If you use portage's -b (--buildpkg) option, you probably have unused binaries in this directory. Consider using a script such as eclean to remove old binaries. If they are removed from this directory, you will likely be left with dead links from directories in /usr/portage/packages/ that symlink to All. After removing the binaries, this script will remove the dead links:
Note: You can replace 'rm' in xargs with 'echo' to see what it will do without removing anything.
find /usr/portage/packages -xtype l -print0 |xargs -0 rm
And other log files. These files can sometimes become very large. Consider using a log rotating program, such as logrotate.
Do NOT delete:
- /var/cache/edb if you use portage-2.0.50 or lower. Users of portage-2.0.51 can delete /var/cache/edb.
- tune2fs -m 0 /dev/hdaX
Normally there is some 5% of each partition reserved for the admin, with this command you can decrease it,in this case to 0%, but u can place other values as well. (suggested by defenderBG, 2007.May)
FAQ in progress, see this thread. Other reference threads: 1, 2, 3.
Search keywords: diskspace space disk
2006-06-22: Added note about eclean being included with gentoolkit. --kallamej
It takes a little while to get the facts. You still don't know the facts.