ok, you remember the good old days when 500 Mb hard disk drives where considered huge, how easily you installed lots of crap on it, and then how hard it is to remove it just to install some more crap.

now its a bit the same with coLinux, the default images that are supplied are rather small for a good reason (they must fit on the disk once uncompressed :) and usually range from 1 Gb to 2 Gb. now you can enlarge them to a bigger size, move all your files to a bigger filesystem image, but sonner or later you will have to do some housekeeping.

Yes, housekeeping. imagine you want to archive your image for backup purpose and forget it for a while, or that you want to ship your image to a friend. it should be as small as possible, of course.

tips not specific to any distribution :[]

  • there are some log files in /var/cache and /var/log . they should not get thaaat big, but if you know what you are doing, you can use file to spot logs stored in ASCII format, take a quick look at them and empty them if you want. also, consider using logrotate.
  • the right way to empty a journal file is to use
: > the_file


echo -n "" > the_file

do NOT remove them with rm then recreate them with touch - there is a possibility that the file will be recreated in between, and you would lose any information logged to this file handle.

  • "ccache is a compiler cache. It speeds up re-compilation of C/C++ code by caching previous compiles and detecting when the same compile is being done again." (Debian). this is especially useful on Gentoo. the cached files usually lie in your home directory, in ~/.ccache - after several months of use, those files accounted for about 200 or 300 megabytes.
  • /tmp and /var/tmp can occasionaly contain big files, too.

tips specific to a given distribution[]

  • Gentoo:: the various sources files that are downloaded are NOT removed : they are stored in /usr/portage/distfiles and can take some space.
    • you may also consider removing the content of /usr/portage and /var/cache/edb as their content will be remplaced by next emerge (not confirmed, Gentoo gurus will confirm or infirm)
    • /var/tmp contains distfiles portage-pkg portage (8 MB)
Debian:: apt-get clean
Fedora:: apt-get clean
  • yum clean

ok, now last tip :

  • you should use
dd if=/dev/zero of=foobar bs=1M ; sync ; rm foobar

to "zero" or "clear" all your unused blocks prior to compression - indeed, they are marked as free, but still hold old data, so would compress less.

  • gzip is much faster than bzip2 but compress a bit less efficiently. lzop is even faster but only compresses lightly. 7-zip compresses very well but can be exceptionally slow, however, if you use it in 'fast' or 'fastest' modes it can run faster than gzip but with better compression.

MassTranslated on Sun Apr 23 17:36:51 UTC 2006