As I mentioned in the last post a “minimal” febootstrap Fedora install clocks in at a staggering 225 MB. When I say minimal, I mean just bash and the simplest command-line tools from coreutils:
$ ls /bin arch chgrp cut echo fgrep ls mv rmdir stty true basename chmod date egrep grep mkdir nice sh su uname bash chown dd env link mknod pwd sleep sync unlink cat cp df false ln mktemp rm sort touch
Where does all the space go?
Thanks to KDE’s filelight tool, we can easily visualize the disk usage, in a nice interactive graphical way.
34% of the total disk space (76 MB) is taken up with a single file,
/usr/lib/locale/locale-archive. We suspect this is an optional file that contains all locale information and is mapped into every glibc-using process. Since the minimal image I have in mind is non-interactive, there doesn’t seem to be much point in having locales at all, and this can be deleted. Obviously if you wanted an interactive, internationalized Fedora, you can’t just go and remove this file.
Another 34% is taken up with the yum cache, ie. the packages that we installed. This just needs to be deleted, and febootstrap should have an option to do this automatically.
6% (15 MB) are the locale files. As explained above, these can go.
3% (8 MB) is, extraordinarily, cracklib. It turns out that coreutils requires pam, which requires cracklib to test the strength of passwords. This is completely useless for us, because the virtual machine image won’t even have a login prompt, never mind the ability to change passwords.
A further 5% is documentation, man pages and i18n stuff that we don’t care about.
Just removing the above brings the image down to 38 MB. The next step will be to do some much more aggressive minimization, based on analyzing the binaries that we’re actually going to use and their dependencies.